diff options
author | Günther Deschner <gd@samba.org> | 2008-03-07 23:39:34 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@bando.sernet.private> | 2008-03-31 14:20:59 +0200 |
commit | ba90d01fedcfc4a7a41cf0c871d4b2a3cd6c95d2 (patch) | |
tree | 26516f875928952f88544cf2339336cb7f8a7fbb /source/rpcclient | |
parent | 1e8b075cfe73357177079289dc7bfc97b628348b (diff) | |
download | samba-ba90d01fedcfc4a7a41cf0c871d4b2a3cd6c95d2.tar.gz samba-ba90d01fedcfc4a7a41cf0c871d4b2a3cd6c95d2.tar.xz samba-ba90d01fedcfc4a7a41cf0c871d4b2a3cd6c95d2.zip |
Add netnamevalidate command to rpcclient.
Guenther
(cherry picked from commit 140885d3d87ea2de14b3393a7384dff74a4dd44c)
Diffstat (limited to 'source/rpcclient')
-rw-r--r-- | source/rpcclient/cmd_srvsvc.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/rpcclient/cmd_srvsvc.c b/source/rpcclient/cmd_srvsvc.c index e480b712375..8c85372bf5a 100644 --- a/source/rpcclient/cmd_srvsvc.c +++ b/source/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 } }; |