1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: Make SID_SAMBA_SMB3 a static SID

No need to parse it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-10-08 11:34:23 +02:00 committed by Jeremy Allison
parent a19016e002
commit e2256c99a6
5 changed files with 7 additions and 16 deletions

View File

@ -64,6 +64,7 @@ extern const struct dom_sid global_sid_Unix_NFS_Users;
extern const struct dom_sid global_sid_Unix_NFS_Groups;
extern const struct dom_sid global_sid_Unix_NFS_Mode;
extern const struct dom_sid global_sid_Unix_NFS_Other;
extern const struct dom_sid global_sid_Samba_SMB3;
enum lsa_SidType;

View File

@ -158,6 +158,10 @@ const struct dom_sid global_sid_Unix_NFS_Other = /* Unix other, MS NFS and Appl
{ 1, 2, {0,0,0,0,0,5}, {88,4,0,0,0,0,0,0,0,0,0,0,0,0,0}};
#endif
/* Information passing via security token */
const struct dom_sid global_sid_Samba_SMB3 =
{1, 1, {0,0,0,0,0,22}, {1397571891, }};
/* Unused, left here for documentary purposes */
#if 0
#define SECURITY_NULL_SID_AUTHORITY 0

View File

@ -282,9 +282,6 @@ interface security
const string SID_SAMBA_UNIX_USER_OWNER = "S-1-22-1";
const string SID_SAMBA_UNIX_GROUP_OWNER = "S-1-22-2";
/* Information passing via security token */
const string SID_SAMBA_SMB3 = "S-1-22-1397571891";
/* SECURITY_NT_SERVICE */
const string NAME_NT_SERVICE = "NT SERVICE";

View File

@ -70,7 +70,7 @@ static bool smb3_sid_parse(const struct dom_sid *sid,
bool dcerpc_is_transport_encrypted(struct auth_session_info *session_info)
{
struct security_token *token = session_info->security_token;
struct dom_sid smb3_dom_sid;
struct dom_sid smb3_dom_sid = global_sid_Samba_SMB3;
const struct dom_sid *smb3_sid = NULL;
uint16_t dialect = 0;
uint16_t encrypt = 0;
@ -78,11 +78,6 @@ bool dcerpc_is_transport_encrypted(struct auth_session_info *session_info)
uint32_t i;
bool ok;
ok = dom_sid_parse(SID_SAMBA_SMB3, &smb3_dom_sid);
if (!ok) {
return false;
}
for (i = 0; i < token->num_sids; i++) {
int cmp;

View File

@ -77,7 +77,7 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
uint16_t dialect = xconn->smb2.server.dialect;
uint16_t srv_smb_encrypt = DCERPC_SMB_ENCRYPTION_REQUIRED;
uint16_t cipher = xconn->smb2.server.cipher;
struct dom_sid smb3_sid;
struct dom_sid smb3_sid = global_sid_Samba_SMB3;
uint32_t i;
bool ok;
@ -89,12 +89,6 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
}
security_token = session_info->security_token;
ok = dom_sid_parse(SID_SAMBA_SMB3, &smb3_sid);
if (!ok) {
file_free(smb_req, fsp);
return NT_STATUS_BUFFER_TOO_SMALL;
}
/*
* Security check:
*