[Top][All Lists]

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

Re: 1.8 and mkdir_p

From: Alexandre Duret-Lutz
Subject: Re: 1.8 and mkdir_p
Date: Sun, 04 Jan 2004 01:02:10 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

[ The reason I initially included Billy and Bruno in the Cc is
that as Billy was the first to raise these issues he may want to
further comment on, and whatever we do with mkdir/mkinstalldir
may have some repercussions on Gettext (and vice-versa).  Please
keep them in the loop. ]

>>> "Russ" == Russ Allbery <address@hidden> writes:

 Russ> Andrew Suffield <address@hidden> writes:
 >> On Sat, Jan 03, 2004 at 04:25:47PM +0100, Alexandre Duret-Lutz wrote:

 >>> - is it normal to honor umask when creating directories and not 
 >>> when installing files?

 >> I'd say it was normal to honour umask at all times. 

The problem is that previous versions of Automake honored umask
only for directories, not for files.  Binaries are always
installed with mode 755 and data files with mode 644.  Hence the

I don't know how it could be fixed or if it should.  Perhaps we
should not worry about this.  After all, nobody complained about
file permissions so far...

(Occasionally some package maintainer ask how to install a
config file that is readable only by root, but that is a
different question.  What we are talking about here are
installers who might want all data files installed with mode
664, for instance.)

 >> People who ask for applications to ignore umask because they
 >> have a silly umask set, usually need repeatedly kicking in
 >> the head.

 Russ> Amen.  People who install applications with a umask of
 Russ> 077 and then find no one can run them are a
 Russ> self-correcting problem.

I'm installing the following patch on HEAD and branch-1-8.

2004-01-04  Alexandre Duret-Lutz  <address@hidden>

        * m4/mkdirp.m4: Do not use `-m 0755'.  This overrides special bits
        and break setups where 775 directories are expected.  Just obey
        umask as we did in the past.
        Report from Harlan Stenn.

Index: m4/mkdirp.m4
RCS file: /cvs/automake/automake/m4/mkdirp.m4,v
retrieving revision 1.2
diff -u -r1.2 mkdirp.m4
--- m4/mkdirp.m4        13 Nov 2003 19:18:03 -0000      1.2
+++ m4/mkdirp.m4        3 Jan 2004 23:40:40 -0000
@@ -2,7 +2,7 @@
 # ---------------
 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -19,23 +19,33 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
-[if mkdir -m 0755 -p -- . 2>/dev/null; then
-  mkdir_p='mkdir -m 0755 -p --'
+[if mkdir -p -- . 2>/dev/null; then
+  mkdir_p='mkdir -p --'
   # On NextStep and OpenStep, the `mkdir' command does not
   # recognize any option.  It will interpret all options as
   # directories to create, and then abort because `.' already
   # exists.
-  for d in ./-m ./0755 ./-p ./--;
+  for d in ./-p ./--;
     test -d $d && rmdir $d
   # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
   if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs) -m 0755'
+    mkdir_p='$(mkinstalldirs)'
-    mkdir_p='$(install_sh) -m 0755 -d'
+    mkdir_p='$(install_sh) -d'

Alexandre Duret-Lutz

reply via email to

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