From: Jim Meyering Date: Sat, 13 Sep 2008 22:05:26 +0000 (+0200) Subject: posix-shell.m4: reject opensolaris's "sh (AT&T Research) 1993-12-28 s+" X-Git-Tag: v0.1~7036 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=4f26ef2e4e431adbe04f2929f775240d7f3fb466;p=gnulib.git posix-shell.m4: reject opensolaris's "sh (AT&T Research) 1993-12-28 s+" * m4/posix-shell.m4 (gl_POSIX_SHELL): Reject a shell that lets a umask modification leak out of a subshell. Otherwise, the opensolaris /bin/sh would be accepted and thus cause unwarranted failures in the coreutils test suite. --- diff --git a/ChangeLog b/ChangeLog index 32e7ed9f8..0ea00e63c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-16 Jim Meyering + + posix-shell.m4: reject opensolaris's "sh (AT&T Research) 1993-12-28 s+" + * m4/posix-shell.m4 (gl_POSIX_SHELL): Reject a shell that lets + a umask modification leak out of a subshell. Otherwise, the + opensolaris /bin/sh would be accepted and thus cause unwarranted + failures in the coreutils test suite. + 2008-09-16 Paolo Bonzini * tests/test-poll.c (connect_to_socket): Allow non-blocking connect diff --git a/m4/posix-shell.m4 b/m4/posix-shell.m4 index 7f3b1e944..4c56193c1 100644 --- a/m4/posix-shell.m4 +++ b/m4/posix-shell.m4 @@ -31,12 +31,16 @@ AC_DEFUN([gl_POSIX_SHELL], func_ret_failure () { return 1 } + subshell_umask_sanity () { + (umask 22; (umask 0); test $(umask) -eq 22) + } test "[$](echo foo)" = foo && func_success && ! func_failure && func_ret_success && ! func_ret_failure && - (set x && func_ret_success y && test x = "[$]1") + (set x && func_ret_success y && test x = "[$]1") && + subshell_umask_sanity ' for gl_cv_posix_shell in \ "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do