The branch, v3-4-test has been updated via 689664ad7acf13b07409abd4c2820dbe10255b68 (commit) via 935a1a89c6c027e068f79e3686396c28812f9e67 (commit) from 2b6dbddb9cc723fcbd2e4e22a9404d6b4ff805d7 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test - Log ----------------------------------------------------------------- commit 689664ad7acf13b07409abd4c2820dbe10255b68 Author: Jeremy Allison <j...@samba.org> Date: Fri May 22 15:56:59 2009 -0700 Ensure we return NT_STATUS_FILE_IS_A_DIRECTORY on a posix open on a directory name. Jeremy. commit 935a1a89c6c027e068f79e3686396c28812f9e67 Author: Jeremy Allison <j...@samba.org> Date: Fri May 22 15:56:46 2009 -0700 Test that POSIX open of a directory returns NT_STATUS_FILE_IS_A_DIRECTORY (ERRDOS, EISDIR). Jeremy. ----------------------------------------------------------------------- Summary of changes: source3/smbd/trans2.c | 2 +- source3/torture/torture.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 3a28a87..4eb44e3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -6487,7 +6487,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn, (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), create_disp, /* create_disposition*/ - 0, /* create_options */ + FILE_NON_DIRECTORY_FILE, /* create_options */ mod_unixmode, /* file_attributes */ oplock_request, /* oplock_request */ 0, /* allocation_size */ diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 1f099da..b9c3e34 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4239,6 +4239,18 @@ static bool run_simple_posix_open_test(int dummy) goto out; } + /* What happens when we try and POSIX open a directory ? */ + fnum1 = cli_posix_open(cli1, dname, O_RDONLY, 0); + if (fnum1 != -1) { + 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 (!cli_posix_rmdir(cli1, dname)) { printf("POSIX rmdir failed (%s)\n", cli_errstr(cli1)); goto out; -- Samba Shared Repository