[PATCH 04/13] sharesec: remove unused security descriptor print fns

David Disseldorp ddiss at samba.org
Mon May 26 09:29:54 MDT 2014


IDL generated NDR routines are now used, so the old hand rolled
functions can be removed.

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 source3/utils/sharesec.c | 85 ------------------------------------------------
 1 file changed, 85 deletions(-)

diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c
index 969d967..67e3991 100644
--- a/source3/utils/sharesec.c
+++ b/source3/utils/sharesec.c
@@ -68,91 +68,6 @@ static const struct perm_value standard_values[] = {
 };
 
 /********************************************************************
- print an ACE on a FILE
-********************************************************************/
-
-static void print_ace(FILE *f, struct security_ace *ace)
-{
-	const struct perm_value *v;
-	int do_print = 0;
-	uint32 got_mask;
-
-	fprintf(f, "%s:", sid_string_tos(&ace->trustee));
-
-	/* Ace type */
-
-	if (ace->type == SEC_ACE_TYPE_ACCESS_ALLOWED) {
-		fprintf(f, "ALLOWED");
-	} else if (ace->type == SEC_ACE_TYPE_ACCESS_DENIED) {
-		fprintf(f, "DENIED");
-	} else {
-		fprintf(f, "%d", ace->type);
-	}
-
-	/* Not sure what flags can be set in a file ACL */
-
-	fprintf(f, "/%d/", ace->flags);
-
-	/* Standard permissions */
-
-	for (v = standard_values; v->perm; v++) {
-		if (ace->access_mask == v->mask) {
-			fprintf(f, "%s", v->perm);
-			return;
-		}
-	}
-
-	/* Special permissions.  Print out a hex value if we have
-	   leftover bits in the mask. */
-
-	got_mask = ace->access_mask;
-
- again:
-	for (v = special_values; v->perm; v++) {
-		if ((ace->access_mask & v->mask) == v->mask) {
-			if (do_print) {
-				fprintf(f, "%s", v->perm);
-			}
-			got_mask &= ~v->mask;
-		}
-	}
-
-	if (!do_print) {
-		if (got_mask != 0) {
-			fprintf(f, "0x%08x", ace->access_mask);
-		} else {
-			do_print = 1;
-			goto again;
-		}
-	}
-}
-
-/********************************************************************
- print an ascii version of a security descriptor on a FILE handle
-********************************************************************/
-
-static void sec_desc_print(FILE *f, struct security_descriptor *sd)
-{
-	uint32 i;
-
-	fprintf(f, "REVISION:%d\n", sd->revision);
-
-	/* Print owner and group sid */
-
-	fprintf(f, "OWNER:%s\n", sid_string_tos(sd->owner_sid));
-
-	fprintf(f, "GROUP:%s\n", sid_string_tos(sd->group_sid));
-
-	/* Print aces */
-	for (i = 0; sd->dacl && i < sd->dacl->num_aces; i++) {
-		struct security_ace *ace = &sd->dacl->aces[i];
-		fprintf(f, "ACL:");
-		print_ace(f, ace);
-		fprintf(f, "\n");
-	}
-}
-
-/********************************************************************
  parse an ACE in the same format as print_ace()
 ********************************************************************/
 
-- 
1.8.4.5



More information about the samba-technical mailing list