summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorWilco Baan Hofman <wilco@baanhofman.nl>2010-04-28 11:34:31 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-20 17:19:11 +0200
commit2941d2ebc353f16b6eb63985a8a71f454f16212e (patch)
treed71580dc36004c22712ce47f06079f98adf9d317 /source4/utils
parent2b761c3defdadb2566a23ce58e62b9571c02ed25 (diff)
downloadsamba-2941d2ebc353f16b6eb63985a8a71f454f16212e.tar.gz
samba-2941d2ebc353f16b6eb63985a8a71f454f16212e.tar.bz2
samba-2941d2ebc353f16b6eb63985a8a71f454f16212e.zip
Finish net gpo fetch function. Reorder arguments to make them more understandable. Rename getgpo to show.
This makes the net gpo break for it's samba 3 origins, but makes the syntax more intuitive. Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/net/net_gpo.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source4/utils/net/net_gpo.c b/source4/utils/net/net_gpo.c
index 386c48662a..a990098ed9 100644
--- a/source4/utils/net/net_gpo.c
+++ b/source4/utils/net/net_gpo.c
@@ -81,8 +81,8 @@ static int net_gpo_list_all(struct net_context *ctx, int argc, const char **argv
static int net_gpo_get_gpo_usage(struct net_context *ctx, int argc, const char **argv)
{
- d_printf("Syntax: net gpo getgpo <dn> [options]\n");
- d_printf("For a list of available options, please type net gpo getgpo --help\n");
+ d_printf("Syntax: net gpo show <dn> [options]\n");
+ d_printf("For a list of available options, please type net gpo show --help\n");
return 0;
}
@@ -440,6 +440,13 @@ static int net_gpo_inheritance_set(struct net_context *ctx, int argc, const char
return 0;
}
+static int net_gpo_fetch_usage(struct net_context *ctx, int argc, const char **argv)
+{
+ d_printf("Syntax: net gpo fetch <container> [options]\n");
+ d_printf("For a list of available options, please type net gpo fetch --help\n");
+ return 0;
+}
+
static int net_gpo_fetch(struct net_context *ctx, int argc, const char **argv)
{
struct gp_context *gp_ctx;
@@ -447,6 +454,10 @@ static int net_gpo_fetch(struct net_context *ctx, int argc, const char **argv)
const char *path;
NTSTATUS rv;
+ if (argc != 1) {
+ return net_gpo_fetch_usage(ctx, argc, argv);
+ }
+
rv = gp_init(ctx, ctx->lp_ctx, ctx->credentials, ctx->event_ctx, &gp_ctx);
if (!NT_STATUS_IS_OK(rv)) {
DEBUG(0, ("Failed to connect to DC's LDAP: %s\n", get_friendly_nt_error_msg(rv)));
@@ -471,16 +482,14 @@ static int net_gpo_fetch(struct net_context *ctx, int argc, const char **argv)
static const struct net_functable net_gpo_functable[] = {
{ "listall", "List all GPO's on a DC\n", net_gpo_list_all, net_gpo_list_all_usage },
- { "getgpo", "List specificied GPO\n", net_gpo_get_gpo, net_gpo_get_gpo_usage },
+ { "list", "List all active GPO's for a machine/user\n", net_gpo_list, net_gpo_list_usage },
+ { "show", "Show information for a GPO\n", net_gpo_get_gpo, net_gpo_get_gpo_usage },
{ "getlink", "List gPLink of container\n", net_gpo_link_get, net_gpo_link_get_usage },
{ "setlink", "Link a GPO to a container\n", net_gpo_link_set, net_gpo_link_set_usage },
{ "dellink", "Delete GPO link from a container\n", net_gpo_link_del, net_gpo_link_del_usage },
{ "getinheritance", "Get inheritance flag from a container\n", net_gpo_inheritance_get, net_gpo_inheritance_get_usage },
{ "setinheritance", "Set inheritance flag on a container\n", net_gpo_inheritance_set, net_gpo_inheritance_set_usage },
- { "list", "List all GPO's for a machine/user\n", net_gpo_list, net_gpo_list_usage },
- { "fetch", "Download a GPO\n", net_gpo_fetch, net_gpo_usage },
-/* { "apply", "Apply GPO to container\n", net_gpo_apply, net_gpo_usage }, */
-// { "refresh", "List all GPO's for machine/user and download them\n", net_gpo_refresh, net_gpo_refresh_usage },
+ { "fetch", "Download a GPO\n", net_gpo_fetch, net_gpo_fetch_usage },
{ NULL, NULL }
};