svn commit: samba r16893 - in trunk/source: lib modules printing rpc_server smbd

vlendec at samba.org vlendec at samba.org
Sun Jul 9 12:30:48 GMT 2006


Author: vlendec
Date: 2006-07-09 12:30:48 +0000 (Sun, 09 Jul 2006)
New Revision: 16893

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

Log:
Make sub_advanced not use snum but the service name.

Volker

Modified:
   trunk/source/lib/substitute.c
   trunk/source/modules/vfs_expand_msdfs.c
   trunk/source/modules/vfs_full_audit.c
   trunk/source/modules/vfs_recycle.c
   trunk/source/printing/print_generic.c
   trunk/source/printing/printing.c
   trunk/source/rpc_server/srv_srvsvc_nt.c
   trunk/source/smbd/lanman.c
   trunk/source/smbd/service.c


Changeset:
Modified: trunk/source/lib/substitute.c
===================================================================
--- trunk/source/lib/substitute.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/lib/substitute.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -665,7 +665,7 @@
 /****************************************************************************
 ****************************************************************************/
 
-char *alloc_sub_advanced(int snum, const char *user, 
+char *alloc_sub_advanced(const char *servicename, const char *user, 
 			 const char *connectpath, gid_t gid, 
 			 const char *smb_name, const char *domain_name,
 			 const char *str)
@@ -695,7 +695,7 @@
 			a_string = realloc_string_sub(a_string, "%P", connectpath); 
 			break;
 		case 'S': 
-			a_string = realloc_string_sub(a_string, "%S", lp_servicename(snum)); 
+			a_string = realloc_string_sub(a_string, "%S", servicename);
 			break;
 		case 'g': 
 			a_string = realloc_string_sub(a_string, "%g", gidtoname(gid)); 
@@ -712,7 +712,8 @@
 			 * "path =" string in [homes] and so needs the
 			 * service name, not the username.  */
 		case 'p': 
-			a_string = realloc_string_sub(a_string, "%p", automount_path(lp_servicename(snum))); 
+			a_string = realloc_string_sub(a_string, "%p",
+						      automount_path(servicename)); 
 			break;
 			
 		default: 
@@ -730,15 +731,15 @@
 	return ret_string;
 }
 
-void standard_sub_advanced(int snum, const char *user, 
+void standard_sub_advanced(const char *servicename, const char *user, 
 			   const char *connectpath, gid_t gid, 
 			   const char *smb_name, const char *domain_name,
 			   char *str, size_t len)
 {
 	char *s;
 	
-	s = alloc_sub_advanced(snum, user, connectpath, gid, smb_name,
-			       domain_name, str);
+	s = alloc_sub_advanced(servicename, user, connectpath,
+			       gid, smb_name, domain_name, str);
 
 	if ( s ) {
 		strncpy( str, s, len );

Modified: trunk/source/modules/vfs_expand_msdfs.c
===================================================================
--- trunk/source/modules/vfs_expand_msdfs.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/modules/vfs_expand_msdfs.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -136,7 +136,7 @@
 		return False;
 	}
 
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,

Modified: trunk/source/modules/vfs_full_audit.c
===================================================================
--- trunk/source/modules/vfs_full_audit.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/modules/vfs_full_audit.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -645,7 +645,7 @@
 
 	pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit",
 					     "prefix", "%u|%I"));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,

Modified: trunk/source/modules/vfs_recycle.c
===================================================================
--- trunk/source/modules/vfs_recycle.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/modules/vfs_recycle.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -386,7 +386,8 @@
 	BOOL exist;
 	int rc = -1;
 
