svn commit: samba r25564 - in branches: SAMBA_3_2/source/lib SAMBA_3_2/source/param SAMBA_3_2/source/rpc_server SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/param SAMBA_3_2_0/source/rpc_server

vlendec at samba.org vlendec at samba.org
Sun Oct 7 17:58:50 GMT 2007


Author: vlendec
Date: 2007-10-07 17:58:48 +0000 (Sun, 07 Oct 2007)
New Revision: 25564

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

Log:
Pass sharename to delete_share_security()
Modified:
   branches/SAMBA_3_2/source/lib/sharesec.c
   branches/SAMBA_3_2/source/param/loadparm.c
   branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2_0/source/lib/sharesec.c
   branches/SAMBA_3_2_0/source/param/loadparm.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/sharesec.c
===================================================================
--- branches/SAMBA_3_2/source/lib/sharesec.c	2007-10-07 13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2/source/lib/sharesec.c	2007-10-07 17:58:48 UTC (rev 25564)
@@ -197,18 +197,20 @@
  Delete a security descriptor.
 ********************************************************************/
 
-BOOL delete_share_security(const struct share_params *params)
+BOOL delete_share_security(const char *servicename)
 {
 	TDB_DATA kbuf;
-	fstring key;
+	char *key;
 
-	slprintf(key, sizeof(key)-1, "SECDESC/%s",
-		 lp_servicename(params->service));
+	if (!(key = talloc_asprintf(talloc_tos(), "SECDESC/%s",
+				    servicename))) {
+		return False;
+	}
 	kbuf = string_term_tdb_data(key);
 
 	if (tdb_trans_delete(share_tdb, kbuf) != 0) {
-		DEBUG(0,("delete_share_security: Failed to delete entry for share %s\n",
-			 lp_servicename(params->service) ));
+		DEBUG(0, ("delete_share_security: Failed to delete entry for "
+			  "share %s\n", servicename));
 		return False;
 	}
 

Modified: branches/SAMBA_3_2/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_2/source/param/loadparm.c	2007-10-07 13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2/source/param/loadparm.c	2007-10-07 17:58:48 UTC (rev 25564)
@@ -5517,7 +5517,7 @@
 			/* Remove from the share ACL db. */
 			DEBUG(10,("load_usershare_shares: Removing deleted usershare %s\n",
 				lp_servicename(iService) ));
-			delete_share_security(snum2params_static(iService));
+			delete_share_security(lp_servicename(iService));
 			free_service_byindex(iService);
 		}
 	}
@@ -5749,7 +5749,7 @@
 
 		if (!usershare_exists(iService, &last_mod)) {
 			/* Remove the share security tdb entry for it. */
-			delete_share_security(snum2params_static(iService));
+			delete_share_security(lp_servicename(iService));
 			/* Remove it from the array. */
 			free_service_byindex(iService);
 			/* Doesn't exist anymore. */

Modified: branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c	2007-10-07 13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c	2007-10-07 17:58:48 UTC (rev 25564)
@@ -1994,7 +1994,7 @@
 	}
 
 	/* Delete the SD in the database. */
-	delete_share_security(params);
+	delete_share_security(lp_servicename(params->service));
 
 	lp_killservice(params->service);
 

Modified: branches/SAMBA_3_2_0/source/lib/sharesec.c
===================================================================
--- branches/SAMBA_3_2_0/source/lib/sharesec.c	2007-10-07 13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2_0/source/lib/sharesec.c	2007-10-07 17:58:48 UTC (rev 25564)
@@ -197,18 +197,20 @@
  Delete a security descriptor.
 ********************************************************************/
 
-BOOL delete_share_security(const struct share_params *params)
+BOOL delete_share_security(const char *servicename)
 {
 	TDB_DATA kbuf;
-	fstring key;
+	char *key;
 
-	slprintf(key, sizeof(key)-1, "SECDESC/%s",
-		 lp_servicename(params->service));
+	if (!(key = talloc_asprintf(talloc_tos(), "SECDESC/%s",
+				    servicename))) {
+		return False;
+	}
 	kbuf = string_term_tdb_data(key);
 
 	if (tdb_trans_delete(share_tdb, kbuf) != 0) {
-		DEBUG(0,("delete_share_security: Failed to delete entry for share %s\n",
-			 lp_servicename(params->service) ));
+		DEBUG(0, ("delete_share_security: Failed to delete entry for "
+			  "share %s\n", servicename));
 		return False;
 	}
 

Modified: branches/SAMBA_3_2_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_2_0/source/param/loadparm.c	2007-10-07 13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2_0/source/param/loadparm.c	2007-10-07 17:58:48 UTC (rev 25564)
@@ -5523,7 +5523,7 @@
 			/* Remove from the share ACL db. */
 			DEBUG(10,("load_usershare_shares: Removing deleted usershare %s\n",
 				lp_servicename(iService) ));
-			delete_share_security(snum2params_static(iService));
+			delete_share_security(lp_servicename(iService));
 			free_service_byindex(iService);
 		}
 	}
@@ -5755,7 +5755,7 @@
 
 		if (!usershare_exists(iService, &last_mod)) {
 			/* Remove the share security tdb entry for it. */
-			delete_share_security(snum2params_static(iService));
+			delete_share_security(lp_servicename(iService));
 			/* Remove it from the array. */
 			free_service_byindex(iService);
 			/* Doesn't exist anymore. */

Modified: branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c	2007-10-07 13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c	2007-10-07 17:58:48 UTC (rev 25564)
@@ -1906,7 +1906,7 @@
 		return WERR_ACCESS_DENIED;
 
 	/* Delete the SD in the database. */
-	delete_share_security(params);
+	delete_share_security(lp_servicename(params->service));
 
 	lp_killservice(params->service);
 



More information about the samba-cvs mailing list