From 410a8422274b4b31b9261b4d10a5afe20eb1547e Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 4 Jan 2004 00:02:28 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ configure | 10 +++++----- m4/mkdirp.m4 | 22 ++++++++++++++++------ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0869437..710fcb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-01-04 Alexandre Duret-Lutz + + * 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. + 2004-01-03 Alexandre Duret-Lutz * automake.in (scan_texinfo_file): Do not compare $outfile to '' diff --git a/configure b/configure index 0f12050..97e1dd2 100755 --- a/configure +++ b/configure @@ -1455,22 +1455,22 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -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 --' else # 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 ./--; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs) -m 0755' + mkdir_p='$(mkinstalldirs)' else - mkdir_p='$(install_sh) -m 0755 -d' + mkdir_p='$(install_sh) -d' fi fi diff --git a/m4/mkdirp.m4 b/m4/mkdirp.m4 index 034fc91..e2c39d0 100644 --- a/m4/mkdirp.m4 +++ b/m4/mkdirp.m4 @@ -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. AC_DEFUN([AM_PROG_MKDIR_P], -[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 --' else # 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 ./--; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs) -m 0755' + mkdir_p='$(mkinstalldirs)' else - mkdir_p='$(install_sh) -m 0755 -d' + mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) -- 2.7.4