summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-01 15:01:43 -0700
committerJeremy Allison <jra@samba.org>2010-04-01 15:01:43 -0700
commitb6aabcd628f3af1302a03af8cde15baa8d1f2905 (patch)
treec5fe954ba053f30fc93c8fb3a32d1c603a69f9da /source3/torture
parente18ddb6036f5e0a2211e89a7c9b5514c30a653cf (diff)
downloadsamba-b6aabcd628f3af1302a03af8cde15baa8d1f2905.tar.gz
samba-b6aabcd628f3af1302a03af8cde15baa8d1f2905.tar.bz2
samba-b6aabcd628f3af1302a03af8cde15baa8d1f2905.zip
Add torture test for bug 7310 - DOS attribute inconsistency with MS Office
Ensure we don't regress. Jeremy.
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index d45209714d..b454a7d46d 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -3790,6 +3790,7 @@ static bool run_rename(int dummy)
const char *fname1 = "\\test1.txt";
bool correct = True;
uint16_t fnum1;
+ uint16_t attr;
NTSTATUS status;
printf("starting rename test\n");
@@ -3944,13 +3945,30 @@ static bool run_rename(int dummy)
} */
/*--*/
-
-
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close - 5 failed (%s)\n", cli_errstr(cli1));
return False;
}
+ /* Check that the renamed file has FILE_ATTRIBUTE_ARCHIVE. */
+ if (!NT_STATUS_IS_OK(cli_getatr(cli1, fname1, &attr, NULL, NULL))) {
+ printf("getatr on file %s failed - %s ! \n",
+ fname1,
+ cli_errstr(cli1));
+ correct = False;
+ } else {
+ if (attr != FILE_ATTRIBUTE_ARCHIVE) {
+ printf("Renamed file %s has wrong attr 0x%x "
+ "(should be 0x%x)\n",
+ fname1,
+ attr,
+ (unsigned int)FILE_ATTRIBUTE_ARCHIVE);
+ correct = False;
+ } else {
+ printf("Renamed file %s has archive bit set\n", fname1);
+ }
+ }
+
cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);