-	repository = alloc_sub_advanced(SNUM(conn),  conn->user,
+	repository = alloc_sub_advanced(lp_servicename(SNUM(conn)),
+					conn->user,
 					conn->connectpath, conn->gid,
 					get_current_username(),
 					current_user_info.domain,

Modified: trunk/source/printing/print_generic.c
===================================================================
--- trunk/source/printing/print_generic.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/printing/print_generic.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -58,7 +58,8 @@
 	pstring_sub( syscmd, "%p", printername );
 
 	if ( do_sub && snum != -1 )
-		standard_sub_advanced(snum, current_user_info.unix_name, "",
+		standard_sub_advanced(lp_servicename(snum),
+				      current_user_info.unix_name, "",
 				      current_user.ut.gid,
 				      get_current_username(),
 				      current_user_info.domain,

Modified: trunk/source/printing/printing.c
===================================================================
--- trunk/source/printing/printing.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/printing/printing.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -1458,7 +1458,8 @@
 	pstrcpy( lpqcommand, lp_lpqcommand(snum));
 	string_sub2( lpqcommand, "%p", PRINTERNAME(snum), sizeof(lpqcommand), 
 		     False, False, False );
-	standard_sub_advanced(snum, current_user_info.unix_name, "",
+	standard_sub_advanced(lp_servicename(snum),
+			      current_user_info.unix_name, "",
 			      current_user.ut.gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -1467,7 +1468,8 @@
 	pstrcpy( lprmcommand, lp_lprmcommand(snum));
 	string_sub2( lprmcommand, "%p", PRINTERNAME(snum), sizeof(lprmcommand), 
 		     False, False, False );
-	standard_sub_advanced(snum, current_user_info.unix_name, "",
+	standard_sub_advanced(lp_servicename(snum),
+			      current_user_info.unix_name, "",
 			      current_user.ut.gid,
 			      get_current_username(),
 			      current_user_info.domain,

Modified: trunk/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- trunk/source/rpc_server/srv_srvsvc_nt.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/rpc_server/srv_srvsvc_nt.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -245,7 +245,7 @@
 
 	char *net_name = lp_servicename(snum);
 	pstrcpy(remark, lp_comment(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -271,7 +271,7 @@
 	char *net_name = lp_servicename(snum);
 	
 	pstrcpy(remark, lp_comment(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -368,7 +368,7 @@
 
 	const char *net_name = lp_servicename(snum);
 	pstrcpy(remark, lp_comment(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -398,7 +398,7 @@
 
 	pstrcpy(net_name, lp_servicename(snum));
 	pstrcpy(remark, lp_comment(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -431,7 +431,7 @@
         pstring remark;
 
 	pstrcpy(remark, lp_comment(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,

Modified: trunk/source/smbd/lanman.c
===================================================================
--- trunk/source/smbd/lanman.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/smbd/lanman.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -72,7 +72,7 @@
 
 	StrnCpy(buf,src,sizeof(buf)/2);
 	pstring_sub(buf,"%S",lp_servicename(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -103,7 +103,7 @@
 	}
 	StrnCpy(buf,s,sizeof(buf)/2);
 	pstring_sub(buf,"%S",lp_servicename(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -119,7 +119,7 @@
 	}
 	StrnCpy(buf,s,sizeof(buf)/2);
 	pstring_sub(buf,"%S",lp_servicename(snum));
-	standard_sub_advanced(SNUM(conn), conn->user,
+	standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 			      conn->connectpath, conn->gid,
 			      get_current_username(),
 			      current_user_info.domain,
@@ -2713,7 +2713,7 @@
 			SIVAL(p,6,0);
 		} else {
 			SIVAL(p,6,PTR_DIFF(p2,*rdata));
-			standard_sub_advanced(SNUM(conn), conn->user,
+			standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 					      conn->connectpath, conn->gid,
 					      get_current_username(),
 					      current_user_info.domain,

Modified: trunk/source/smbd/service.c
===================================================================
--- trunk/source/smbd/service.c	2006-07-09 12:17:15 UTC (rev 16892)
+++ trunk/source/smbd/service.c	2006-07-09 12:30:48 UTC (rev 16893)
@@ -749,7 +749,7 @@
 	{
 		pstring s;
 		pstrcpy(s,lp_pathname(snum));
-		standard_sub_advanced(SNUM(conn), conn->user,
+		standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 				      conn->connectpath, conn->gid,
 				      get_current_username(),
 				      current_user_info.domain,
@@ -828,7 +828,7 @@
 	if (*lp_rootpreexec(snum)) {
 		pstring cmd;
 		pstrcpy(cmd,lp_rootpreexec(snum));
-		standard_sub_advanced(SNUM(conn), conn->user,
+		standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 				      conn->connectpath, conn->gid,
 				      get_current_username(),
 				      current_user_info.domain,
@@ -865,7 +865,7 @@
 	if (*lp_preexec(snum)) {
 		pstring cmd;
 		pstrcpy(cmd,lp_preexec(snum));
-		standard_sub_advanced(SNUM(conn), conn->user,
+		standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 				      conn->connectpath, conn->gid,
 				      get_current_username(),
 				      current_user_info.domain,
@@ -1163,7 +1163,7 @@
 	    change_to_user(conn, vuid))  {
 		pstring cmd;
 		pstrcpy(cmd,lp_postexec(SNUM(conn)));
-		standard_sub_advanced(SNUM(conn), conn->user,
+		standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 				      conn->connectpath, conn->gid,
 				      get_current_username(),
 				      current_user_info.domain,
@@ -1177,7 +1177,7 @@
 	if (*lp_rootpostexec(SNUM(conn)))  {
 		pstring cmd;
 		pstrcpy(cmd,lp_rootpostexec(SNUM(conn)));
-		standard_sub_advanced(SNUM(conn), conn->user,
+		standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user,
 				      conn->connectpath, conn->gid,
 				      get_current_username(),
 				      current_user_info.domain,



More information about the samba-cvs mailing list