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


Message #22 received at 14152 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Enrico Scholz <enrico.scholz <at> informatik.tu-chemnitz.de>
Cc: 14152 <at> debbugs.gnu.org, Bob Proulx <bob <at> proulx.com>
Subject: Re: bug#14152: [PATCH] build: use 'chmod a-w' instead of 'chmod -w'
Date: Sun, 07 Apr 2013 11:54:41 +0100
On 04/07/2013 10:59 AM, Enrico Scholz wrote:
> Pádraig Brady <P <at> draigBrady.com> writes:
> 
>>>> 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
>>
>> But if the umask is 022, then those write bits shouldn't be set anyway?
> 
> These bits can be set due to various reasons; e.g.
> 
> $ mkdir /tmp/foo
> $ setfacl -m d:m:rwx /tmp/foo
> 
> $ umask 022
> $ touch /tmp/foo/x
> $ chmod -w /tmp/foo/x
> chmod: /tmp/foo/x: new permissions are r--rw-r--, not r--r--r--
> 
> 
> I use such a setup (posix defaults acls) to build foreign software as a
> special user while allowing working on the software (--> editing) as the
> normal user.

Excellent, thanks for the clarification.
I've adjusted the commit message as follows:

    build: fix man page build failure with some permissions setups

    Use the more portable 'chmod a-w', instead of the 'chmod -w' form.
    The latter is not always supported.  Also its operation is
    dependent on umask controlling the permissions bits for new files,
    which is not the case in the presence of POSIX default ACLs for e.g.
    In that case, chmod may print a warning like the following, and
    exit with failure status:

    chmod: man/hostid.1-t: new permissions are r--rw-r--, not r--r--r--

    * man/local.mk: s/-w/a-w/

thanks,
Pádraig.




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.