diff --git a/source3/include/smb.h b/source3/include/smb.h index 873657a..3189af0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1027,6 +1027,7 @@ struct bitmap { /* this is used on a TConX. I'm not sure the name is very helpful though */ #define SMB_SUPPORT_SEARCH_BITS 0x0001 #define SMB_SHARE_IN_DFS 0x0002 +#define SMB_EXTENDED_SIGNATURES 0x0020 /* Named pipe write mode flags. Used in writeX calls. */ #define PIPE_RAW_MODE 0x4 @@ -1289,6 +1290,7 @@ char *strdup(char *s); #define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */ /* TCONX Flag (smb_vwv2). */ +#define TCONX_FLAG_EXTENDED_SIGNATURES 0x4 #define TCONX_FLAG_EXTENDED_RESPONSE 0x8 /* File Status Flags. See: diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ac471aa..450cd8b 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -711,6 +711,7 @@ void reply_tcon_and_X(struct smb_request *req) const char *p, *q; uint16 tcon_flags; struct smbd_server_connection *sconn = req->sconn; + uint16_t optional_support = 0 START_PROFILE(SMBtconX); @@ -855,15 +856,21 @@ void reply_tcon_and_X(struct smb_request *req) /* what does setting this bit do? It is set by NT4 and may affect the ability to autorun mounted cdroms */ - SSVAL(req->outbuf, smb_vwv2, SMB_SUPPORT_SEARCH_BITS| - (lp_csc_policy(SNUM(conn)) << 2)); + optional_support |= SMB_SUPPORT_SEARCH_BITS; + optional_support |= (lp_csc_policy(SNUM(conn)) << 2); if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) { DEBUG(2,("Serving %s as a Dfs root\n", lp_servicename(SNUM(conn)) )); - SSVAL(req->outbuf, smb_vwv2, - SMB_SHARE_IN_DFS | SVAL(req->outbuf, smb_vwv2)); + optional_support |= SMB_SHARE_IN_DFS; } + + if (srv_is_signing_active(sconn) && + (tcon_flags & TCONX_FLAG_EXTENDED_SIGNATURES)) { + optional_support |= SMB_EXTENDED_SIGNATURES; + } + + SSVAL(req->outbuf, smb_vwv2, optional_support); }