diff options
author | David Disseldorp <ddiss@samba.org> | 2014-05-26 14:38:24 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-05-28 17:52:13 +0200 |
commit | 4a9d64e37a72cd1384c1e8db54532b8e850715cd (patch) | |
tree | 031cd8024152b507d412026efbb860cea4b395cd /source3/utils | |
parent | e3e01de345ec2ef65417769527a1fffee5df353c (diff) | |
download | samba-4a9d64e37a72cd1384c1e8db54532b8e850715cd.tar.gz samba-4a9d64e37a72cd1384c1e8db54532b8e850715cd.tar.xz samba-4a9d64e37a72cd1384c1e8db54532b8e850715cd.zip |
sharesec: use NDR security descriptor print fns
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/sharesec.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 2b1e435cdb..969d9674f3 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -25,6 +25,7 @@ #include "includes.h" #include "popt_common.h" #include "../libcli/security/security.h" +#include "../librpc/gen_ndr/ndr_security.h" #include "passdb/machine_sid.h" static TALLOC_CTX *ctx; @@ -417,6 +418,7 @@ static int change_share_sec(TALLOC_CTX *mem_ctx, const char *sharename, char *th struct security_descriptor *old = NULL; size_t sd_size = 0; uint32 i, j; + char *sd_str; if (mode != SMB_ACL_SET && mode != SMB_SD_DELETE) { if (!(old = get_share_security( mem_ctx, sharename, &sd_size )) ) { @@ -437,7 +439,11 @@ static int change_share_sec(TALLOC_CTX *mem_ctx, const char *sharename, char *th /* should not happen */ return 0; case SMB_ACL_VIEW: - sec_desc_print( stdout, old); + sd_str = ndr_print_struct_string(mem_ctx, + (ndr_print_fn_t)ndr_print_security_descriptor, + "", old); + fprintf(stdout, "%s\n", sd_str); + talloc_free(sd_str); return 0; case SMB_ACL_DELETE: for (i=0;sd->dacl && i<sd->dacl->num_aces;i++) { @@ -456,9 +462,11 @@ static int change_share_sec(TALLOC_CTX *mem_ctx, const char *sharename, char *th } if (!found) { - printf("ACL for ACE:"); - print_ace(stdout, &sd->dacl->aces[i]); - printf(" not found\n"); + sd_str = ndr_print_struct_string(mem_ctx, + (ndr_print_fn_t)ndr_print_security_ace, + "", &sd->dacl->aces[i]); + printf("ACL for ACE: %s not found\n", sd_str); + talloc_free(sd_str); } } break; |