bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Use of chmod in gnulib
@ 2020-03-22 17:17 Jeffrey Walton
  2020-03-22 19:18 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey Walton @ 2020-03-22 17:17 UTC (permalink / raw)
  To: bug-gnulib

Hi Everyone,

According to the Autoconf manual, commands like 'chmod +x' should be
avoided in favor of 'chmod a+x'. I believe the same applies to 'chmod
-w' and friends. Also see
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Usual-Tools.html.

It looks like there are some of the earlier in the gnulib sources:

$grep -IR 'chmod +' ./*
./gnulib/tests/test-set-mode-acl.sh:            /bin/chmod +a
"user:daemon allow execute" tmpfile0
./gnulib/tests/test-copy-file.sh:        /bin/chmod +a "user:daemon
allow execute" tmpfile0
./gnulib/tests/test-copy-file.sh:        /bin/chmod +a "group:daemon
allow read" tmpfile0
./gnulib/tests/test-copy-acl.sh:        /bin/chmod +a "user:daemon
allow execute" tmpfile0
./gnulib/tests/test-copy-acl.sh:        /bin/chmod +a "group:daemon
allow read" tmpfile0
./gnulib/tests/test-file-has-acl.sh:        /bin/chmod +a "user:daemon
allow execute" tmpfile0
./gnulib/m4/progtest.m4:chmod +x conf$$.file
./gnulib_test/gltests/test-set-mode-acl.sh:            /bin/chmod +a
"user:daemon allow execute" tmpfile0
./gnulib_test/gltests/test-copy-file.sh:        /bin/chmod +a
"user:daemon allow execute" tmpfile0
./gnulib_test/gltests/test-copy-file.sh:        /bin/chmod +a
"group:daemon allow read" tmpfile0
./gnulib_test/gltests/test-copy-acl.sh:        /bin/chmod +a
"user:daemon allow execute" tmpfile0
./gnulib_test/gltests/test-copy-acl.sh:        /bin/chmod +a
"group:daemon allow read" tmpfile0
./gnulib_test/gltests/test-file-has-acl.sh:        /bin/chmod +a
"user:daemon allow execute" tmpfile0
./gnulib_test/configure:  chmod +x "$as_me.lineno" ||
./gnulib_test/configure:test $as_write_fail = 0 && chmod +x
$CONFIG_STATUS || ac_write_fail=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Use of chmod in gnulib
  2020-03-22 17:17 Use of chmod in gnulib Jeffrey Walton
@ 2020-03-22 19:18 ` Paul Eggert
  2020-03-22 19:33   ` Jeffrey Walton
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2020-03-22 19:18 UTC (permalink / raw)
  To: noloader; +Cc: bug-gnulib

On 3/22/20 10:17 AM, Jeffrey Walton wrote:

> According to the Autoconf manual, commands like 'chmod +x' should be
> avoided in favor of 'chmod a+x'. I believe the same applies to 'chmod
> -w' and friends. Also see
> https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Usual-Tools.html.
> 
> It looks like there are some of the earlier in the gnulib sources:

Those uses look safe to me. Either they're 'chmod +a' which is a macOS extension 
and so the Autoconf advice doesn't apply, or they're 'chmod +x' on a newly 
created file which is safe unless someone has a purposely-harmful and 
unsupported umask like 0777 which will break 'configure' in countless other ways.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Use of chmod in gnulib
  2020-03-22 19:18 ` Paul Eggert
@ 2020-03-22 19:33   ` Jeffrey Walton
  0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey Walton @ 2020-03-22 19:33 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib

On Sun, Mar 22, 2020 at 3:18 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 3/22/20 10:17 AM, Jeffrey Walton wrote:
>
> > According to the Autoconf manual, commands like 'chmod +x' should be
> > avoided in favor of 'chmod a+x'. I believe the same applies to 'chmod
> > -w' and friends. Also see
> > https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Usual-Tools.html.
> >
> > It looks like there are some of the earlier in the gnulib sources:
>
> Those uses look safe to me. Either they're 'chmod +a' which is a macOS extension
> and so the Autoconf advice doesn't apply, or they're 'chmod +x' on a newly
> created file which is safe unless someone has a purposely-harmful and
> unsupported umask like 0777 which will break 'configure' in countless other ways.

If that's true, then it sounds like the manual is wrong and the manual
should be updated.

Jeff


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-22 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22 17:17 Use of chmod in gnulib Jeffrey Walton
2020-03-22 19:18 ` Paul Eggert
2020-03-22 19:33   ` Jeffrey Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).