misc/156225: test -x under root in bash shell returns incorrect
trociny at freebsd.org
Sun Apr 10 14:40:12 UTC 2011
The following reply was made to PR misc/156225; it has been noted by GNATS.
From: Mikolaj Golub <trociny at freebsd.org>
To: remko at FreeBSD.org, cmyk777 at gmail.com, bug-followup at FreeBSD.org
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:
/* XXX work around eaccess(2) false positives for superuser */
if (eaccess(nm, X_OK) != 0)
if (S_ISDIR(s.st_mode) || geteuid() != 0)
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.
More information about the freebsd-bugs