From df41835eea828173f8678b24c2db0ec23045a26d Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Sat, 1 Jun 2013 21:32:19 +0200 Subject: [PATCH] s3:passdb expose pdb_create_builtin function this one first tries to map the principal before allocating a new gid Signed-off-by: Christian Ambach Reviewed-by: Michael Adam --- source3/include/passdb.h | 1 + source3/passdb/ABI/pdb-0.sigs | 1 + source3/passdb/pdb_util.c | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 793c7667cc2..ae3a9684640 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -942,6 +942,7 @@ bool pdb_is_responsible_for_unix_groups(void); /* The following definitions come from passdb/pdb_util.c */ +NTSTATUS pdb_create_builtin(uint32_t rid); NTSTATUS create_builtin_users(const struct dom_sid *sid); NTSTATUS create_builtin_administrators(const struct dom_sid *sid); diff --git a/source3/passdb/ABI/pdb-0.sigs b/source3/passdb/ABI/pdb-0.sigs index 09563f5089d..9c5c773941f 100644 --- a/source3/passdb/ABI/pdb-0.sigs +++ b/source3/passdb/ABI/pdb-0.sigs @@ -19,6 +19,7 @@ algorithmic_rid_base: int (void) builtin_domain_name: const char *(void) cache_account_policy_get: bool (enum pdb_policy_type, uint32_t *) cache_account_policy_set: bool (enum pdb_policy_type, uint32_t) +pdb_create_builtin: NTSTATUS (uint32_t) create_builtin_administrators: NTSTATUS (const struct dom_sid *) create_builtin_users: NTSTATUS (const struct dom_sid *) decode_account_policy_name: const char *(enum pdb_policy_type) diff --git a/source3/passdb/pdb_util.c b/source3/passdb/pdb_util.c index 3b7377c3127..0ac6594d4cf 100644 --- a/source3/passdb/pdb_util.c +++ b/source3/passdb/pdb_util.c @@ -67,7 +67,7 @@ static NTSTATUS add_sid_to_builtin(const struct dom_sid *builtin_sid, * @param[in] rid BUILTIN rid to create * @return Normal NTSTATUS return. */ -static NTSTATUS create_builtin(uint32 rid) +NTSTATUS pdb_create_builtin(uint32_t rid) { NTSTATUS status = NT_STATUS_OK; struct dom_sid sid; @@ -94,7 +94,7 @@ NTSTATUS create_builtin_users(const struct dom_sid *dom_sid) NTSTATUS status; struct dom_sid dom_users; - status = create_builtin(BUILTIN_RID_USERS); + status = pdb_create_builtin(BUILTIN_RID_USERS); if ( !NT_STATUS_IS_OK(status) ) { DEBUG(5,("create_builtin_users: Failed to create Users\n")); return status; @@ -123,7 +123,7 @@ NTSTATUS create_builtin_administrators(const struct dom_sid *dom_sid) TALLOC_CTX *ctx; bool ret; - status = create_builtin(BUILTIN_RID_ADMINISTRATORS); + status = pdb_create_builtin(BUILTIN_RID_ADMINISTRATORS); if ( !NT_STATUS_IS_OK(status) ) { DEBUG(5,("create_builtin_administrators: Failed to create Administrators\n")); return status;