diff options
author | Javier Villavicencio <the_paya@gentoo.org> | 2010-03-28 10:55:37 +0000 |
---|---|---|
committer | Javier Villavicencio <the_paya@gentoo.org> | 2010-03-28 10:55:37 +0000 |
commit | d64a7358e851827a6601f5e98f56c67dc818c661 (patch) | |
tree | ac619b056054053b5258f9ed59775a41bb50afed /app-shells/bash/files | |
parent | Version bump. (diff) | |
download | gentoo-2-d64a7358e851827a6601f5e98f56c67dc818c661.tar.gz gentoo-2-d64a7358e851827a6601f5e98f56c67dc818c661.tar.bz2 gentoo-2-d64a7358e851827a6601f5e98f56c67dc818c661.zip |
Fix for bug 303411, thanks to johan.hattne@utsouthwestern.edu for report and patch.
(Portage version: 2.2_rc67/cvs/FreeBSD i386)
Diffstat (limited to 'app-shells/bash/files')
-rw-r--r-- | app-shells/bash/files/bash-4.1-fbsd-eaccess.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch b/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch new file mode 100644 index 000000000000..576a8a47a619 --- /dev/null +++ b/app-shells/bash/files/bash-4.1-fbsd-eaccess.patch @@ -0,0 +1,29 @@ +Bash built-in test fails to correctly report exeuctable status for non- +executable files when run by root on FreeBSD. + +See http://bugs.gentoo.org/303411 + +Patch from Johan Hattne <johan.hattne@utsuthwestern.edu> +--- lib/sh/eaccess.c.orig ++++ lib/sh/eaccess.c +@@ -198,11 +198,19 @@ + char *path; + int mode; + { ++ struct stat s; ++ int ret; ++ + if (path_is_devfd (path)) + return (sh_stataccess (path, mode)); + + #if defined (HAVE_EACCESS) /* FreeBSD */ +- return (eaccess (path, mode)); ++ if (stat (path, &s) != 0) ++ return (-1); ++ ret = eaccess (path, mode); ++ if (mode == X_OK && ret == 0 && !S_ISDIR(s.st_mode) && geteuid() == 0) ++ return ((s.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0 ? -1 : 0); ++ return (ret); + #elif defined (EFF_ONLY_OK) /* SVR4(?), SVR4.2 */ + return access (path, mode|EFF_ONLY_OK); + #else |