o Fix two eaccess() checks -- in one case, the wrong test file

was used, resulting in a regression failure, and in the other,
  the test on an error return was inverted.

Obtained from: TrustedBSD Project
This commit is contained in:
Robert Watson 2001-09-21 21:28:43 +00:00
parent e20fd30969
commit abc9a36083
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83794

View File

@ -223,7 +223,7 @@ main(int argc, char *argv[])
}
#ifdef EACCESS_AVAILABLE
error = eaccess("test2", R_OK);
error = eaccess("test1", R_OK);
if (!error) {
fprintf(stderr, "saved uid used instead of effective uid\n");
errorseen++;
@ -270,7 +270,7 @@ main(int argc, char *argv[])
#ifdef EACCESS_AVAILABLE
/* Check that the effective uid is used, not the real uid */
error = eaccess("test2", R_OK);
if (error) {
if (!error) {
fprintf(stderr, "Real uid was used instead of effective uid in eaccess().\n");
errorseen++;
}