summaryrefslogtreecommitdiff
path: root/infra/dgit-repos-policy-debian
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-04 17:23:37 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:10 +0100
commitef676d2d2e300a8b81166929ab836ba7e50a1356 (patch)
treea5cb5aa813d55310dacd15db2681f042c7d157d2 /infra/dgit-repos-policy-debian
parente270c55f02ce8839a6a2f4fbc316b213e4eaa9d1 (diff)
dgit-repos-policy-debian: Fix mode calculation
Diffstat (limited to 'infra/dgit-repos-policy-debian')
-rwxr-xr-xinfra/dgit-repos-policy-debian5
1 files changed, 4 insertions, 1 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian
index 2e0bcc7..ce98cd7 100755
--- a/infra/dgit-repos-policy-debian
+++ b/infra/dgit-repos-policy-debian
@@ -376,7 +376,10 @@ END
my $oldmode = ((stat _)[2]);
my $oldwrites = $oldmode & 0222;
# remove r and x bits which have corresponding w bits clear
- my $newmode = $oldmode & ($oldwrites << 1) & ($oldwrites > 1);
+ my $newmode = $oldmode &
+ (~0555 | ($oldwrites << 1) | ($oldwrites >> 1));
+ printdebug sprintf "chmod %#o (was %#o) %s\n",
+ $newmode, $oldmode, $freshrepo;
chmod $newmode, $freshrepo or die $!;
}
}