]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20110429 snapshot
authorChet Ramey <chet.ramey@case.edu>
Thu, 29 Dec 2011 18:07:22 +0000 (13:07 -0500)
committerChet Ramey <chet.ramey@case.edu>
Thu, 29 Dec 2011 18:07:22 +0000 (13:07 -0500)
CWRU/CWRU.chlog
config-top.h
execute_cmd.c
lib/sh/eaccess.c
tests/printf2.sub

index 2e612a9a2e7120c0175c920563fcd1535607d488..b26e93992ba031c31f9692b566040111d225df8f 100644 (file)
@@ -9648,7 +9648,7 @@ lib/sh/eaccess.c
        - eaccess(2) apparently does only half the job: it does not check that
          the permission bits on a file actually allow, for instance, execution.
          Need to augment with a call to sh_stataccess if eaccess returns
-         success on FreeBSD.  Fixes FreeBSD problem reported by Jonan Hattne
+         success on FreeBSD.  Fixes FreeBSD problem reported by Johan Hattne
          <johan.hattne@utsouthwestern.edu>
 
                                   3/28
@@ -11534,3 +11534,18 @@ configure.in
        - if not cross-compiling, set CFLAGS_FOR_BUILD from any CFLAGS inherited
          from the environment.  Fixes HP/UX build problem reported by
          "Daniel Richard G." <skunk@iSKUNK.ORG>
+
+                                  4/26
+                                  ----
+config-top.h
+       - define MULTIPLE_COPROCS to 0 so the code is still disabled but easy
+         to enable via configure option or editing this file
+
+                                  4/29
+                                  ----
+lib/sh/eaccess.c
+       - freebsd provides faccessat, with the same misfeature as their eaccess
+         and access implementations (X_OK returns true for uid==0 regardless
+         of the actual file permissions), so reorganize code to check the
+         file permissions as with eaccess.  Report and fix from Johan Hattne
+         <johan.hattne@utsouthwestern.edu>
index 8c651f4b664a05eb2a63bfb220338c00f5f76629..e7fce479675907af94a94df6f5113d5f089d6fc8 100644 (file)
 
 /* Define if you want to include code in shell.c to support wordexp(3) */
 /* #define WORDEXP_OPTION */
+
+/* Define as 1 if you want to enable code that implements multiple coprocs */
+#ifndef MULTIPLE_COPROCS
+#  define MULTIPLE_COPROCS 0
+#endif
index 910d2e27c652b5f90e8859c730b6fb8cd5b29b40..ff63eb333a3792892808c37ab4ae12b4720512f5 100644 (file)
@@ -1694,7 +1694,7 @@ cpl_closeall ()
 {
   struct cpelement *cpe;
 
-  for (cpe = coproc_list.head; cpe; )
+  for (cpe = coproc_list.head; cpe; cpe = cpe->next)
     coproc_close (cpe->coproc);
 }
 
@@ -1704,7 +1704,7 @@ cpl_fdchk (fd)
 {
   struct cpelement *cpe;
 
-  for (cpe = coproc_list.head; cpe; )
+  for (cpe = coproc_list.head; cpe; cpe = cpe->next)
     coproc_checkfd (cpe->coproc, fd);
 }
 
index d9bca8c40b448596af15b9180f655f54784637a5..2dbaf409983980568701f6d85d312dfb33275f2d 100644 (file)
@@ -203,14 +203,16 @@ sh_eaccess (path, mode)
   if (path_is_devfd (path))
     return (sh_stataccess (path, mode));
 
-#if defined (HAVE_FACCESSAT) && defined (AT_EACCESS)
-  return (faccessat (AT_FDCWD, path, mode, AT_EACCESS));
-#elif defined (HAVE_EACCESS)           /* FreeBSD */
+#if (defined (HAVE_FACCESSAT) && defined (AT_EACCESS)) || defined (HAVE_EACCESS)
+#  if defined (HAVE_FACCESSAT) && defined (AT_EACCESS)
+  ret = faccessat (AT_FDCWD, path, mode, AT_EACCESS);
+#  else                /* HAVE_EACCESS */      /* FreeBSD */
   ret = eaccess (path, mode);  /* XXX -- not always correct for X_OK */
-#  if defined (__FreeBSD__)
+#  endif       /* HAVE_EACCESS */
+#  if defined (__FreeBSD__) || defined (SOLARIS)
   if (ret == 0 && current_user.euid == 0 && mode == X_OK)
     return (sh_stataccess (path, mode));
-#  endif
+#  endif       /* __FreeBSD__ || SOLARIS */
   return ret;
 #elif defined (EFF_ONLY_OK)            /* SVR4(?), SVR4.2 */
   return access (path, mode|EFF_ONLY_OK);
@@ -231,7 +233,6 @@ sh_eaccess (path, mode)
        return (sh_stataccess (path, mode));
 #endif
       return ret;
-      
     }
 
   return (sh_stataccess (path, mode));
index b8e545843425f969a59deb961d1bf410a6573bef..45c48d4c401cb7863b8a9d1c21549354bcc46d28 100644 (file)
@@ -1,4 +1,4 @@
-UNSET LC_ALL LC_CTYPE
+unset LC_ALL LC_CTYPE
 export LANG=en_US.UTF-8
 
 case $(printf %d\\n \'À) in