diff options
author | Kai Blin <kai@samba.org> | 2008-05-21 10:31:14 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2008-06-10 09:47:34 +0200 |
commit | 238c7d0be3a26e27c184ad5666438b77ddc68771 (patch) | |
tree | a05a16183507cb75c0e090f39b4e4a088a7c58d1 | |
parent | c51ca559c1f0f243a7dd56d138aff6a86f31738d (diff) | |
download | samba-238c7d0be3a26e27c184ad5666438b77ddc68771.tar.gz samba-238c7d0be3a26e27c184ad5666438b77ddc68771.tar.bz2 samba-238c7d0be3a26e27c184ad5666438b77ddc68771.zip |
net: Make "net rpc audit" use functable3
(This used to be commit c47ff2bff6d97a5e7654849965253928a825fe6a)
-rw-r--r-- | source3/utils/net_rpc_audit.c | 89 |
1 files changed, 78 insertions, 11 deletions
diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index 4ba986464e..74e7cc5f0b 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -366,6 +366,13 @@ static NTSTATUS rpc_audit_list_internal(struct net_context *c, static int rpc_audit_get(struct net_context *c, int argc, const char **argv) { + if (c->display_usage) { + d_printf("Usage:\n" + "net rpc audit get\n" + " View configured audit setting\n"); + return 0; + } + return run_rpc_command(c, NULL, PI_LSARPC, 0, rpc_audit_get_internal, argc, argv); } @@ -375,6 +382,13 @@ static int rpc_audit_get(struct net_context *c, int argc, const char **argv) static int rpc_audit_set(struct net_context *c, int argc, const char **argv) { + if (c->display_usage) { + d_printf("Usage:\n" + "net rpc audit set\n" + " Set audit policies\n"); + return 0; + } + return run_rpc_command(c, NULL, PI_LSARPC, 0, rpc_audit_set_internal, argc, argv); } @@ -384,6 +398,13 @@ static int rpc_audit_set(struct net_context *c, int argc, const char **argv) static int rpc_audit_enable(struct net_context *c, int argc, const char **argv) { + if (c->display_usage) { + d_printf("Usage:\n" + "net rpc audit enable\n" + " Enable auditing\n"); + return 0; + } + return run_rpc_command(c, NULL, PI_LSARPC, 0, rpc_audit_enable_internal, argc, argv); } @@ -393,6 +414,13 @@ static int rpc_audit_enable(struct net_context *c, int argc, const char **argv) static int rpc_audit_disable(struct net_context *c, int argc, const char **argv) { + if (c->display_usage) { + d_printf("Usage:\n" + "net rpc audit disable\n" + " Disable auditing\n"); + return 0; + } + return run_rpc_command(c, NULL, PI_LSARPC, 0, rpc_audit_disable_internal, argc, argv); } @@ -402,6 +430,13 @@ static int rpc_audit_disable(struct net_context *c, int argc, const char **argv) static int rpc_audit_list(struct net_context *c, int argc, const char **argv) { + if (c->display_usage) { + d_printf("Usage:\n" + "net rpc audit list\n" + " List auditing settings\n"); + return 0; + } + return run_rpc_command(c, NULL, PI_LSARPC, 0, rpc_audit_list_internal, argc, argv); } @@ -411,17 +446,49 @@ static int rpc_audit_list(struct net_context *c, int argc, const char **argv) int net_rpc_audit(struct net_context *c, int argc, const char **argv) { - struct functable func[] = { - {"get", rpc_audit_get}, - {"set", rpc_audit_set}, - {"enable", rpc_audit_enable}, - {"disable", rpc_audit_disable}, - {"list", rpc_audit_list}, - {NULL, NULL} + struct functable3 func[] = { + { + "get", + rpc_audit_get, + NET_TRANSPORT_RPC, + "View configured auditing settings", + "net rpc audit get\n" + " View configured auditing settings" + }, + { + "set", + rpc_audit_set, + NET_TRANSPORT_RPC, + "Set auditing policies", + "net rpc audit set\n" + " Set auditing policies" + }, + { + "enable", + rpc_audit_enable, + NET_TRANSPORT_RPC, + "Enable auditing", + "net rpc audit enable\n" + " Enable auditing" + }, + { + "disable", + rpc_audit_disable, + NET_TRANSPORT_RPC, + "Disable auditing", + "net rpc audit disable\n" + " Disable auditing" + }, + { + "list", + rpc_audit_list, + NET_TRANSPORT_RPC, + "List configured auditing settings", + "net rpc audit list\n" + " List configured auditing settings" + }, + {NULL, NULL, 0, NULL, NULL} }; - if (argc) - return net_run_function(c, argc, argv, func, net_help_audit); - - return net_help_audit(c, argc, argv); + return net_run_function3(c, argc, argv, "net rpc audit", func); } |