From af5751ec16541eebe03adf43905425387cdeb02b Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Thu, 29 Dec 2011 13:07:22 -0500 Subject: [PATCH] commit bash-20110429 snapshot --- CWRU/CWRU.chlog | 17 ++++++++++++++++- config-top.h | 5 +++++ execute_cmd.c | 4 ++-- lib/sh/eaccess.c | 13 +++++++------ tests/printf2.sub | 2 +- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 2e612a9a2..b26e93992 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -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 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." + + 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 + diff --git a/config-top.h b/config-top.h index 8c651f4b6..e7fce4796 100644 --- a/config-top.h +++ b/config-top.h @@ -109,3 +109,8 @@ /* 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 diff --git a/execute_cmd.c b/execute_cmd.c index 910d2e27c..ff63eb333 100644 --- a/execute_cmd.c +++ b/execute_cmd.c @@ -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); } diff --git a/lib/sh/eaccess.c b/lib/sh/eaccess.c index d9bca8c40..2dbaf4099 100644 --- a/lib/sh/eaccess.c +++ b/lib/sh/eaccess.c @@ -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)); diff --git a/tests/printf2.sub b/tests/printf2.sub index b8e545843..45c48d4c4 100644 --- a/tests/printf2.sub +++ b/tests/printf2.sub @@ -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 -- 2.47.3