From e1cfca1e2e0f005ac9d73c6b0eb64bc99413aec6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 20 Oct 2010 08:16:23 -0700 Subject: Make getpwnam_alloc() static to lib/username.c, and ensure all username lookups go through Get_Pwnam_alloc(), which is the correct wrapper function. We were using it *some* of the time anyway, so this just makes us properly consistent. Jeremy. Autobuild-User: Jeremy Allison Autobuild-Date: Wed Oct 20 16:02:12 UTC 2010 on sn-devel-104 --- source3/auth/auth_util.c | 4 ++-- source3/auth/server_info_sam.c | 2 +- source3/auth/token_util.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/auth') diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 73713093c2..2fcee89bbb 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -641,7 +641,7 @@ static NTSTATUS get_guest_info3(TALLOC_CTX *mem_ctx, struct passwd *pwd; const char *tmp; - pwd = getpwnam_alloc(mem_ctx, guest_account); + pwd = Get_Pwnam_alloc(mem_ctx, guest_account); if (pwd == NULL) { DEBUG(0,("SamInfo3_for_guest: Unable to locate guest " "account [%s]!\n", guest_account)); @@ -793,7 +793,7 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx, struct passwd *pwd; NTSTATUS status; - pwd = getpwnam_alloc(talloc_tos(), username); + pwd = Get_Pwnam_alloc(talloc_tos(), username); if (pwd == NULL) { return NT_STATUS_NO_SUCH_USER; } diff --git a/source3/auth/server_info_sam.c b/source3/auth/server_info_sam.c index 4731ad44f1..c09ae764b9 100644 --- a/source3/auth/server_info_sam.c +++ b/source3/auth/server_info_sam.c @@ -70,7 +70,7 @@ NTSTATUS make_server_info_sam(struct auth_serversupplied_info **server_info, return NT_STATUS_NO_MEMORY; } - if ( !(pwd = getpwnam_alloc(result, username)) ) { + if ( !(pwd = Get_Pwnam_alloc(result, username)) ) { DEBUG(1, ("User %s in passdb, but getpwnam() fails!\n", pdb_get_username(sampass))); TALLOC_FREE(result); diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c index 1a7c4816e8..4a702ef230 100644 --- a/source3/auth/token_util.c +++ b/source3/auth/token_util.c @@ -757,14 +757,14 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, * about the mapping of guest sid to lp_guestaccount() * username and will return the unix_pw info for a guest * user. Use it if it's there, else lookup the *uid details - * using getpwnam_alloc(). See bug #6291 for details. JRA. + * using Get_Pwnam_alloc(). See bug #6291 for details. JRA. */ /* We must always assign the *uid. */ if (sam_acct->unix_pw == NULL) { - struct passwd *pwd = getpwnam_alloc(sam_acct, *found_username ); + struct passwd *pwd = Get_Pwnam_alloc(sam_acct, *found_username ); if (!pwd) { - DEBUG(10, ("getpwnam_alloc failed for %s\n", + DEBUG(10, ("Get_Pwnam_alloc failed for %s\n", *found_username)); result = NT_STATUS_NO_SUCH_USER; goto done; -- cgit