libcli/smb: all flags except SMB2_HDR_FLAG_ASYNC should be cleared in a cancel request.
authorStefan Metzmacher <metze@samba.org>
Wed, 15 Aug 2012 12:17:25 +0000 (14:17 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 15 Aug 2012 12:45:04 +0000 (14:45 +0200)
metze

libcli/smb/smbXcli_base.c

index dad869c2c0213d7ca11db75c4c7ab2b8093e24f2..d9b17f83bb8ecf954d70a24ed37005a1a8edaa5d 100644 (file)
@@ -2422,6 +2422,12 @@ static bool smb2cli_req_cancel(struct tevent_req *req)
        }
        substate = tevent_req_data(subreq, struct smbXcli_req_state);
 
+       /*
+        * clear everything but the SMB2_HDR_FLAG_ASYNC flag
+        * e.g. if SMB2_HDR_FLAG_CHAINED is set we get INVALID_PARAMETER back
+        */
+       flags &= SMB2_HDR_FLAG_ASYNC;
+
        if (flags & SMB2_HDR_FLAG_ASYNC) {
                mid = 0;
        }