From f2278a8585fc77cbe53ec8b977a43a9273ff4279 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 7 Nov 2001 23:57:59 +0000 Subject: 2001-11-07 Jennifer Averett Reported by Ibragimov Ilya and tracked as PR63. * psxstat/test.c: Fix test ENOTDIR to correspond to chdir() change. Since we check permissions before evaluating enough to see if it a regular file or directory, this hack is needed to make the regular file executable. --- c/src/tests/psxtests/ChangeLog | 8 ++++++++ c/src/tests/psxtests/psxstat/test.c | 5 ++++- testsuites/psxtests/ChangeLog | 8 ++++++++ testsuites/psxtests/psxstat/test.c | 5 ++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/c/src/tests/psxtests/ChangeLog b/c/src/tests/psxtests/ChangeLog index 6be7e6d7bf..9c6cfad38a 100644 --- a/c/src/tests/psxtests/ChangeLog +++ b/c/src/tests/psxtests/ChangeLog @@ -1,3 +1,11 @@ +2001-11-07 Jennifer Averett + + Reported by Ibragimov Ilya and tracked as PR63. + * psxstat/test.c: Fix test ENOTDIR to correspond to chdir() change. + Since we check permissions before evaluating enough to see if it + a regular file or directory, this hack is needed to make the regular + file executable. + 2001-10-11 Ralf Corsepius * .cvsignore: Add autom4te.cache for autoconf > 2.52. diff --git a/c/src/tests/psxtests/psxstat/test.c b/c/src/tests/psxtests/psxstat/test.c index 901f48bd0a..04517de986 100644 --- a/c/src/tests/psxtests/psxstat/test.c +++ b/c/src/tests/psxtests/psxstat/test.c @@ -483,9 +483,12 @@ void Cause_faults() assert( errno == EPERM ); /* - * Try to chdir to a file. + * Change file to executable then try to chdir to it. */ + status = chmod( Files[0], S_IXUSR ); + assert( status != -1 ); + printf("chdir to a file should fail with ENOTDIR\n"); status = chdir( Files[0] ); assert( status == -1 ); diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 6be7e6d7bf..9c6cfad38a 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,11 @@ +2001-11-07 Jennifer Averett + + Reported by Ibragimov Ilya and tracked as PR63. + * psxstat/test.c: Fix test ENOTDIR to correspond to chdir() change. + Since we check permissions before evaluating enough to see if it + a regular file or directory, this hack is needed to make the regular + file executable. + 2001-10-11 Ralf Corsepius * .cvsignore: Add autom4te.cache for autoconf > 2.52. diff --git a/testsuites/psxtests/psxstat/test.c b/testsuites/psxtests/psxstat/test.c index 901f48bd0a..04517de986 100644 --- a/testsuites/psxtests/psxstat/test.c +++ b/testsuites/psxtests/psxstat/test.c @@ -483,9 +483,12 @@ void Cause_faults() assert( errno == EPERM ); /* - * Try to chdir to a file. + * Change file to executable then try to chdir to it. */ + status = chmod( Files[0], S_IXUSR ); + assert( status != -1 ); + printf("chdir to a file should fail with ENOTDIR\n"); status = chdir( Files[0] ); assert( status == -1 ); -- cgit v1.2.3