svn commit: samba r16959 - in trunk/source: lib rpc_server script/tests utils

vlendec at samba.org vlendec at samba.org
Tue Jul 11 21:10:46 GMT 2006


Author: vlendec
Date: 2006-07-11 21:10:44 +0000 (Tue, 11 Jul 2006)
New Revision: 16959

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

Log:
get_share_security does not need snum, activate RPC-SAMBA3-SRVSVC
Modified:
   trunk/source/lib/sharesec.c
   trunk/source/rpc_server/srv_srvsvc_nt.c
   trunk/source/script/tests/test_posix_s3.sh
   trunk/source/utils/sharesec.c


Changeset:
Modified: trunk/source/lib/sharesec.c
===================================================================
--- trunk/source/lib/sharesec.c	2006-07-11 21:09:56 UTC (rev 16958)
+++ trunk/source/lib/sharesec.c	2006-07-11 21:10:44 UTC (rev 16959)
@@ -108,7 +108,8 @@
  Pull a security descriptor from the share tdb.
  ********************************************************************/
 
-SEC_DESC *get_share_security( TALLOC_CTX *ctx, int snum, size_t *psize)
+SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename,
+			      size_t *psize)
 {
 	prs_struct ps;
 	fstring key;
@@ -122,12 +123,13 @@
 
 	/* Fetch security descriptor from tdb */
  
-	slprintf(key, sizeof(key)-1, "SECDESC/%s", lp_servicename(snum));
+	slprintf(key, sizeof(key)-1, "SECDESC/%s", servicename);
  
 	if (tdb_prs_fetch(share_tdb, key, &ps, ctx)!=0 ||
 		!sec_io_desc("get_share_security", &psd, &ps, 1)) {
  
-		DEBUG(4,("get_share_security: using default secdesc for %s\n", lp_servicename(snum) ));
+		DEBUG(4, ("get_share_security: using default secdesc for %s\n",
+			  servicename));
  
 		return get_share_security_default(ctx, psize, GENERIC_ALL_ACCESS);
 	}

Modified: trunk/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- trunk/source/rpc_server/srv_srvsvc_nt.c	2006-07-11 21:09:56 UTC (rev 16958)
+++ trunk/source/rpc_server/srv_srvsvc_nt.c	2006-07-11 21:10:44 UTC (rev 16959)
@@ -338,7 +338,7 @@
 	if (mem_ctx == NULL)
 		return False;
 
-	psd = get_share_security(mem_ctx, snum, &sd_size);
+	psd = get_share_security(mem_ctx, lp_servicename(snum), &sd_size);
 
 	if (!psd)
 		goto out;
@@ -415,7 +415,7 @@
 
 	pstrcpy(passwd, "");
 
-	sd = get_share_security(ctx, snum, &sd_size);
+	sd = get_share_security(ctx, lp_servicename(snum), &sd_size);
 
 	init_srv_share_info502(&sh502->info_502, net_name, get_share_type(snum), remark, 0, 0xffffffff, 1, path, passwd, sd, sd_size);
 	init_srv_share_info502_str(&sh502->info_502_str, net_name, remark, path, passwd, sd, sd_size);
@@ -493,7 +493,7 @@
 
 	ZERO_STRUCTP(sh1501);
 
-	sd = get_share_security(ctx, snum, &sd_size);
+	sd = get_share_security(ctx, lp_servicename(snum), &sd_size);
 
 	sh1501->sdb = make_sec_desc_buf(p->mem_ctx, sd_size, sd);
 }
@@ -1684,7 +1684,8 @@
 		SEC_DESC *old_sd;
 		size_t sd_size;
 
-		old_sd = get_share_security(p->mem_ctx, snum, &sd_size);
+		old_sd = get_share_security(p->mem_ctx, lp_servicename(snum),
+					    &sd_size);
 
 		if (old_sd && !sec_desc_equal(old_sd, psd)) {
 			if (!set_share_security(p->mem_ctx, share_name, psd))

Modified: trunk/source/script/tests/test_posix_s3.sh
===================================================================
--- trunk/source/script/tests/test_posix_s3.sh	2006-07-11 21:09:56 UTC (rev 16958)
+++ trunk/source/script/tests/test_posix_s3.sh	2006-07-11 21:10:44 UTC (rev 16959)
@@ -34,6 +34,7 @@
 raw="$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH"
 
 rpc="RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY"
+rpc="$rpc RPC-SAMBA3-SRVSVC"
 
 tests="$base $raw $rpc"
 

Modified: trunk/source/utils/sharesec.c
===================================================================
--- trunk/source/utils/sharesec.c	2006-07-11 21:09:56 UTC (rev 16958)
+++ trunk/source/utils/sharesec.c	2006-07-11 21:10:44 UTC (rev 16959)
@@ -382,7 +382,8 @@
 		
 	switch ( mode ) {
 		case SMB_ACL_VIEW:
-			if (!(secdesc = get_share_security( ctx, snum, &sd_size )) ) {
+			if (!(secdesc = get_share_security( ctx, sharename,
+							    &sd_size )) ) {
 				fprintf(stderr, "Unable to retrieve permissions for share [%s]\n", sharename);
 				return -1;
 			}



More information about the samba-cvs mailing list