]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Use Builtin SID constant
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 11 Sep 2023 03:27:09 +0000 (15:27 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 27 Sep 2023 02:43:28 +0000 (02:43 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/common/tests/dsdb.c
source4/dsdb/samdb/cracknames.c

index b38dee1c262410980b9aa8ae3d734db112383775..8b20b4de4274a9811a5cc5eb654bd42c737a87f4 100644 (file)
@@ -38,15 +38,15 @@ bool torture_ldb_no_attrs(struct torture_context *torture)
        const char *attrs[] = { NULL };
 
        struct auth_session_info *session;
-       struct dom_sid *domain_sid = NULL;
+       struct dom_sid domain_sid;
        const char *path;
 
        path = lpcfg_private_path(NULL, torture->lp_ctx, "sam.ldb");
        torture_assert(torture, path != NULL,
                       "Couldn't find sam.ldb. Run with -s $SERVERCONFFILE");
 
-       domain_sid = dom_sid_parse_talloc(NULL, SID_BUILTIN);
-       session = admin_session(NULL, torture->lp_ctx, domain_sid);
+       domain_sid = global_sid_Builtin;
+       session = admin_session(NULL, torture->lp_ctx, &domain_sid);
        ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx,
                               path, session, NULL, 0);
        torture_assert(torture, ldb, "Failed to connect to LDB target");
index 1301b5ad589805c957ea86bc48b9d27b32f162c0..52f5e4164208d0953b9fadd0aa36611f0d5030cf 100644 (file)
@@ -1260,7 +1260,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
                                info1->status = DRSUAPI_DS_NAME_STATUS_NO_MAPPING;
                                return WERR_OK;
                        }
-                       if (dom_sid_in_domain(dom_sid_parse_talloc(mem_ctx, SID_BUILTIN), sid)) {
+                       if (dom_sid_in_domain(&global_sid_Builtin, sid)) {
                                _dom = "BUILTIN";
                        } else {
                                const char *attrs[] = { NULL };