diff options
author | Christian Ambach <ambi@samba.org> | 2013-06-01 21:32:19 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-06-21 10:44:23 +0200 |
commit | df41835eea828173f8678b24c2db0ec23045a26d (patch) | |
tree | 92dbe5315cba8cee935fb1ef8dec113be84518f5 | |
parent | 6a048b424a2ecf38614aa6912f0d8c8a26c87ad5 (diff) | |
download | samba-df41835eea828173f8678b24c2db0ec23045a26d.tar.gz samba-df41835eea828173f8678b24c2db0ec23045a26d.tar.bz2 samba-df41835eea828173f8678b24c2db0ec23045a26d.zip |
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 <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | source3/include/passdb.h | 1 | ||||
-rw-r--r-- | source3/passdb/ABI/pdb-0.sigs | 1 | ||||
-rw-r--r-- | 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 793c7667cc..ae3a968464 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 09563f5089..9c5c773941 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 3b7377c312..0ac6594d4c 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; |