RAW-STREAMS: do what the comments say
authorStefan Metzmacher <metze@samba.org>
Wed, 12 Mar 2008 13:21:21 +0000 (14:21 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Mar 2008 13:23:30 +0000 (14:23 +0100)
metze
(This used to be commit eb68a8ed4fa214ad2e858a7fbdf9b5376cda6e04)

source4/torture/raw/streams.c

index ca6b488af5a0dd86f478be5b5d07cbf8f2c20d19..b6680e081e6d7e3bdd4dc37148fd75f205d9c814 100644 (file)
@@ -356,22 +356,24 @@ static bool test_stream_sharemodes(struct torture_context *tctx,
         * A different stream does not give a sharing violation
         */
 
+       io.ntcreatex.in.fname = sname2;
+       status = smb_raw_open(cli->tree, mem_ctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
-       fnum1 = io.ntcreatex.out.file.fnum;
+       fnum2 = io.ntcreatex.out.file.fnum;
 
        /*
         * ... whereas the same stream does with unchanged access/share_access
         * flags
         */
 
+       io.ntcreatex.in.fname = sname1;
        io.ntcreatex.in.open_disposition = 0;
        status = smb_raw_open(cli->tree, mem_ctx, &io);
        CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION);
 
        io.ntcreatex.in.fname = sname2;
        status = smb_raw_open(cli->tree, mem_ctx, &io);
-       CHECK_STATUS(status, NT_STATUS_OK);
-       fnum2 = io.ntcreatex.out.file.fnum;
+       CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION);
 
 done:
        if (fnum1 != -1) smbcli_close(cli->tree, fnum1);