[PATCH 03/11] libcli/security: remove unused sec_desc_del_sid()

David Disseldorp ddiss at samba.org
Wed May 28 16:09:38 MDT 2014


The function is unused, and shares mostly the same behaviour as
security_descriptor_acl_del().

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 libcli/security/secdesc.c | 33 ---------------------------------
 libcli/security/secdesc.h |  4 ----
 2 files changed, 37 deletions(-)

diff --git a/libcli/security/secdesc.c b/libcli/security/secdesc.c
index a3657dd..ff14d18 100644
--- a/libcli/security/secdesc.c
+++ b/libcli/security/secdesc.c
@@ -411,39 +411,6 @@ NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, u
 	return NT_STATUS_OK;
 }
 
-/*******************************************************************
- Delete a SID from a struct security_descriptor.
-********************************************************************/
-
-NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size)
-{
-	struct security_descriptor *sd   = 0;
-	struct security_acl  *dacl = 0;
-	struct security_ace  *ace  = 0;
-	NTSTATUS  status;
-
-	if (!ctx || !psd[0] || !sid || !sd_size)
-		return NT_STATUS_INVALID_PARAMETER;
-
-	*sd_size = 0;
-
-	status = sec_ace_del_sid(ctx, &ace, psd[0]->dacl->aces, &psd[0]->dacl->num_aces, sid);
-
-	if (!NT_STATUS_IS_OK(status))
-		return status;
-
-	if (!(dacl = make_sec_acl(ctx, psd[0]->dacl->revision, psd[0]->dacl->num_aces, ace)))
-		return NT_STATUS_UNSUCCESSFUL;
-
-	if (!(sd = make_sec_desc(ctx, psd[0]->revision, psd[0]->type, psd[0]->owner_sid,
-		psd[0]->group_sid, psd[0]->sacl, dacl, sd_size)))
-		return NT_STATUS_UNSUCCESSFUL;
-
-	*psd = sd;
-	 sd  = 0;
-	return NT_STATUS_OK;
-}
-
 /*
  * Determine if an struct security_ace is inheritable
  */
diff --git a/libcli/security/secdesc.h b/libcli/security/secdesc.h
index 4cef9be..4c96ccd 100644
--- a/libcli/security/secdesc.h
+++ b/libcli/security/secdesc.h
@@ -94,10 +94,6 @@ struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src)
 ********************************************************************/
 NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32_t mask);
 
-/*******************************************************************
- Delete a SID from a struct security_descriptor.
-********************************************************************/
-NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size);
 bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container);
 NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
 					struct security_descriptor **ppsd,
-- 
1.8.4.5



More information about the samba-technical mailing list