autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Don't use "chmod -w"


From: Paul Eggert
Subject: Don't use "chmod -w"
Date: 05 Jan 2004 00:21:50 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

I installed this Autoconf patch, which should be self-explanatory.

2004-01-05  Paul Eggert  <address@hidden>

        * 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".

Index: bin/Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/bin/Makefile.am,v
retrieving revision 1.15
diff -p -u -r1.15 Makefile.am
--- bin/Makefile.am     25 Sep 2003 09:30:34 -0000      1.15
+++ bin/Makefile.am     5 Jan 2004 08:16:32 -0000
@@ -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
 
 
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.787
diff -p -u -r1.787 autoconf.texi
--- doc/autoconf.texi   5 Jan 2004 07:05:22 -0000       1.787
+++ doc/autoconf.texi   5 Jan 2004 08:16:49 -0000
@@ -10873,6 +10873,19 @@ practice.  Typically the C compiler is i
 compiler name.
 
 
address@hidden @command{chmod}
address@hidden ------------------
address@hidden @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,
address@hidden 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
address@hidden does not work on some older hosts.
+
+
 @item @command{cmp}
 @c ----------------
 @prindex @command{cmp}
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/Makefile.am,v
retrieving revision 1.8
diff -p -u -r1.8 Makefile.am
--- lib/Makefile.am     25 Jun 2003 13:38:54 -0000      1.8
+++ lib/Makefile.am     5 Jan 2004 08:16:50 -0000
@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]