svn commit: samba r12303 - branches/SAMBA_3_0/source/lib trunk/source/lib

vlendec at samba.org vlendec at samba.org
Sat Dec 17 15:38:42 GMT 2005


Author: vlendec
Date: 2005-12-17 15:38:41 +0000 (Sat, 17 Dec 2005)
New Revision: 12303

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

Log:
Move split_domain_and_name to util_getent.c and make it static there.

Volker

Modified:
   branches/SAMBA_3_0/source/lib/username.c
   branches/SAMBA_3_0/source/lib/util_getent.c
   trunk/source/lib/username.c
   trunk/source/lib/util_getent.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/username.c
===================================================================
--- branches/SAMBA_3_0/source/lib/username.c	2005-12-17 10:10:09 UTC (rev 12302)
+++ branches/SAMBA_3_0/source/lib/username.c	2005-12-17 15:38:41 UTC (rev 12303)
@@ -35,34 +35,6 @@
 	return !(strchr_m(name, *lp_winbind_separator()));
 }
 
-/*****************************************************************
- Splits passed user or group name to domain and user/group name parts
- Returns True if name was splitted and False otherwise.
-*****************************************************************/
-
-BOOL split_domain_and_name(const char *name, char *domain, char* username)
-{
-	char *p = strchr(name,*lp_winbind_separator());
-	
-	
-	/* Parse a string of the form DOMAIN/user into a domain and a user */
-	DEBUG(10,("split_domain_and_name: checking whether name |%s| local or not\n", name));
-	
-	if (p) {
-		fstrcpy(username, p+1);
-		fstrcpy(domain, name);
-		domain[PTR_DIFF(p, name)] = 0;
-	} else if (lp_winbind_use_default_domain()) {
-		fstrcpy(username, name);
-		fstrcpy(domain, lp_workgroup());
-	} else {
-		return False;
-	}
-
-	DEBUG(10,("split_domain_and_name: all is fine, domain is |%s| and name is |%s|\n", domain, username));
-	return True;
-}
-
 /****************************************************************************
  Get a users home directory.
 ****************************************************************************/

Modified: branches/SAMBA_3_0/source/lib/util_getent.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_getent.c	2005-12-17 10:10:09 UTC (rev 12302)
+++ branches/SAMBA_3_0/source/lib/util_getent.c	2005-12-17 15:38:41 UTC (rev 12303)
@@ -239,6 +239,37 @@
 	return list_head;
 }
 
+/*****************************************************************
+ Splits passed user or group name to domain and user/group name parts
+ Returns True if name was splitted and False otherwise.
+*****************************************************************/
+
+static BOOL split_domain_and_name(const char *name, char *domain,
+				  char* username)
+{
+	char *p = strchr(name,*lp_winbind_separator());
+	
+	
+	/* Parse a string of the form DOMAIN/user into a domain and a user */
+	DEBUG(10,("split_domain_and_name: checking whether name |%s| local or "
+		  "not\n", name));
+	
+	if (p) {
+		fstrcpy(username, p+1);
+		fstrcpy(domain, name);
+		domain[PTR_DIFF(p, name)] = 0;
+	} else if (lp_winbind_use_default_domain()) {
+		fstrcpy(username, name);
+		fstrcpy(domain, lp_workgroup());
+	} else {
+		return False;
+	}
+
+	DEBUG(10,("split_domain_and_name: all is fine, domain is |%s| and "
+		  "name is |%s|\n", domain, username));
+	return True;
+}
+
 /****************************************************************
  Get the list of UNIX users in a group.
  We have to enumerate the /etc/group file as some UNIX getgrnam()

Modified: trunk/source/lib/username.c
===================================================================
--- trunk/source/lib/username.c	2005-12-17 10:10:09 UTC (rev 12302)
+++ trunk/source/lib/username.c	2005-12-17 15:38:41 UTC (rev 12303)
@@ -35,34 +35,6 @@
 	return !(strchr_m(name, *lp_winbind_separator()));
 }
 
-/*****************************************************************
- Splits passed user or group name to domain and user/group name parts
- Returns True if name was splitted and False otherwise.
-*****************************************************************/
-
-BOOL split_domain_and_name(const char *name, char *domain, char* username)
-{
-	char *p = strchr(name,*lp_winbind_separator());
-	
-	
-	/* Parse a string of the form DOMAIN/user into a domain and a user */
-	DEBUG(10,("split_domain_and_name: checking whether name |%s| local or not\n", name));
-	
-	if (p) {
-		fstrcpy(username, p+1);
-		fstrcpy(domain, name);
-		domain[PTR_DIFF(p, name)] = 0;
-	} else if (lp_winbind_use_default_domain()) {
-		fstrcpy(username, name);
-		fstrcpy(domain, lp_workgroup());
-	} else {
-		return False;
-	}
-
-	DEBUG(10,("split_domain_and_name: all is fine, domain is |%s| and name is |%s|\n", domain, username));
-	return True;
-}
-
 /****************************************************************************
  Get a users home directory.
 ****************************************************************************/

Modified: trunk/source/lib/util_getent.c
===================================================================
--- trunk/source/lib/util_getent.c	2005-12-17 10:10:09 UTC (rev 12302)
+++ trunk/source/lib/util_getent.c	2005-12-17 15:38:41 UTC (rev 12303)
@@ -239,6 +239,37 @@
 	return list_head;
 }
 
+/*****************************************************************
+ Splits passed user or group name to domain and user/group name parts
+ Returns True if name was splitted and False otherwise.
+*****************************************************************/
+
+static BOOL split_domain_and_name(const char *name, char *domain,
+				  char* username)
+{
+	char *p = strchr(name,*lp_winbind_separator());
+	
+	
+	/* Parse a string of the form DOMAIN/user into a domain and a user */
+	DEBUG(10,("split_domain_and_name: checking whether name |%s| local or "
+		  "not\n", name));
+	
+	if (p) {
+		fstrcpy(username, p+1);
+		fstrcpy(domain, name);
+		domain[PTR_DIFF(p, name)] = 0;
+	} else if (lp_winbind_use_default_domain()) {
+		fstrcpy(username, name);
+		fstrcpy(domain, lp_workgroup());
+	} else {
+		return False;
+	}
+
+	DEBUG(10,("split_domain_and_name: all is fine, domain is |%s| and "
+		  "name is |%s|\n", domain, username));
+	return True;
+}
+
 /****************************************************************
  Get the list of UNIX users in a group.
  We have to enumerate the /etc/group file as some UNIX getgrnam()



More information about the samba-cvs mailing list