From: Paul Eggert Date: Mon, 5 Jan 2004 08:18:24 +0000 (+0000) Subject: Don't use "chmod -w". X-Git-Tag: AUTOCONF-2.59c~766 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6a02e8ae7b964d3ee630b91bb438a0e13a07348;p=thirdparty%2Fautoconf.git Don't use "chmod -w". --- diff --git a/ChangeLog b/ChangeLog index 24c6679be..c40edc636 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-01-05 Paul Eggert + + * bin/Makefile.am (autoconf, autoheader, autom4te, autoreconf, + autoscan, autoupdate, ifnames): Don't use chmod -w. + * lib/Makefile.am (autom4te.cfg): Likewise. + * doc/autoconf.texi (Limitations of Usual Tools): Warn against + "chmod -w". + 2004-01-04 Paul Eggert Paolo Bonzini diff --git a/bin/Makefile.am b/bin/Makefile.am index 378f7f987..c2527dd67 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -1,7 +1,9 @@ ## Process this file with automake to create Makefile.in. -*-Makefile-*- ## Makefile for Autoconf. -## Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +## Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software +## Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -64,49 +66,49 @@ autoconf: $(srcdir)/autoconf.in Makefile rm -f autoconf autoconf.tmp $(edit) $(srcdir)/autoconf.in >autoconf.tmp chmod +x autoconf.tmp - chmod -w autoconf.tmp + chmod a-w autoconf.tmp mv -f autoconf.tmp autoconf autoheader: $(srcdir)/autoheader.in Makefile rm -f autoheader autoheader.tmp $(edit) $(srcdir)/autoheader.in >autoheader.tmp chmod +x autoheader.tmp - chmod -w autoheader.tmp + chmod a-w autoheader.tmp mv -f autoheader.tmp autoheader autom4te: $(srcdir)/autom4te.in Makefile rm -f autom4te autom4te.tmp $(edit) $(srcdir)/autom4te.in >autom4te.tmp chmod +x autom4te.tmp - chmod -w autom4te.tmp + chmod a-w autom4te.tmp mv -f autom4te.tmp autom4te autoreconf: $(srcdir)/autoreconf.in Makefile rm -f autoreconf autoreconf.tmp $(edit) $(srcdir)/autoreconf.in >autoreconf.tmp chmod +x autoreconf.tmp - chmod -w autoreconf.tmp + chmod a-w autoreconf.tmp mv -f autoreconf.tmp autoreconf autoscan: $(srcdir)/autoscan.in Makefile rm -f autoscan autoscan.tmp $(edit) $(srcdir)/autoscan.in >autoscan.tmp chmod +x autoscan.tmp - chmod -w autoscan.tmp + chmod a-w autoscan.tmp mv -f autoscan.tmp autoscan autoupdate: $(srcdir)/autoupdate.in Makefile rm -f autoupdate autoupdate.tmp $(edit) $(srcdir)/autoupdate.in >autoupdate.tmp chmod +x autoupdate.tmp - chmod -w autoupdate.tmp + chmod a-w autoupdate.tmp mv -f autoupdate.tmp autoupdate ifnames: $(srcdir)/ifnames.in Makefile rm -f ifnames ifnames.tmp $(edit) $(srcdir)/ifnames.in >ifnames.tmp chmod +x ifnames.tmp - chmod -w ifnames.tmp + chmod a-w ifnames.tmp mv -f ifnames.tmp ifnames diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 8d825d9ab..7e7962310 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -10873,6 +10873,19 @@ practice. Typically the C compiler is invoked from makefiles that use compiler name. +@item @command{chmod} +@c ------------------ +@prindex @command{chmod} +Avoid usages like @samp{chmod -w file}; use @samp{chmod a-w file} +instead, for two reasons. First, plain @samp{-w} does not necessarily +make the file unwriteable, since it does not affect mode bits that +correspond to bits in the file mode creation mask. Second, +@acronym{POSIX} says that the @samp{-w} might be interpreted as an +implementation-specific option, not as a mode; @acronym{POSIX} suggests +using @samp{chmod -- -w file} to avoid this confusion, but unfortunately +@samp{--} does not work on some older hosts. + + @item @command{cmp} @c ---------------- @prindex @command{cmp} diff --git a/lib/Makefile.am b/lib/Makefile.am index 68630529a..adbf7cb21 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to create Makefile.in -## Copyright 2002 Free Software Foundation, Inc. +## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -42,5 +42,5 @@ CLEANFILES = autom4te.cfg autom4te.cfg: $(srcdir)/autom4te.in Makefile rm -f autom4te.cfg autom4te.tmp $(edit) $(srcdir)/autom4te.in >autom4te.tmp - chmod -w autom4te.tmp + chmod a-w autom4te.tmp mv autom4te.tmp autom4te.cfg