diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-02-22 06:22:20 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-02-22 06:22:20 +0000 |
commit | 4e1de143b38e2fb64dd3c7d4030e939b53c8db0f (patch) | |
tree | 8136446ca891788b3376749594894c95c7980fe9 | |
parent | 9ccbc1de06fa240db716c5e497853b7f31f1225f (diff) | |
download | samba-4e1de143b38e2fb64dd3c7d4030e939b53c8db0f.tar.gz samba-4e1de143b38e2fb64dd3c7d4030e939b53c8db0f.tar.bz2 samba-4e1de143b38e2fb64dd3c7d4030e939b53c8db0f.zip |
- workaround filer lsa lookup bug for unknown sids
- add \ at start of name if not needed (another filer workaround)
(This used to be commit 48ab6297a1b462e03f70a4d90d50b21982d0d90d)
-rw-r--r-- | source3/utils/smbcacls.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 0aa2c4399d..bef16d349c 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -118,7 +118,8 @@ static void SidToString(fstring str, DOM_SID *sid) if (!open_policy_hnd() || cli_lsa_lookup_sids(&lsa_cli, &pol, 1, sid, &names, &types, - &num_names) != NT_STATUS_NOPROBLEMO) { + &num_names) != NT_STATUS_NOPROBLEMO || + !names || !names[0]) { return; } @@ -834,7 +835,7 @@ You can string acls together with spaces, commas or newlines\n\ int main(int argc,char *argv[]) { char *share; - char *filename; + pstring filename; extern char *optarg; extern int optind; extern FILE *dbf; @@ -860,7 +861,7 @@ You can string acls together with spaces, commas or newlines\n\ setup_logging(argv[0],True); share = argv[1]; - filename = argv[2]; + pstrcpy(filename, argv[2]); all_string_sub(share,"/","\\",0); argc -= 2; @@ -962,14 +963,12 @@ You can string acls together with spaces, commas or newlines\n\ if (!cli) exit(EXIT_FAILED); } - { - char *s; - - s = filename; - while(*s) { - if (*s == '/') *s = '\\'; - s++; - } + all_string_sub(filename, "/", "\\", 0); + if (filename[0] != '\\') { + pstring s; + s[0] = '\\'; + safe_strcpy(&s[1], filename, sizeof(pstring)-1); + pstrcpy(filename, s); } /* Perform requested action */ |