mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
r9008: check the return status for the directory handle creations
This commit is contained in:
parent
320ab3c93b
commit
57e44300f7
@ -484,7 +484,7 @@ BOOL torture_raw_sfileinfo(void)
|
||||
CHECK_STR(NAME_INFO, name_info, fname.s, path_fname);
|
||||
|
||||
printf("Trying rename with a root fid\n");
|
||||
d_fnum = create_directory_handle(cli->tree, BASEDIR);
|
||||
status = create_directory_handle(cli->tree, BASEDIR, &d_fnum);
|
||||
sfinfo.rename_information.in.new_name = fnum_fname_new+strlen(BASEDIR)+1;
|
||||
sfinfo.rename_information.in.root_fid = d_fnum;
|
||||
CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_INVALID_PARAMETER);
|
||||
|
@ -220,7 +220,8 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
|
||||
|
||||
printf("Testing with directory and delete_on_close 0\n");
|
||||
fnum = create_directory_handle(cli->tree, dname);
|
||||
status = create_directory_handle(cli->tree, dname, &fnum);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
sfinfo.disposition_info.level = RAW_SFILEINFO_DISPOSITION_INFORMATION;
|
||||
sfinfo.disposition_info.file.fnum = fnum;
|
||||
@ -234,7 +235,9 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
printf("Testing with directory delete_on_close 1\n");
|
||||
fnum = create_directory_handle(cli->tree, dname);
|
||||
status = create_directory_handle(cli->tree, dname, &fnum);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
sfinfo.disposition_info.file.fnum = fnum;
|
||||
sfinfo.disposition_info.in.delete_on_close = 1;
|
||||
status = smb_raw_setfileinfo(cli->tree, &sfinfo);
|
||||
@ -247,7 +250,9 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
|
||||
|
||||
printf("Testing with non-empty directory delete_on_close\n");
|
||||
fnum = create_directory_handle(cli->tree, dname);
|
||||
status = create_directory_handle(cli->tree, dname, &fnum);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
fnum2 = create_complex_file(cli, mem_ctx, inside);
|
||||
|
||||
sfinfo.disposition_info.file.fnum = fnum;
|
||||
@ -274,7 +279,9 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
|
||||
|
||||
printf("Testing open dir with delete_on_close\n");
|
||||
fnum = create_directory_handle(cli->tree, dname);
|
||||
status = create_directory_handle(cli->tree, dname, &fnum);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
smbcli_close(cli->tree, fnum);
|
||||
fnum2 = create_complex_file(cli, mem_ctx, inside);
|
||||
smbcli_close(cli->tree, fnum2);
|
||||
@ -301,9 +308,13 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
status = smb_raw_rmdir(cli->tree, &dio);
|
||||
CHECK_STATUS(status, NT_STATUS_DIRECTORY_NOT_EMPTY);
|
||||
|
||||
smbcli_deltree(cli->tree, dname);
|
||||
|
||||
printf("Testing double open dir with second delete_on_close\n");
|
||||
fnum = create_directory_handle(cli->tree, dname);
|
||||
status = create_directory_handle(cli->tree, dname, &fnum);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
smbcli_close(cli->tree, fnum);
|
||||
|
||||
fnum2 = create_complex_file(cli, mem_ctx, inside);
|
||||
smbcli_close(cli->tree, fnum2);
|
||||
|
||||
@ -325,14 +336,16 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
fnum2 = op.ntcreatex.out.fnum;
|
||||
|
||||
smbcli_close(cli->tree, fnum2);
|
||||
smbcli_close(cli->tree, fnum);
|
||||
|
||||
status = smb_raw_rmdir(cli->tree, &dio);
|
||||
CHECK_STATUS(status, NT_STATUS_DIRECTORY_NOT_EMPTY);
|
||||
|
||||
smbcli_deltree(cli->tree, dname);
|
||||
|
||||
printf("Testing pre-existing open dir with second delete_on_close\n");
|
||||
fnum = create_directory_handle(cli->tree, dname);
|
||||
status = create_directory_handle(cli->tree, dname, &fnum);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
smbcli_close(cli->tree, fnum);
|
||||
|
||||
fnum = create_complex_file(cli, mem_ctx, inside);
|
||||
|
Loading…
Reference in New Issue
Block a user