-/*
- Samba Unix/Linux SMB client library
- Distributed SMB/CIFS Server Management Utility
+/*
+ Samba Unix/Linux SMB client library
+ Distributed SMB/CIFS Server Management Utility
Copyright (C) 2001 Steve French (sfrench@us.ibm.com)
Copyright (C) 2001 Jim McDonough (jmcd@us.ibm.com)
Copyright (C) 2001 Andrew Tridgell (tridge@samba.org)
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+
/*****************************************************/
/* */
/* Distributed SMB/CIFS Server Management Utility */
#include <Python.h>
#include "includes.h"
-#include "utils/net/net.h"
+#include "samba_tool/samba_tool.h"
#include "lib/cmdline/popt_common.h"
#include "lib/ldb/include/ldb.h"
#include "librpc/rpc/dcerpc.h"
#include "lib/events/events.h"
#include "auth/credentials/credentials.h"
#include "scripting/python/modules.h"
-#include "utils/net/drs/net_drs.h"
+#include "samba_tool/drs/drs.h"
/* There's no Py_ssize_t in 2.4, apparently */
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5
if (py_method == NULL) {
PyErr_Print();
return 1;
- }
+ }
ret = PyObject_CallObject(py_method, args);
if (netcmd_module == NULL) {
PyErr_Print();
return NULL;
- }
+ }
py_cmds = PyObject_GetAttrString(netcmd_module, "commands");
if (py_cmds == NULL) {
/*
run a function from a function table. If not found then
- call the specified usage function
+ call the specified usage function
*/
int net_run_function(struct net_context *ctx,
int argc, const char **argv,
- const struct net_functable *functable,
+ const struct net_functable *functable,
int (*usage_fn)(struct net_context *ctx, int argc, const char **argv))
{
int i;
py_cmd = PyDict_GetItemString(py_cmds, argv[0]);
if (py_cmd != NULL) {
- return py_call_with_string_args(py_cmd, "usage", argc-1,
+ return py_call_with_string_args(py_cmd, "usage", argc-1,
argv+1);
}
return 1;
}
if (!PyString_Check(py_desc)) {
- d_printf("Command description for %s not a string\n",
+ d_printf("Command description for %s not a string\n",
name);
return 1;
}
static int net_usage(struct net_context *ctx, int argc, const char **argv)
{
d_printf("Usage:\n");
- d_printf("net <command> [options]\n");
+ d_printf("samba-tool <command> [options]\n");
net_help(ctx, net_functable);
return -1;
}
}
}
- pc = poptGetContext("net", argc, (const char **) argv, long_options,
+ pc = poptGetContext("net", argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
- d_printf("Invalid option %s: %s\n",
+ d_printf("Invalid option %s: %s\n",
poptBadOption(pc, 0), poptStrerror(opt));
net_usage(ctx, argc, argv);
exit(1);