[PATCH] two small cleanups
Volker Lendecke
vl at samba.org
Sun Feb 26 20:03:45 UTC 2017
Hi!
Review appreciated!
Thanks, Volker
-------------- next part --------------
>From 4ab8d602ef174b92c3e15493a9d56e919a8f3f7d Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 13 Feb 2017 20:47:59 +0100
Subject: [PATCH 1/2] auth3: Fix some whitespace
Signed-off-by: Volker Lendecke <vl at samba.org>
---
source3/auth/auth_util.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index ae6bfb3..3c1ae64 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -729,19 +729,19 @@ static NTSTATUS get_system_info3(TALLOC_CTX *mem_ctx,
/* The SID set here will be overwirtten anyway, but try and make it SID_NT_SYSTEM anyway */
/* Domain sid is NT_AUTHORITY */
-
+
system_sid = dom_sid_parse_talloc(mem_ctx, SID_NT_SYSTEM);
if (system_sid == NULL) {
return NT_STATUS_NO_MEMORY;
}
-
+
status = dom_sid_split_rid(mem_ctx, system_sid, &info3->base.domain_sid,
&info3->base.rid);
TALLOC_FREE(system_sid);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
-
+
/* Primary gid is the same */
info3->base.primary_gid = info3->base.rid;
--
2.1.4
>From b1a0318b9f198be8564a074a3fb13b8e91612f0b Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 13 Feb 2017 21:33:57 +0100
Subject: [PATCH 2/2] auth3: Simplify get_system_info3
We have global_sid_System, so we don't need to dom_sid_parse("S-1-5-18");
Signed-off-by: Volker Lendecke <vl at samba.org>
---
source3/auth/auth_util.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 3c1ae64..5d9f0e0 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -718,7 +718,6 @@ static NTSTATUS get_system_info3(TALLOC_CTX *mem_ctx,
struct netr_SamInfo3 *info3)
{
NTSTATUS status;
- struct dom_sid *system_sid;
/* Set account name */
init_lsa_String(&info3->base.account_name, "SYSTEM");
@@ -727,17 +726,9 @@ static NTSTATUS get_system_info3(TALLOC_CTX *mem_ctx,
init_lsa_StringLarge(&info3->base.logon_domain, "NT AUTHORITY");
- /* The SID set here will be overwirtten anyway, but try and make it SID_NT_SYSTEM anyway */
- /* Domain sid is NT_AUTHORITY */
-
- system_sid = dom_sid_parse_talloc(mem_ctx, SID_NT_SYSTEM);
- if (system_sid == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
- status = dom_sid_split_rid(mem_ctx, system_sid, &info3->base.domain_sid,
+ status = dom_sid_split_rid(mem_ctx, &global_sid_System,
+ &info3->base.domain_sid,
&info3->base.rid);
- TALLOC_FREE(system_sid);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
--
2.1.4
More information about the samba-technical
mailing list