From 77a16bf5046e6026cc8ed8b96c15623c84a17ef7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 15 Oct 2010 12:10:02 +1100 Subject: s4-net: fix the dependence on command line ordering this fixes python net commands where you use a '-' option before the command name Pair-Programmed-With: Andrew Bartlett --- source4/utils/net/net.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c index acace9eeed..46cc07d702 100644 --- a/source4/utils/net/net.c +++ b/source4/utils/net/net.c @@ -156,7 +156,7 @@ int net_run_function(struct net_context *ctx, return functable[i].fn(ctx, argc-1, argv+1); } - d_printf("No command: %s\n", argv[0]); + d_printf("No command: '%s'\n", argv[0]); return usage_fn(ctx, argc, argv); } @@ -317,13 +317,15 @@ static int binary_net(int argc, const char **argv) return 1; } - if (argc > 1) { - py_cmd = PyDict_GetItemString(py_cmds, argv[1]); - if (py_cmd != NULL) { - rc = py_call_with_string_args(py_cmd, "_run", - argc-1, argv+1); - talloc_free(ev); - return rc; + for (i=1; i