diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/netcmd/__init__.py | 3 | ||||
-rw-r--r-- | source4/utils/net/net.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py index cb8fa01fe1..1a04210f95 100644 --- a/source4/scripting/python/samba/netcmd/__init__.py +++ b/source4/scripting/python/samba/netcmd/__init__.py @@ -75,12 +75,13 @@ class Command(object): parser, optiongroups = self._create_parser() opts, args = parser.parse_args(list(argv)) # Filter out options from option groups + args = args[1:] kwargs = dict(opts.__dict__) for option_group in parser.option_groups: for option in option_group.option_list: del kwargs[option.dest] kwargs.update(optiongroups) - if len(args) < len(self.takes_args): + if len(args) != len(self.takes_args): self.usage(args) return -1 try: diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c index 7b8f092f93..f761ef4050 100644 --- a/source4/utils/net/net.c +++ b/source4/utils/net/net.c @@ -346,10 +346,10 @@ static int binary_net(int argc, const char **argv) return 1; } - py_cmd = PyDict_GetItemString(py_cmds, argv[1]); + py_cmd = PyDict_GetItemString(py_cmds, argv_new[1]); if (py_cmd != NULL) { rc = py_call_with_string_args(py_cmd, "_run", - argc-2, argv+2); + argc-1, argv+1); talloc_free(ev); return rc; } |