diff options
author | Tim Potter <tpot@samba.org> | 2001-05-24 08:10:50 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-05-24 08:10:50 +0000 |
commit | 43bc613e74f06d4e6169c359149db72c9f925039 (patch) | |
tree | 8c3cff5e0fdc5210ab16c204d0b3dd4427756fc3 /source3/rpcclient/cmd_netlogon.c | |
parent | 95dbe55e5708df0e3fd372d46a6bf83805a21120 (diff) | |
download | samba-43bc613e74f06d4e6169c359149db72c9f925039.tar.gz samba-43bc613e74f06d4e6169c359149db72c9f925039.tar.bz2 samba-43bc613e74f06d4e6169c359149db72c9f925039.zip |
Added srvinfo and partial logonctrl and logonctrl2 commands.
(This used to be commit c93718daa1375269e4e0ef52016271b7a607e292)
Diffstat (limited to 'source3/rpcclient/cmd_netlogon.c')
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 697cf26be1..184771a7ad 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -24,9 +24,83 @@ extern int DEBUGLEVEL; +static uint32 cmd_netlogon_logon_ctrl2(struct cli_state *cli, int argc, + char **argv) +{ + uint32 query_level = 1; + TALLOC_CTX *mem_ctx; + uint32 result = NT_STATUS_UNSUCCESSFUL; + + if (argc > 1) { + printf("Usage: %s\n", argv[0]); + return 0; + } + + if (!(mem_ctx = talloc_init())) { + DEBUG(0,("cmd_srvsvc_srv_query_info: talloc_init failed\n")); + goto done; + } + + /* Initialise RPC connection */ + + if (!cli_nt_session_open (cli, PIPE_NETLOGON)) { + DEBUG(0, ("Could not initialize srvsvc pipe!\n")); + goto done; + } + + if ((result = cli_netlogon_logon_ctrl2(cli, mem_ctx, query_level)) + != NT_STATUS_NOPROBLEMO) { + goto done; + } + + /* Display results */ + + done: + return result; +} + +static uint32 cmd_netlogon_logon_ctrl(struct cli_state *cli, int argc, + char **argv) +{ + uint32 query_level = 1; + TALLOC_CTX *mem_ctx; + uint32 result = NT_STATUS_UNSUCCESSFUL; + + if (argc > 1) { + printf("Usage: %s\n", argv[0]); + return 0; + } + + if (!(mem_ctx = talloc_init())) { + DEBUG(0,("cmd_srvsvc_srv_query_info: talloc_init failed\n")); + goto done; + } + + /* Initialise RPC connection */ + + if (!cli_nt_session_open (cli, PIPE_NETLOGON)) { + DEBUG(0, ("Could not initialize srvsvc pipe!\n")); + goto done; + } + +#if 0 + if ((result = cli_netlogon_logon_ctrl(cli, mem_ctx, query_level)) + != NT_STATUS_NOPROBLEMO) { + goto done; + } +#endif + + /* Display results */ + + done: + return result; +} + /* List of commands exported by this module */ struct cmd_set netlogon_commands[] = { - { "NETLOGON", NULL, "" }, + { "NETLOGON", NULL, "" }, + { "logonctrl2", cmd_netlogon_logon_ctrl2, "Logon Control 2" }, + { "logonctrl", cmd_netlogon_logon_ctrl, "Logon Control" }, { NULL, NULL, NULL } }; |