summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-10-26 12:58:01 +0200
committerGünther Deschner <gd@samba.org>2007-11-05 03:27:13 +0100
commite83e0f36846ba2b7831a63cb8717432617b337fd (patch)
tree180c081b0a98769cdd651b29854cd33c627bf3bb
parentfc22f295d06f243c86acc6a9ef042417007677e5 (diff)
downloadsamba-e83e0f36846ba2b7831a63cb8717432617b337fd.tar.gz
samba-e83e0f36846ba2b7831a63cb8717432617b337fd.tar.bz2
samba-e83e0f36846ba2b7831a63cb8717432617b337fd.zip
Display sec ace flags.
Guenther (This used to be commit 52bf835c5e9b2fa759c61bf4a7a364eeaeae6043)
-rw-r--r--source3/lib/display_sec.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/source3/lib/display_sec.c b/source3/lib/display_sec.c
index 487ac8f4a0..8e92c84f3c 100644
--- a/source3/lib/display_sec.c
+++ b/source3/lib/display_sec.c
@@ -66,6 +66,31 @@ void display_sec_access(SEC_ACCESS *info)
}
/****************************************************************************
+ display sec_ace flags
+ ****************************************************************************/
+void display_sec_ace_flags(uint8_t flags)
+{
+ if (flags & SEC_ACE_FLAG_OBJECT_INHERIT)
+ printf("SEC_ACE_FLAG_OBJECT_INHERIT ");
+ if (flags & SEC_ACE_FLAG_CONTAINER_INHERIT)
+ printf(" SEC_ACE_FLAG_CONTAINER_INHERIT ");
+ if (flags & SEC_ACE_FLAG_NO_PROPAGATE_INHERIT)
+ printf("SEC_ACE_FLAG_NO_PROPAGATE_INHERIT ");
+ if (flags & SEC_ACE_FLAG_INHERIT_ONLY)
+ printf("SEC_ACE_FLAG_INHERIT_ONLY ");
+ if (flags & SEC_ACE_FLAG_INHERITED_ACE)
+ printf("SEC_ACE_FLAG_INHERITED_ACE ");
+/* if (flags & SEC_ACE_FLAG_VALID_INHERIT)
+ printf("SEC_ACE_FLAG_VALID_INHERIT "); */
+ if (flags & SEC_ACE_FLAG_SUCCESSFUL_ACCESS)
+ printf("SEC_ACE_FLAG_SUCCESSFUL_ACCESS ");
+ if (flags & SEC_ACE_FLAG_FAILED_ACCESS)
+ printf("SEC_ACE_FLAG_FAILED_ACCESS ");
+
+ printf("\n");
+}
+
+/****************************************************************************
display sec_ace object
****************************************************************************/
static void disp_sec_ace_object(struct security_ace_object *object)
@@ -123,7 +148,8 @@ void display_sec_ace(SEC_ACE *ace)
break;
}
- printf(" (%d) flags: %d\n", ace->type, ace->flags);
+ printf(" (%d) flags: 0x%02x ", ace->type, ace->flags);
+ display_sec_ace_flags(ace->flags);
display_sec_access(&ace->access_mask);
sid_to_string(sid_str, &ace->trustee);
printf("\t\tSID: %s\n\n", sid_str);
@@ -145,9 +171,11 @@ void display_sec_acl(SEC_ACL *sec_acl)
sec_acl->num_aces, sec_acl->revision);
printf("\t---\n");
- if (sec_acl->size != 0 && sec_acl->num_aces != 0)
- for (i = 0; i < sec_acl->num_aces; i++)
+ if (sec_acl->size != 0 && sec_acl->num_aces != 0) {
+ for (i = 0; i < sec_acl->num_aces; i++) {
display_sec_ace(&sec_acl->aces[i]);
+ }
+ }
}
void display_acl_type(uint16 type)