summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-07 23:39:34 +0100
committerGünther Deschner <gd@samba.org>2008-03-07 23:51:34 +0100
commit5e6e3ccd00b715f912523d128cad05041366b3ce (patch)
tree16469bba17f4b31801ed3063babbb19144a86c23 /source3/rpcclient
parentea0b148a964e32541b19b788a4a2d6e469ac03dd (diff)
downloadsamba-5e6e3ccd00b715f912523d128cad05041366b3ce.tar.gz
samba-5e6e3ccd00b715f912523d128cad05041366b3ce.tar.bz2
samba-5e6e3ccd00b715f912523d128cad05041366b3ce.zip
Add netnamevalidate command to rpcclient.
Guenther (This used to be commit 140885d3d87ea2de14b3393a7384dff74a4dd44c)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_srvsvc.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index e480b71237..8c85372bf5 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -572,6 +572,39 @@ static WERROR cmd_srvsvc_net_file_enum(struct rpc_pipe_client *cli,
return result;
}
+static WERROR cmd_srvsvc_net_name_validate(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ WERROR result;
+ NTSTATUS status;
+ uint32_t name_type = 9;
+ uint32_t flags = 0;
+
+ if (argc < 2 || argc > 3) {
+ printf("Usage: %s [sharename] [type]\n", argv[0]);
+ return WERR_OK;
+ }
+
+ if (argc == 3) {
+ name_type = atoi(argv[2]);
+ }
+
+ status = rpccli_srvsvc_NetNameValidate(cli, mem_ctx,
+ cli->cli->desthost,
+ argv[1],
+ name_type,
+ flags,
+ &result);
+
+ if (!W_ERROR_IS_OK(result))
+ goto done;
+
+ done:
+ return result;
+}
+
+
/* List of commands exported by this module */
struct cmd_set srvsvc_commands[] = {
@@ -585,6 +618,7 @@ struct cmd_set srvsvc_commands[] = {
{ "netsharesetinfo",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_set_info, PI_SRVSVC, NULL, "Set Share Info", "" },
{ "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", "" },
{ NULL }
};