svn commit: samba r25308 - in branches/SAMBA_4_0: . source/param

jelmer at samba.org jelmer at samba.org
Mon Sep 24 18:47:52 GMT 2007


Author: jelmer
Date: 2007-09-24 18:47:50 +0000 (Mon, 24 Sep 2007)
New Revision: 25308

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

Log:
Remove use of pstring.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/param/loadparm.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c	2007-09-24 16:43:16 UTC (rev 25307)
+++ branches/SAMBA_4_0/source/param/loadparm.c	2007-09-24 18:47:50 UTC (rev 25308)
@@ -63,7 +63,6 @@
 #include "lib/util/dlinklist.h"
 #include "param/param.h"
 #include "param/loadparm.h"
-#include "pstring.h"
 
 static bool bLoaded = false;
 
@@ -82,7 +81,7 @@
 /* 
  * This structure describes global (ie., server-wide) parameters.
  */
-struct global
+struct loadparm_global
 {
 	enum server_role server_role;
 
@@ -265,7 +264,7 @@
 
 /* local variables */
 static struct loadparm_context {
-	struct global Globals;
+	struct loadparm_global Globals;
 	struct loadparm_service **ServicePtrs;
 	int iNumServices;
 	struct loadparm_service *currentService;
@@ -1130,7 +1129,6 @@
 		 const char *user, const char *pszHomedir)
 {
 	struct loadparm_service *service;
-	pstring newHomedir;
 
 	service = add_a_service(lp_ctx, default_service, pszHomename);
 
@@ -1139,14 +1137,11 @@
 
 	if (!(*(default_service->szPath))
 	    || strequal(default_service->szPath, sDefault.szPath)) {
-		pstrcpy(newHomedir, pszHomedir);
+		service->szPath = talloc_strdup(service, pszHomedir);
 	} else {
-		pstrcpy(newHomedir, lp_pathname(default_service));
-		string_sub(newHomedir,"%H", pszHomedir, sizeof(newHomedir)); 
+		service->szPath = string_sub_talloc(service, lp_pathname(default_service),"%H", pszHomedir); 
 	}
 
-	string_set(service, &service->szPath, newHomedir);
-
 	if (!(*(service->comment))) {
 		service->comment = talloc_asprintf(service, "Home directory of %s", user);
 	}
@@ -1154,7 +1149,7 @@
 	service->bBrowseable = default_service->bBrowseable;
 
 	DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", 
-		  pszHomename, user, newHomedir));
+		  pszHomename, user, service->szPath));
 	
 	return true;
 }
@@ -2571,8 +2566,9 @@
 			 * The substitution here is used to support %U is
 			 * service names
 			 */
-			serviceName = standard_sub_basic(loadparm.ServicePtrs[iService],
-							 loadparm.ServicePtrs[iService]->szService);
+			serviceName = standard_sub_basic(
+					loadparm.ServicePtrs[iService],
+					loadparm.ServicePtrs[iService]->szService);
 			if (strequal(serviceName, service_name))
 				return loadparm.ServicePtrs[iService];
 		}



More information about the samba-cvs mailing list