diff options
author | Gerald Carter <jerry@samba.org> | 2006-02-21 14:34:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:16 -0500 |
commit | cd559192633d78a9f06e239c6a448955f6ea0842 (patch) | |
tree | 9b91416a493d3f9ca1d8c65666184539ce8919de /source3/auth/auth_rhosts.c | |
parent | 87ef96e6be75fb4988fac48b2e21892720c20426 (diff) | |
download | samba-cd559192633d78a9f06e239c6a448955f6ea0842.tar.gz samba-cd559192633d78a9f06e239c6a448955f6ea0842.tar.bz2 samba-cd559192633d78a9f06e239c6a448955f6ea0842.zip |
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)
Diffstat (limited to 'source3/auth/auth_rhosts.c')
-rw-r--r-- | source3/auth/auth_rhosts.c | 19 |
1 files changed, 10 insertions, 9 deletions
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; } /**************************************************************************** |