- 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
- 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>
/* 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
{
struct cpelement *cpe;
- for (cpe = coproc_list.head; cpe; )
+ for (cpe = coproc_list.head; cpe; cpe = cpe->next)
coproc_close (cpe->coproc);
}
{
struct cpelement *cpe;
- for (cpe = coproc_list.head; cpe; )
+ for (cpe = coproc_list.head; cpe; cpe = cpe->next)
coproc_checkfd (cpe->coproc, fd);
}
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);
return (sh_stataccess (path, mode));
#endif
return ret;
-
}
return (sh_stataccess (path, mode));
-UNSET LC_ALL LC_CTYPE
+unset LC_ALL LC_CTYPE
export LANG=en_US.UTF-8
case $(printf %d\\n \'À) in