testprogs: print SDDL string of printer security descriptors
authorGünther Deschner <gd@samba.org>
Tue, 16 Feb 2010 15:21:02 +0000 (16:21 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 18 Feb 2010 01:18:59 +0000 (02:18 +0100)
testprogs/win32/spoolss/printlib.c

index a41a5c1c9041cd06b934dfe5ce4ba37329979227..c1eaeebe14e846bc20060a38f129293fe84e2a52 100644 (file)
@@ -152,15 +152,25 @@ void print_sid(LPSTR str, PSID sid)
 
 void print_secdesc(SECURITY_DESCRIPTOR *secdesc)
 {
+       LPSTR sd_string;
+
        if (secdesc == NULL) {
                printf("\tSecurity Descriptor\t= (null)\n");
                return;
        }
 
+       if (!ConvertSecurityDescriptorToStringSecurityDescriptor(secdesc, 1, 7, &sd_string, NULL)) {
+               PrintLastError();
+               return;
+       }
+
+       printf("%s\n", sd_string);
+       LocalFree(sd_string);
+
+#if 0
        printf("\tRevision\t= 0x%x\n", secdesc->Revision);
        printf("\tSbz1\t\t= 0x%x\n", secdesc->Sbz1);
        printf("\tControl\t\t= 0x%x\n", secdesc->Control);
-#if 0
        print_sid("\tOwner\t\t= ", secdesc->Owner);
        print_sid("\tGroup\t\t= ",secdesc->Group);
        print_acl("\tSacl\t\t= ", secdesc->Sacl);