From ef676d2d2e300a8b81166929ab836ba7e50a1356 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 4 May 2015 17:23:37 +0100 Subject: [PATCH] dgit-repos-policy-debian: Fix mode calculation --- infra/dgit-repos-policy-debian | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 2e0bcc79..ce98cd72 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 $!; } } -- 2.30.2