check that we can't change a file to a directory
authorAndrew Tridgell <tridge@samba.org>
Wed, 28 May 2008 10:06:48 +0000 (20:06 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 28 May 2008 10:06:48 +0000 (20:06 +1000)
(This used to be commit e013ada415ebb25e925f715791757330ba003b43)

source4/torture/smb2/setinfo.c

index 685bb5a47b1593cd58f21bb54c54816697102a4c..7a912b4989a27275908886c2df78eee5c09a4220 100644 (file)
@@ -175,6 +175,10 @@ bool torture_smb2_setinfo(struct torture_context *torture)
        CHECK_CALL(BASIC_INFORMATION, NT_STATUS_OK);
        CHECK_VALUE(SMB2_ALL_INFORMATION, all_info2, attrib, FILE_ATTRIBUTE_HIDDEN);
 
        CHECK_CALL(BASIC_INFORMATION, NT_STATUS_OK);
        CHECK_VALUE(SMB2_ALL_INFORMATION, all_info2, attrib, FILE_ATTRIBUTE_HIDDEN);
 
+       printf("can't change a file to a directory\n");
+       sfinfo.basic_info.in.attrib = FILE_ATTRIBUTE_DIRECTORY;
+       CHECK_CALL(BASIC_INFORMATION, NT_STATUS_INVALID_PARAMETER);
+
        printf("restore attribute\n");
        sfinfo.basic_info.in.attrib = FILE_ATTRIBUTE_NORMAL;
        CHECK_CALL(BASIC_INFORMATION, NT_STATUS_OK);
        printf("restore attribute\n");
        sfinfo.basic_info.in.attrib = FILE_ATTRIBUTE_NORMAL;
        CHECK_CALL(BASIC_INFORMATION, NT_STATUS_OK);