summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb-samba/pyldb.c6
-rw-r--r--source4/libnet/py_net.c6
-rw-r--r--source4/scripting/python/samba/netcmd/export.py4
3 files changed, 10 insertions, 6 deletions
diff --git a/source4/lib/ldb-samba/pyldb.c b/source4/lib/ldb-samba/pyldb.c
index 084afb7603..2b7b23739e 100644
--- a/source4/lib/ldb-samba/pyldb.c
+++ b/source4/lib/ldb-samba/pyldb.c
@@ -54,14 +54,14 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O", &py_lp_ctx))
return NULL;
- lp_ctx = lp_from_py_object(py_lp_ctx);
+ ldb = PyLdb_AsLdbContext(self);
+
+ lp_ctx = lp_from_py_object(ldb, py_lp_ctx);
if (lp_ctx == NULL) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
return NULL;
}
- ldb = PyLdb_AsLdbContext(self);
-
ldb_set_opaque(ldb, "loadparm", lp_ctx);
Py_RETURN_NONE;
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index 71e7cd87d6..569f3955bb 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -1,7 +1,7 @@
/*
Unix SMB/CIFS implementation.
Samba utility functions
- Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
+ Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008-2010
Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
This program is free software; you can redistribute it and/or modify
@@ -215,6 +215,10 @@ PyTypeObject py_net_Type = {
void initnet(void)
{
PyObject *m;
+
+ if (PyType_Ready(&py_net_Type) < 0)
+ return;
+
m = Py_InitModule3("net", NULL, NULL);
if (m == NULL)
return;
diff --git a/source4/scripting/python/samba/netcmd/export.py b/source4/scripting/python/samba/netcmd/export.py
index 8e5fd2b6e2..90b83689dd 100644
--- a/source4/scripting/python/samba/netcmd/export.py
+++ b/source4/scripting/python/samba/netcmd/export.py
@@ -20,7 +20,7 @@
import samba.getopt as options
-from samba import net
+from samba.net import Net
from samba.netcmd import (
Command,
@@ -45,7 +45,7 @@ class cmd_export_keytab(Command):
def run(self, keytab, credopts=None, sambaopts=None, versionopts=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
- # FIXME: Obtain net context
+ net = Net(creds, lp)
net.export_keytab(keytab=keytab, creds=creds)