r11916: auth_get_sam_account is only used in auth_rhosts.c -- move it there
authorVolker Lendecke <vlendec@samba.org>
Sat, 26 Nov 2005 18:20:58 +0000 (18:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:35 +0000 (11:05 -0500)
source/auth/auth_rhosts.c
source/auth/auth_util.c

index b295df9328f2be655242bdb4695fec72f3e9dede..b561e3d42bee9c4d94b777cfdc34e510beda941d 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
+/****************************************************************************
+ Create a SAM_ACCOUNT - either by looking in the pdb, or by faking it up from
+ unix info.
+****************************************************************************/
+
+static NTSTATUS auth_get_sam_account(const char *user, SAM_ACCOUNT **account) 
+{
+       BOOL pdb_ret;
+       NTSTATUS nt_status;
+       if (!NT_STATUS_IS_OK(nt_status = pdb_init_sam(account))) {
+               return nt_status;
+       }
+       
+       become_root();
+       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 (!NT_STATUS_IS_OK(nt_status = pdb_fill_sam_pw(*account, pass))) {
+                       return nt_status;
+               }
+       }
+       return NT_STATUS_OK;
+}
+
 /****************************************************************************
  Read the a hosts.equiv or .rhosts file and check if it
  allows this user from this machine.
index 6a92c8782e8b4dcee1a9b0217c5aea2c20ab2334..61cb7f31cc759e934a86fc52ed2db92f5937fe4d 100644 (file)
@@ -50,36 +50,6 @@ static int smb_create_user(const char *domain, const char *unix_username, const
        return ret;
 }
 
-/****************************************************************************
- Create a SAM_ACCOUNT - either by looking in the pdb, or by faking it up from
- unix info.
-****************************************************************************/
-
-NTSTATUS auth_get_sam_account(const char *user, SAM_ACCOUNT **account) 
-{
-       BOOL pdb_ret;
-       NTSTATUS nt_status;
-       if (!NT_STATUS_IS_OK(nt_status = pdb_init_sam(account))) {
-               return nt_status;
-       }
-       
-       become_root();
-       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 (!NT_STATUS_IS_OK(nt_status = pdb_fill_sam_pw(*account, pass))) {
-                       return nt_status;
-               }
-       }
-       return NT_STATUS_OK;
-}
-
 /****************************************************************************
  Create an auth_usersupplied_data structure
 ****************************************************************************/