summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-28 12:10:27 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-29 15:17:53 +0100
commit863e65e9556749affdfea544785fdbb301774f6b (patch)
tree9f524f83a49fb1c500ea7516ae4aba25892a4608
parenta0235410aee5edab4a2a1af432bd73b5a1980d2d (diff)
downloadsamba-863e65e9556749affdfea544785fdbb301774f6b.tar.gz
samba-863e65e9556749affdfea544785fdbb301774f6b.tar.bz2
samba-863e65e9556749affdfea544785fdbb301774f6b.zip
RAW-SFILEINFO-RENAME: test renaming by path while a handle is open on a file
metze (This used to be commit 6c0395d4d980c6165ee0a378b632bced22e8f1d3)
-rw-r--r--source4/torture/raw/setfileinfo.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index e58b3fd760..e8e4031ea4 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -554,6 +554,31 @@ bool torture_raw_sfileinfo_rename(struct torture_context *torture,
CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_INVALID_PARAMETER);
CHECK_STR(NAME_INFO, name_info, fname.s, fnum_fname);
+ if (torture_setting_bool(torture, "samba3", false)) {
+ printf("SKIP: Trying rename by path while a handle is open\n");
+ goto done;
+ }
+
+ printf("Trying rename by path while a handle is open\n");
+ fnum_saved = fnum;
+ fnum = create_complex_file(cli, torture, path_fname);
+ sfinfo.rename_information.in.new_name = path_fname_new+strlen(BASEDIR)+1;
+ sfinfo.rename_information.in.overwrite = 0;
+ sfinfo.rename_information.in.root_fid = 0;
+ CHECK_CALL_PATH(RENAME_INFORMATION, NT_STATUS_OK);
+ CHECK_STR(NAME_INFO, name_info, fname.s, path_fname_new);
+ /* check that the handle returns the same name */
+ check_fnum = true;
+ CHECK_STR(NAME_INFO, name_info, fname.s, path_fname_new);
+ /* rename it back on the handle */
+ sfinfo.rename_information.in.new_name = path_fname+strlen(BASEDIR)+1;
+ CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_OK);
+ CHECK_STR(NAME_INFO, name_info, fname.s, path_fname);
+ check_fnum = false;
+ CHECK_STR(NAME_INFO, name_info, fname.s, path_fname);
+ smbcli_close(cli->tree, fnum);
+ fnum = fnum_saved;
+
done:
smb_raw_exit(cli->session);
smbcli_close(cli->tree, fnum);