svn commit: samba r11916 - branches/SAMBA_3_0/source/auth trunk/source/auth

vlendec at samba.org vlendec at samba.org
Sat Nov 26 18:20:59 GMT 2005


Author: vlendec
Date: 2005-11-26 18:20:58 +0000 (Sat, 26 Nov 2005)
New Revision: 11916

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11916

Log:
auth_get_sam_account is only used in auth_rhosts.c -- move it there
Modified:
   branches/SAMBA_3_0/source/auth/auth_rhosts.c
   branches/SAMBA_3_0/source/auth/auth_util.c
   trunk/source/auth/auth_rhosts.c
   trunk/source/auth/auth_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_rhosts.c
===================================================================
--- branches/SAMBA_3_0/source/auth/auth_rhosts.c	2005-11-26 17:54:24 UTC (rev 11915)
+++ branches/SAMBA_3_0/source/auth/auth_rhosts.c	2005-11-26 18:20:58 UTC (rev 11916)
@@ -24,6 +24,36 @@
 #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.
 ****************************************************************************/

Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_3_0/source/auth/auth_util.c	2005-11-26 17:54:24 UTC (rev 11915)
+++ branches/SAMBA_3_0/source/auth/auth_util.c	2005-11-26 18:20:58 UTC (rev 11916)
@@ -51,36 +51,6 @@
 }
 
 /****************************************************************************
- 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
 ****************************************************************************/
 

Modified: trunk/source/auth/auth_rhosts.c
===================================================================
--- trunk/source/auth/auth_rhosts.c	2005-11-26 17:54:24 UTC (rev 11915)
+++ trunk/source/auth/auth_rhosts.c	2005-11-26 18:20:58 UTC (rev 11916)
@@ -24,6 +24,36 @@
 #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.
 ****************************************************************************/

Modified: trunk/source/auth/auth_util.c
===================================================================
--- trunk/source/auth/auth_util.c	2005-11-26 17:54:24 UTC (rev 11915)
+++ trunk/source/auth/auth_util.c	2005-11-26 18:20:58 UTC (rev 11916)
@@ -51,36 +51,6 @@
 }
 
 /****************************************************************************
- 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
 ****************************************************************************/
 



More information about the samba-cvs mailing list