cifs: enable signing flag in SMB header when server has it on
authorJeff Layton <jlayton@redhat.com>
Fri, 4 Feb 2011 12:21:26 +0000 (07:21 -0500)
committerSteve French <sfrench@us.ibm.com>
Fri, 4 Feb 2011 20:19:57 +0000 (20:19 +0000)
cifs_sign_smb only generates a signature if the correct Flags2 bit is
set. Make sure that it gets set correctly if we're sending an async
call.

This patch fixes:

    https://bugzilla.kernel.org/show_bug.cgi?id=28142

Reported-and-Tested-by: JG <jg@cms.ac>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/transport.c

index b8c5e2eb43d0866d59d293afafc72873867a0e93..fbc5aace54b18dab347af2f624d0686ca8986c9d 100644 (file)
@@ -359,6 +359,10 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf,
        if (rc)
                return rc;
 
+       /* enable signing if server requires it */
+       if (server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
+               in_buf->Flags2 |= SMBFLG2_SECURITY_SIGNATURE;
+
        mutex_lock(&server->srv_mutex);
        mid = AllocMidQEntry(in_buf, server);
        if (mid == NULL) {