Date: Sun, 10 Apr 2011 14:40:12 GMT From: Mikolaj Golub <trociny@freebsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/156225: test -x under root in bash shell returns incorrect results Message-ID: <201104101440.p3AEeCO9072032@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/156225; it has been noted by GNATS. From: Mikolaj Golub <trociny@freebsd.org> To: remko@FreeBSD.org, cmyk777@gmail.com, bug-followup@FreeBSD.org Cc: Subject: Re: misc/156225: test -x under root in bash shell returns incorrect results Date: Sun, 10 Apr 2011 17:33:29 +0300 Bash checks permission calling eaccess(2). The issue is that it returns success for root: 19632 bash CALL eaccess(0x28417600,X_OK) 19632 bash NAMI "/root/.cshrc" 19632 bash RET eaccess 0 sh's test has a workaround for this: case FILEX: /* XXX work around eaccess(2) false positives for superuser */ if (eaccess(nm, X_OK) != 0) return 0; if (S_ISDIR(s.st_mode) || geteuid() != 0) return 1; The eaccess(2) behaviour has been changed in CURRENT. See kern/125009 for details. I think this ticket can be set as a duplicate of kern/125009. -- Mikolaj Golub
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104101440.p3AEeCO9072032>