GNU bug report logs - #14152
[PATCH] build: use 'chmod a-w' instead of 'chmod -w'

Previous Next

Package: coreutils;

Reported by: Enrico Scholz <enrico.scholz <at> informatik.tu-chemnitz.de>

Date: Sat, 6 Apr 2013 16:14:02 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bob Proulx <bob <at> proulx.com>
To: 14152 <at> debbugs.gnu.org
Cc: Enrico Scholz <enrico.scholz <at> informatik.tu-chemnitz.de>
Subject: bug#14152: [PATCH] build: use 'chmod a-w' instead of 'chmod -w'
Date: Sat, 6 Apr 2013 16:27:35 -0600
Pádraig Brady wrote:
> > -	  && chmod -w $@-t						\
> > +	  && chmod a-w $@-t						\
> 
> I'll apply that fix.

I think it is always a good idea to use 'a' when there isn't any other
specific reason to do anything different.  Or put the reverse way,
whenever I see a naken "-[rwx]" then I am suspicious of the action.
Because it masks with umask and is almost never what is desired.

> What system does the build fail on as a matter of interest.

This will occur on any system that has umask set to 022.  Here is an example:

  $ umask 022
  $ touch foo
  $ chmod ug+w foo
  $ chmod -w foo
  chmod: foo: new permissions are r--rw-r--, not r--r--r--
  $ echo $?
  1

Bob




This bug report was last modified 12 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.