summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-02-28 22:20:03 +0100
committerMichael Adam <obnox@samba.org>2010-03-03 09:16:35 +0100
commit9cea4d5969d3061689e7399e0a97f7f83ed31976 (patch)
tree8518c357a8eeb915d2af7cf437a33b96409fef0e
parent6fa767fbb24b7f18c9ead96f08a862f5178319d1 (diff)
downloadsamba-9cea4d5969d3061689e7399e0a97f7f83ed31976.tar.gz
samba-9cea4d5969d3061689e7399e0a97f7f83ed31976.tar.bz2
samba-9cea4d5969d3061689e7399e0a97f7f83ed31976.zip
s3:smbcacls: add switch "--sddl" to output acls as sddl encoded strings
-rw-r--r--source3/utils/smbcacls.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 5fd18ff58c..122e641a01 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -33,6 +33,8 @@ static int test_args;
than going via LSA calls to resolve them */
static int numeric;
+static int sddl;
+
enum acl_mode {SMB_ACL_SET, SMB_ACL_DELETE, SMB_ACL_MODIFY, SMB_ACL_ADD };
enum chown_mode {REQUEST_NONE, REQUEST_CHOWN, REQUEST_CHGRP};
enum exit_values {EXIT_OK, EXIT_FAILED, EXIT_PARSE_ERROR};
@@ -681,7 +683,12 @@ static int cacl_dump(struct cli_state *cli, char *filename)
goto done;
}
- sec_desc_print(cli, stdout, sd);
+ if (sddl) {
+ printf("%s\n", sddl_encode(talloc_tos(), sd,
+ get_global_sam_sid()));
+ } else {
+ sec_desc_print(cli, stdout, sd);
+ }
result = EXIT_OK;
@@ -1024,6 +1031,7 @@ static struct cli_state *connect_one(struct user_auth_info *auth_info,
{ "chown", 'C', POPT_ARG_STRING, NULL, 'C', "Change ownership of a file", "USERNAME" },
{ "chgrp", 'G', POPT_ARG_STRING, NULL, 'G', "Change group ownership of a file", "GROUPNAME" },
{ "numeric", 0, POPT_ARG_NONE, &numeric, 1, "Don't resolve sids or masks to names" },
+ { "sddl", 0, POPT_ARG_NONE, &sddl, 1, "Output acls in sddl format" },
{ "test-args", 't', POPT_ARG_NONE, &test_args, 1, "Test arguments"},
POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION