summaryrefslogtreecommitdiff
path: root/dh_suidregister
diff options
context:
space:
mode:
authorjoey <joey>1999-11-30 08:26:30 +0000
committerjoey <joey>1999-11-30 08:26:30 +0000
commitf2cb401a50f9f0dbc84195867c6f371b59333ad6 (patch)
treeaa21cc00f4f82547f868aec53438fe35ca69bfcc /dh_suidregister
parentcb5f6ab45790a7131bfbdb46f257dcb5b1fb5c2c (diff)
r320: Fixed a rather esoteric bug: If a file had multiple hard links, and was
suid, suidregister detected all the hard links as files that need to be registered. It looped, registering the first link, and then removing its suid bit. This messed up the registration of the other had links, since their permissions were now changed, leading to unpredictable results. The fix is to just not remove suid bits until all files have been registered.
Diffstat (limited to 'dh_suidregister')
-rwxr-xr-xdh_suidregister8
1 files changed, 7 insertions, 1 deletions
diff --git a/dh_suidregister b/dh_suidregister
index b7b3152f..b82bc7d2 100755
--- a/dh_suidregister
+++ b/dh_suidregister
@@ -39,6 +39,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$tostrip="/";
}
+ # Register files with suidregister.
foreach $file (@files) {
# Strip leading $tostrip from $file.
$file=~s/^$tostrip//;
@@ -68,7 +69,12 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
autoscript($PACKAGE,"postinst","postinst-suid",$sedstr);
autoscript($PACKAGE,"postrm","postrm-suid","$sedstr");
-
+ }
+
+ # Remove suid bits from files. This is delayed to this point, because
+ # of a situation with hard linked files if it is done earlier.
+ # See changelog for 2.0.77.
+ foreach $file (@files) {
if ( -e "$TMP/$file") {
doit("chmod","a-s","$TMP/$file");
}