summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-08 23:00:09 +0100
committerGünther Deschner <gd@samba.org>2008-03-08 23:05:54 +0100
commit62ca78bd27a015681ee22676c88d0fad4d1d7ced (patch)
treedf697931ed6e34c6651f0966ded1d1995927a9a7 /source3/rpcclient
parent1a3cad6e6d5a4c1e6db008cfa47f137e50a7469e (diff)
downloadsamba-62ca78bd27a015681ee22676c88d0fad4d1d7ced.tar.gz
samba-62ca78bd27a015681ee22676c88d0fad4d1d7ced.tar.bz2
samba-62ca78bd27a015681ee22676c88d0fad4d1d7ced.zip
Add netfilegetsec command to rpcclient.
Guenther (This used to be commit 8c2c17573c179c774d093d780716e95833cb992f)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_srvsvc.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index 8c85372bf5..25a33baa27 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -604,6 +604,36 @@ static WERROR cmd_srvsvc_net_name_validate(struct rpc_pipe_client *cli,
return result;
}
+static WERROR cmd_srvsvc_net_file_get_sec(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ WERROR result;
+ NTSTATUS status;
+ struct sec_desc_buf *sd_buf = NULL;
+
+ if (argc < 2 || argc > 4) {
+ printf("Usage: %s [sharename] [file]\n", argv[0]);
+ return WERR_OK;
+ }
+
+ status = rpccli_srvsvc_NetGetFileSecurity(cli, mem_ctx,
+ cli->cli->desthost,
+ argv[1],
+ argv[2],
+ SECINFO_DACL,
+ &sd_buf,
+ &result);
+
+ if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(result)) {
+ goto done;
+ }
+
+ display_sec_desc(sd_buf->sd);
+
+ done:
+ return result;
+}
/* List of commands exported by this module */
@@ -619,6 +649,7 @@ struct cmd_set srvsvc_commands[] = {
{ "netfileenum", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_file_enum, PI_SRVSVC, NULL, "Enumerate open files", "" },
{ "netremotetod",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_remote_tod, PI_SRVSVC, NULL, "Fetch remote time of day", "" },
{ "netnamevalidate", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_name_validate, PI_SRVSVC, NULL, "Validate sharename", "" },
+ { "netfilegetsec", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_file_get_sec, PI_SRVSVC, NULL, "Get File security", "" },
{ NULL }
};