From 92abcbc04005181262a866dc1e1322ee0f0c813a Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 4 Dec 2000 06:43:36 +0000 Subject: Removed lsa lookup warnings (I'll remember). Print an error if -M refers to a non-existent ACL. (This used to be commit ee6f5a9672795c884cabe80e98e5b0fb3c793539) --- source3/utils/smbcacls.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'source3/utils/smbcacls.c') diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 52a5ea769c..5f750c358e 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -62,7 +62,9 @@ static void SidToString(fstring str, DOM_SID *sid) if (numeric) { sid_to_string(str, sid); } else { - printf("need to add LSA lookups\n"); + + /* Need to add LSA lookups */ + sid_to_string(str, sid); } } @@ -73,8 +75,10 @@ static BOOL StringToSid(DOM_SID *sid, fstring str) if (strncmp(str,"S-", 2) == 0) { return string_to_sid(sid, str); } else { - printf("need to add LSA lookups\n"); - return False; + + /* Need to add LSA lookups */ + + return string_to_sid(sid, str); } } @@ -347,13 +351,24 @@ static void cacl_set(struct cli_state *cli, char *filename, case ACL_MODIFY: for (i=0;sd->dacl && idacl->num_aces;i++) { + 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)) { old->dacl->ace[j] = sd->dacl->ace[i]; + found = True; } } + + if (!found) { + fstring str; + + SidToString(str, &sd->dacl->ace[i].sid); + printf("ACL for SID %s not found\n", str); + } } + break; case ACL_ADD: @@ -485,7 +500,7 @@ static void usage(void) \t-n don't resolve sids or masks to names\n\ \t-h print help\n\ \n\ -An acl is of the form SID:type/flags/mask\n\ +An acl is of the form ACL::type/flags/mask\n\ You can string acls together with spaces, commas or newlines\n\ "); } -- cgit