summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-05-22 15:21:55 -0700
committerJeremy Allison <jra@samba.org>2009-05-22 15:21:55 -0700
commite3851a9110dfb416c74bc979a0dedc074883067f (patch)
treeed877ced611fe062620f8aaf015cb52281bdf189 /source3/torture
parent202509a3479b7bba9a5dfce58270fb8f46cc496a (diff)
downloadsamba-e3851a9110dfb416c74bc979a0dedc074883067f.tar.gz
samba-e3851a9110dfb416c74bc979a0dedc074883067f.tar.bz2
samba-e3851a9110dfb416c74bc979a0dedc074883067f.zip
Test that POSIX open of a directory returns NT_STATUS_FILE_IS_A_DIRECTORY (ERRDOS, EISDIR).
Jeremy.
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 6651219098..20561a7eda 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4211,6 +4211,17 @@ 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))) {
+ printf("POSIX open of directory %s succeeded, should have failed.\n", fname);
+ goto out;
+ } else {
+ if (!check_error(__LINE__, cli1, ERRDOS, EISDIR,
+ NT_STATUS_FILE_IS_A_DIRECTORY)) {
+ goto out;
+ }
+ }
+
if (!NT_STATUS_IS_OK(cli_posix_rmdir(cli1, dname))) {
printf("POSIX rmdir failed (%s)\n", cli_errstr(cli1));
goto out;
@@ -4223,7 +4234,7 @@ static bool run_simple_posix_open_test(int dummy)
if (fnum1 != (uint16_t)-1) {
cli_close(cli1, fnum1);
- fnum1 = -1;
+ fnum1 = (uint16_t)-1;
}
cli_setatr(cli1, fname, 0, 0);