diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/smbcacls.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index f6b2ba65aa..bb7746e6b0 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -894,25 +894,29 @@ dump the acls for a file *******************************************************/ static int cacl_dump(struct cli_state *cli, const char *filename) { - int result = EXIT_FAILED; struct security_descriptor *sd; - if (test_args) + if (test_args) { return EXIT_OK; + } sd = get_secdesc(cli, filename); + if (sd == NULL) { + return EXIT_FAILED; + } - if (sd) { - if (sddl) { - printf("%s\n", sddl_encode(talloc_tos(), sd, - get_domain_sid(cli))); - } else { - sec_desc_print(cli, stdout, sd); + if (sddl) { + char *str = sddl_encode(talloc_tos(), sd, get_domain_sid(cli)); + if (str == NULL) { + return EXIT_FAILED; } - result = EXIT_OK; + printf("%s\n", str); + TALLOC_FREE(str); + } else { + sec_desc_print(cli, stdout, sd); } - return result; + return EXIT_OK; } /***************************************************** |