From owner-cvs-all Tue Aug 17 23:48:34 1999 Delivered-To: cvs-all@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id B671F14CDE; Tue, 17 Aug 1999 23:48:27 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id QAA07603; Wed, 18 Aug 1999 16:48:26 +1000 Date: Wed, 18 Aug 1999 16:48:26 +1000 From: Bruce Evans Message-Id: <199908180648.QAA07603@godzilla.zeta.org.au> To: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, green@FreeBSD.org Subject: Re: cvs commit: src/bin/test test.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > 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