summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-08-17 19:54:41 -0400
committerSimo Sorce <idra@samba.org>2008-08-17 19:54:41 -0400
commit5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4 (patch)
treefea9e40e62f5ce034b3f346dad1d9ed2c9cdd743 /source3/auth
parentee6c02f7c8bc92190b9f5474057f5885f29c2f8a (diff)
downloadsamba-5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4.tar.gz
samba-5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4.tar.bz2
samba-5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4.zip
Split lookup_name() and create a new functiong called
lookup_domain_name(). This new function accept separated strings for domain and name. (This used to be commit 8594edf666c29fd4ddf1780da842683dd81483b6)
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_util.c17
-rw-r--r--source3/auth/token_util.c7
2 files changed, 7 insertions, 17 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 9220df01c0..5b2c3045c3 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -1086,7 +1086,6 @@ NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info,
NTSTATUS status;
struct samu *sampass = NULL;
gid_t *gids;
- char *qualified_name = NULL;
TALLOC_CTX *mem_ctx = NULL;
DOM_SID u_sid;
enum lsa_SidType type;
@@ -1152,18 +1151,10 @@ NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info,
return NT_STATUS_NO_MEMORY;
}
- qualified_name = talloc_asprintf(mem_ctx, "%s\\%s",
- unix_users_domain_name(),
- unix_username );
- if (!qualified_name) {
- TALLOC_FREE(result);
- TALLOC_FREE(mem_ctx);
- return NT_STATUS_NO_MEMORY;
- }
-
- if (!lookup_name(mem_ctx, qualified_name, LOOKUP_NAME_ALL,
- NULL, NULL,
- &u_sid, &type)) {
+ if (!lookup_domain_name(mem_ctx,
+ unix_users_domain_name(), unix_username,
+ LOOKUP_NAME_ALL,
+ NULL, NULL, &u_sid, &type)) {
TALLOC_FREE(result);
TALLOC_FREE(mem_ctx);
return NT_STATUS_NO_SUCH_USER;
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index d6cd2ea3a8..2b55af779e 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -291,7 +291,6 @@ NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid)
{
NTSTATUS status;
DOM_SID dom_admins, root_sid;
- fstring root_name;
enum lsa_SidType type;
TALLOC_CTX *ctx;
bool ret;
@@ -317,9 +316,9 @@ NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid)
if ( (ctx = talloc_init("create_builtin_administrators")) == NULL ) {
return NT_STATUS_NO_MEMORY;
}
- fstr_sprintf( root_name, "%s\\root", get_global_sam_name() );
- ret = lookup_name(ctx, root_name, LOOKUP_NAME_DOMAIN, NULL, NULL,
- &root_sid, &type);
+ ret = lookup_domain_name(ctx, get_global_sam_name(), "root",
+ LOOKUP_NAME_DOMAIN,
+ NULL, NULL, &root_sid, &type);
TALLOC_FREE( ctx );
if ( ret ) {