From 1ceb8093dc595bb395b0a5d8abab779b3912095f Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 23 Jan 2015 12:05:17 -0500 Subject: [PATCH] buildsystem: use 'chmod a-w' instead of 'chmod -w' 'chmod -w' is not portable and can break the build: | chmod: chmod: ss_err.h: new permissions are r--rw-r--, not r--r--r-- | ss_err.h: new permissions are r--rw-r--, not r--r--r-- | chmod: ss_err.c: new permissions are r--rw-r--, not r--r--r-- | make[2]: *** [ss_err.h] Error 1 This happens because 'chmod -w' is affected by umask. Issue can be reproduced e.g. by $ mkdir /tmp/foo $ setfacl -m d:m:rwx /tmp/foo $ umask 022 $ touch /tmp/foo/x $ chmod -w /tmp/foo/x chmod: /tmp/foo/x: new permissions are r--rw-r--, not r--r--r-- Signed-off-by: Enrico Scholz Signed-off-by: Theodore Ts'o --- lib/et/compile_et.sh.in | 4 ++-- lib/ss/mk_cmds.sh.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/et/compile_et.sh.in b/lib/et/compile_et.sh.in index a71ae8a..c2861f4 100644 --- a/lib/et/compile_et.sh.in +++ b/lib/et/compile_et.sh.in @@ -51,12 +51,12 @@ if test -f ${BASE}.h && cmp -s ${BASE}.h.$$ ${BASE}.h ; then rm -f ${BASE}.h.$$ else mv -f ${BASE}.h.$$ ${BASE}.h - chmod -w ${BASE}.h + chmod a-w ${BASE}.h fi $AWK -f "${DIR}/et_c.awk" "outfile=${BASE}.c.$$" "outfn=${BASE}.c" "$ROOT.et" if test -f ${BASE}.c && cmp -s ${BASE}.c.$$ ${BASE}.c ; then rm -f ${BASE}.c.$$ else mv -f ${BASE}.c.$$ ${BASE}.c - chmod -w ${BASE}.c + chmod a-w ${BASE}.c fi diff --git a/lib/ss/mk_cmds.sh.in b/lib/ss/mk_cmds.sh.in index 572966c..a8976a4 100644 --- a/lib/ss/mk_cmds.sh.in +++ b/lib/ss/mk_cmds.sh.in @@ -57,6 +57,6 @@ if grep "^#__ERROR_IN_FILE" "${TMP}" > /dev/null; then else rm -f "${BASE}.c" mv -f "${TMP}" "${BASE}.c" - chmod -w "${BASE}.c" + chmod a-w "${BASE}.c" exit 0 fi -- 1.8.3.1