Date: Wed, 18 Aug 1999 16:48:26 +1000 From: Bruce Evans <bde@zeta.org.au> To: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, green@FreeBSD.org Subject: Re: cvs commit: src/bin/test test.c Message-ID: <199908180648.QAA07603@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
> Modified files: > bin/test test.c > Log: > The new test(1) did not use access() correctly. I don't know why, since > supposedly it's ksh-derived, and it's not broken in pdksh. I've added > a test for test running as root: if testing for -x, the file must be > mode & 0111 to get "success", rather than just existant. It still doesn't use access() correctly. Correct use is not possible, except a micro-optimisation for the (getuid() == geteuid() && getgig() == getegid()) case, since access() tests for accessibility by the real uid/gid but test(1) is supposed to test for actual accessibilty (by the effective uid/gid). 0111 is a misspelling of S_IXOTH | S_IXGRP | S_IXUSR. Upgrade to the old version of test(1) for fixes to both problems. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908180648.QAA07603>