From 6d9adfe73c04132ff162d05b0c309395c4a54485 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 30 Nov 2001 01:04:15 +0000 Subject: Renamed sid field in SEC_ACE to trustee to be more in line with MS's definitions. (This used to be commit 9712d3f15a47155f558d0034ef71fd06afb11301) --- source3/utils/smbcacls.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 670e1f6efe..8a3f3978e5 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -163,7 +163,7 @@ static void print_ace(FILE *f, SEC_ACE *ace) int do_print = 0; uint32 got_mask; - SidToString(sidstr, &ace->sid); + SidToString(sidstr, &ace->trustee); fprintf(f, "%s:", sidstr); @@ -525,12 +525,24 @@ static int owner_set(struct cli_state *cli, enum chown_mode change_mode, static int ace_compare(SEC_ACE *ace1, SEC_ACE *ace2) { - if (sec_ace_equal(ace1, ace2)) return 0; - if (ace1->type != ace2->type) return ace2->type - ace1->type; - if (sid_compare(&ace1->sid, &ace2->sid)) return sid_compare(&ace1->sid, &ace2->sid); - if (ace1->flags != ace2->flags) return ace1->flags - ace2->flags; - if (ace1->info.mask != ace2->info.mask) return ace1->info.mask - ace2->info.mask; - if (ace1->size != ace2->size) return ace1->size - ace2->size; + if (sec_ace_equal(ace1, ace2)) + return 0; + + if (ace1->type != ace2->type) + return ace2->type - ace1->type; + + if (sid_compare(&ace1->trustee, &ace2->trustee)) + return sid_compare(&ace1->trustee, &ace2->trustee); + + if (ace1->flags != ace2->flags) + return ace1->flags - ace2->flags; + + if (ace1->info.mask != ace2->info.mask) + return ace1->info.mask - ace2->info.mask; + + if (ace1->size != ace2->size) + return ace1->size - ace2->size; + return memcmp(ace1, ace2, sizeof(SEC_ACE)); } @@ -627,8 +639,8 @@ static int cacl_set(struct cli_state *cli, char *filename, BOOL found = False; for (j=0;old->dacl && jdacl->num_aces;j++) { - if (sid_equal(&sd->dacl->ace[i].sid, - &old->dacl->ace[j].sid)) { + if (sid_equal(&sd->dacl->ace[i].trustee, + &old->dacl->ace[j].trustee)) { old->dacl->ace[j] = sd->dacl->ace[i]; found = True; } @@ -637,7 +649,7 @@ static int cacl_set(struct cli_state *cli, char *filename, if (!found) { fstring str; - SidToString(str, &sd->dacl->ace[i].sid); + SidToString(str, &sd->dacl->ace[i].trustee); printf("ACL for SID %s not found\n", str); } } -- cgit