Comment 4 for bug 1938886

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

dh_strip does

strip --remove-section=.comment --remove-section=.note --strip-unneeded -o /tmp/OdGxqpWWsW/stripeIrB_j debian/virtualbox/usr/lib/virtualbox/VBoxSDL.so
cat '/tmp/OdGxqpWWsW/stripeIrB_j' > 'debian/virtualbox/usr/lib/virtualbox/VBoxSDL.so'

which behaves differently under root and non-root.

specifically `cat anything > file` will strip setuid bits from file, irrespective of umask.

As root:
cat /dev/null > foo
chmod +s foo
ls -latr foo
-rwSr-Sr-- 1 root root 0 Aug 4 18:36 foo
cat /dev/null > foo
ls -latr foo
-rwSr-Sr-- 1 root root 0 Aug 4 18:36 foo

As mere mortal:

cat /dev/null > foo
chmod +s foo
ls -latr foo
-rwSr-Sr-- 1 xnox xnox 0 Aug 4 18:34 foo
cat /dev/null > foo
ls -latr foo
-rw-r-Sr-- 1 xnox xnox 0 Aug 4 18:34 foo

I really do not understand why mere-mortal strips user uid, keeps group uid, and root doesn't do that.