summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-04-29 16:18:14 -0700
committerJeremy Allison <jra@samba.org>2011-04-30 02:21:24 +0200
commitde87f549b75d05a1198c490f6aa5c7e62c3fd4a5 (patch)
tree810f8821db542862d35d6eae9192563dcb117336 /source3/torture
parent2cb53f066e0e42d923be89dd3a7e18ea7a1b7340 (diff)
downloadsamba-de87f549b75d05a1198c490f6aa5c7e62c3fd4a5.tar.gz
samba-de87f549b75d05a1198c490f6aa5c7e62c3fd4a5.tar.bz2
samba-de87f549b75d05a1198c490f6aa5c7e62c3fd4a5.zip
Add POSIX O_RDONLY test of a directory for bug #8112 - POSIX extension opens of a directory are denied with EISDIR.
Don't strip access bits from wire flags when opening a directory. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Apr 30 02:21:24 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 61af2387c0..5dfcb7e97c 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -5073,8 +5073,16 @@ static bool run_simple_posix_open_test(int dummy)
goto out;
}
- /* What happens when we try and POSIX open a directory ? */
- if (NT_STATUS_IS_OK(cli_posix_open(cli1, dname, O_RDONLY, 0, &fnum1))) {
+ if (!NT_STATUS_IS_OK(cli_posix_open(cli1, dname, O_RDONLY, 0, &fnum1))) {
+ printf("POSIX open directory O_RDONLY of %s failed (%s)\n",
+ dname, cli_errstr(cli1));
+ goto out;
+ }
+
+ cli_close(cli1, fnum1);
+
+ /* What happens when we try and POSIX open a directory for write ? */
+ if (NT_STATUS_IS_OK(cli_posix_open(cli1, dname, O_RDWR, 0, &fnum1))) {
printf("POSIX open of directory %s succeeded, should have failed.\n", fname);
goto out;
} else {