summaryrefslogtreecommitdiff
path: root/source4/torture/raw/rename.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/raw/rename.c')
-rw-r--r--source4/torture/raw/rename.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c
index 22e91a44a9..9e99770503 100644
--- a/source4/torture/raw/rename.c
+++ b/source4/torture/raw/rename.c
@@ -51,6 +51,8 @@ static BOOL test_mv(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
int fnum = -1;
const char *fname1 = BASEDIR "\\test1.txt";
const char *fname2 = BASEDIR "\\test2.txt";
+ const char *Fname1 = BASEDIR "\\Test1.txt";
+ union smb_fileinfo finfo;
union smb_open op;
printf("Testing SMBmv\n");
@@ -109,6 +111,24 @@ static BOOL test_mv(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_rename(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
+ printf("Trying case-changing rename\n");
+ io.rename.in.pattern1 = fname1;
+ io.rename.in.pattern2 = Fname1;
+ status = smb_raw_rename(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ finfo.generic.level = RAW_FILEINFO_ALL_INFO;
+ finfo.all_info.in.file.path = fname1;
+ status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ if (strcmp(finfo.all_info.out.fname.s, Fname1) != 0) {
+ printf("(%s) Incorrect filename [%s] after case-changing "
+ "rename, should be [%s]\n", __location__,
+ finfo.all_info.out.fname.s, Fname1);
+ ret = False;
+ goto done;
+ }
+
io.rename.in.pattern1 = fname1;
io.rename.in.pattern2 = fname2;