From cd559192633d78a9f06e239c6a448955f6ea0842 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 21 Feb 2006 14:34:11 +0000 Subject: r13590: * replace all pdb_init_sam[_talloc]() calls with samu_new() * replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix() (This used to be commit 6f1afa4acc93a07d0ee9940822d7715acaae634f) --- source3/auth/auth_rhosts.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'source3/auth/auth_rhosts.c') diff --git a/source3/auth/auth_rhosts.c b/source3/auth/auth_rhosts.c index 7068fa2e88..23e276bc84 100644 --- a/source3/auth/auth_rhosts.c +++ b/source3/auth/auth_rhosts.c @@ -31,7 +31,7 @@ static NTSTATUS auth_get_sam_account(const char *user, struct samu **account) { BOOL pdb_ret; - NTSTATUS nt_status; + NTSTATUS nt_status = NT_STATUS_NO_SUCH_USER; if ( !(*account = samu_new( NULL )) ) { return NT_STATUS_NO_MEMORY; @@ -41,17 +41,18 @@ static NTSTATUS auth_get_sam_account(const char *user, struct samu **account) pdb_ret = pdb_getsampwnam(*account, user); unbecome_root(); - if (!pdb_ret) { - - struct passwd *pass = Get_Pwnam(user); - if (!pass) - return NT_STATUS_NO_SUCH_USER; + if (!pdb_ret) + { + struct passwd *pass; - if (!NT_STATUS_IS_OK(nt_status = pdb_fill_sam_pw(*account, pass))) { - return nt_status; + if ( !(pass = Get_Pwnam( user )) ) { + return NT_STATUS_NO_SUCH_USER; } + + nt_status = samu_set_unix( *account, pass ); } - return NT_STATUS_OK; + + return nt_status; } /**************************************************************************** -- cgit