posix-shell.m4: reject opensolaris's "sh (AT&T Research) 1993-12-28 s+"
authorJim Meyering <meyering@redhat.com>
Sat, 13 Sep 2008 22:05:26 +0000 (00:05 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 16 Sep 2008 09:54:55 +0000 (11:54 +0200)
* 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.

ChangeLog
m4/posix-shell.m4

index 32e7ed9..0ea00e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-16  Jim Meyering  <meyering@redhat.com>
+
+       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  <bonzini@gnu.org>
 
        * tests/test-poll.c (connect_to_socket): Allow non-blocking connect
index 7f3b1e9..4c56193 100644 (file)
@@ -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