[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Mon Dec 21 15:41:19 MST 2009


The branch, master has been updated
       via  5b9e98a... provision/pyldb: Avoid linking in static python ldb module.
       via  1d9a243... ldb_wrap: Fix compilation when using system ldb.
       via  0110990... tdb: Also build and install tdb manpages from standalone tdb.
       via  8b278e6... tdb: Fix formatting of API check file.
       via  c8e6279... Fix initialisation of TypeObject samba.param.LoadparmService.
      from  9b6b01a... s3:winbind: Add a lower-cost alternative to wbinfo -t: wbinfo --ping-dc

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5b9e98a3826f294a9a9451adacdf77839d30244d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Dec 20 18:31:27 2009 +0100

    provision/pyldb: Avoid linking in static python ldb module.

commit 1d9a243d68539438441a488d09c1200bf22c7462
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Dec 20 18:05:38 2009 +0100

    ldb_wrap: Fix compilation when using system ldb.

commit 0110990f01390c80b8db423ba7eed486883219de
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Dec 20 18:01:24 2009 +0100

    tdb: Also build and install tdb manpages from standalone tdb.

commit 8b278e6dc11524a93d85d9c804709cef20860873
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Dec 20 17:51:07 2009 +0100

    tdb: Fix formatting of API check file.

commit c8e62797eb2b78427c9ecb193c878c646145c32a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Dec 20 17:49:48 2009 +0100

    Fix initialisation of TypeObject samba.param.LoadparmService.
    
    Found by Ricardo Jorge <rvelhote at gmail.com>.

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages-3/tdbbackup.8.xml                |    2 +-
 docs-xml/manpages-3/tdbdump.8.xml                  |    2 +-
 docs-xml/manpages-3/tdbtool.8.xml                  |    2 +-
 lib/tdb/Makefile.in                                |    6 +++-
 lib/tdb/configure.ac                               |    7 ++++
 lib/tdb/include/tdb.h                              |    2 +-
 .../tdb/manpages}/tdbbackup.8.xml                  |    0 
 .../manpages-3 => lib/tdb/manpages}/tdbdump.8.xml  |    0 
 .../manpages-3 => lib/tdb/manpages}/tdbtool.8.xml  |    0 
 lib/tdb/tdb.mk                                     |   15 +++++++++-
 lib/tdb/tdb.signatures                             |    2 +-
 source4/lib/ldb/pyldb.c                            |    4 ++-
 source4/lib/ldb/pyldb.h                            |    1 -
 source4/lib/ldb_wrap.c                             |    2 +-
 source4/param/config.mk                            |    2 +-
 source4/param/provision.c                          |   31 ++++++++++++++++++--
 source4/param/pyparam.c                            |    3 ++
 source4/param/tests/bindings.py                    |   10 ++++--
 18 files changed, 74 insertions(+), 17 deletions(-)
 copy {docs-xml/manpages-3 => lib/tdb/manpages}/tdbbackup.8.xml (100%)
 copy {docs-xml/manpages-3 => lib/tdb/manpages}/tdbdump.8.xml (100%)
 copy {docs-xml/manpages-3 => lib/tdb/manpages}/tdbtool.8.xml (100%)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/tdbbackup.8.xml b/docs-xml/manpages-3/tdbbackup.8.xml
index 5c42371..78fe32e 100644
--- a/docs-xml/manpages-3/tdbbackup.8.xml
+++ b/docs-xml/manpages-3/tdbbackup.8.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <refentry id="tdbbackup.8">
 
 <refmeta>
diff --git a/docs-xml/manpages-3/tdbdump.8.xml b/docs-xml/manpages-3/tdbdump.8.xml
index 8e42e08..90465e5 100644
--- a/docs-xml/manpages-3/tdbdump.8.xml
+++ b/docs-xml/manpages-3/tdbdump.8.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <refentry id="tdbdump.8">
 
 <refmeta>
diff --git a/docs-xml/manpages-3/tdbtool.8.xml b/docs-xml/manpages-3/tdbtool.8.xml
index 042c88c..9f96db2 100644
--- a/docs-xml/manpages-3/tdbtool.8.xml
+++ b/docs-xml/manpages-3/tdbtool.8.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <refentry id="tdbtool.8">
 
 <refmeta>
diff --git a/lib/tdb/Makefile.in b/lib/tdb/Makefile.in
index 93bfe37..3abeec3 100644
--- a/lib/tdb/Makefile.in
+++ b/lib/tdb/Makefile.in
@@ -31,18 +31,22 @@ PYTHON_CHECK_TARGET = @PYTHON_CHECK_TARGET@
 LIB_PATH_VAR = @LIB_PATH_VAR@
 tdbdir = @tdbdir@
 
+EXTRA_TARGETS = @DOC_TARGET@
+
 TDB_OBJ = @TDB_OBJ@ @LIBREPLACEOBJ@
 
 SONAMEFLAG = @SONAMEFLAG@
 VERSIONSCRIPT = @VERSIONSCRIPT@
 EXPORTSFILE = @EXPORTSFILE@
 
+XSLTPROC = @XSLTPROC@
+
 default: all
 
 include $(tdbdir)/tdb.mk
 include $(tdbdir)/rules.mk
 
-all:: showflags dirs $(PROGS) $(TDB_SOLIB) libtdb.a $(PYTHON_BUILD_TARGET)
+all:: showflags dirs $(PROGS) $(TDB_SOLIB) libtdb.a $(PYTHON_BUILD_TARGET) $(EXTRA_TARGETS)
 
 install:: all
 $(TDB_SOLIB): $(TDB_OBJ)
diff --git a/lib/tdb/configure.ac b/lib/tdb/configure.ac
index 779f596..dac7bb2 100644
--- a/lib/tdb/configure.ac
+++ b/lib/tdb/configure.ac
@@ -38,6 +38,13 @@ AC_ARG_ENABLE(python,
 		  fi
 		])
 
+AC_PATH_PROG(XSLTPROC,xsltproc)
+DOC_TARGET=""
+if test -n "$XSLTPROC"; then
+	DOC_TARGET=doc
+fi
+AC_SUBST(DOC_TARGET)
+
 m4_include(build_macros.m4)
 BUILD_WITH_SHARED_BUILD_DIR
 
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index db9ce4a..c9e946a 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -143,7 +143,7 @@ void tdb_remove_flags(struct tdb_context *tdb, unsigned flag);
 void tdb_enable_seqnum(struct tdb_context *tdb);
 void tdb_increment_seqnum_nonblock(struct tdb_context *tdb);
 int tdb_check(struct tdb_context *tdb,
-	      int (*check)(TDB_DATA key, TDB_DATA data, void *private_data),
+	      int (*check) (TDB_DATA key, TDB_DATA data, void *private_data),
 	      void *private_data);
 
 /* Low level locking functions: use with care */
diff --git a/docs-xml/manpages-3/tdbbackup.8.xml b/lib/tdb/manpages/tdbbackup.8.xml
similarity index 100%
copy from docs-xml/manpages-3/tdbbackup.8.xml
copy to lib/tdb/manpages/tdbbackup.8.xml
diff --git a/docs-xml/manpages-3/tdbdump.8.xml b/lib/tdb/manpages/tdbdump.8.xml
similarity index 100%
copy from docs-xml/manpages-3/tdbdump.8.xml
copy to lib/tdb/manpages/tdbdump.8.xml
diff --git a/docs-xml/manpages-3/tdbtool.8.xml b/lib/tdb/manpages/tdbtool.8.xml
similarity index 100%
copy from docs-xml/manpages-3/tdbtool.8.xml
copy to lib/tdb/manpages/tdbtool.8.xml
diff --git a/lib/tdb/tdb.mk b/lib/tdb/tdb.mk
index 267c2d1..93aa899 100644
--- a/lib/tdb/tdb.mk
+++ b/lib/tdb/tdb.mk
@@ -51,7 +51,20 @@ tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) pytdb.o
 	$(SHLD) $(SHLD_FLAGS) -o $@ pytdb.o -L. -ltdb `$(PYTHON_CONFIG) --ldflags`
 
 install:: installdirs installbin installheaders installlibs \
-		  $(PYTHON_INSTALL_TARGET)
+		  $(PYTHON_INSTALL_TARGET) installdocs
+
+doc:: manpages/tdbbackup.8 manpages/tdbdump.8 manpages/tdbtool.8
+
+.SUFFIXES: .8.xml .8
+
+.8.xml.8:
+	-test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
+installdocs::
+	${INSTALLCMD} -d $(DESTDIR)$(mandir)/man1
+	for I in manpages/*.1; do \
+		${INSTALLCMD} -m 644 $$I $(DESTDIR)$(mandir)/man1 \
+	done
 
 install-python:: build-python
 	mkdir -p $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
diff --git a/lib/tdb/tdb.signatures b/lib/tdb/tdb.signatures
index 93edb07..61b8c1d 100644
--- a/lib/tdb/tdb.signatures
+++ b/lib/tdb/tdb.signatures
@@ -56,5 +56,5 @@ void tdb_remove_flags (struct tdb_context *, unsigned int);
 void tdb_setalarm_sigptr (struct tdb_context *, volatile sig_atomic_t *);
 void tdb_set_logging_function (struct tdb_context *, const struct tdb_logging_context *);
 void tdb_set_max_dead (struct tdb_context *, int);
-int tdb_check (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *);
+int tdb_check (struct tdb_context *, int (*) (TDB_DATA, TDB_DATA, void *), void *);
 TDB_DATA tdb_null;
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 0ba69e1..a19768d 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -61,6 +61,8 @@ PyAPI_DATA(PyTypeObject) PyLdb;
 PyAPI_DATA(PyTypeObject) PyLdbMessageElement;
 PyAPI_DATA(PyTypeObject) PyLdbTree;
 
+static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx);
+
 static PyObject *PyObject_FromLdbValue(struct ldb_context *ldb_ctx, 
 							   struct ldb_message_element *el, 
 							   struct ldb_val *val)
@@ -1357,7 +1359,7 @@ static PySequenceMethods py_ldb_seq = {
 	.sq_contains = (objobjproc)py_ldb_contains,
 };
 
-PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx)
+static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx)
 {
 	PyLdbObject *ret;
 
diff --git a/source4/lib/ldb/pyldb.h b/source4/lib/ldb/pyldb.h
index a095415..289159c 100644
--- a/source4/lib/ldb/pyldb.h
+++ b/source4/lib/ldb/pyldb.h
@@ -35,7 +35,6 @@ typedef struct {
 	TALLOC_CTX *mem_ctx;
 } PyLdbObject;
 
-PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx);
 #define PyLdb_AsLdbContext(pyobj) ((PyLdbObject *)pyobj)->ldb_ctx
 #define PyLdb_Check(ob) PyObject_TypeCheck(ob, &PyLdb)
 
diff --git a/source4/lib/ldb_wrap.c b/source4/lib/ldb_wrap.c
index 134c227..d517846 100644
--- a/source4/lib/ldb_wrap.c
+++ b/source4/lib/ldb_wrap.c
@@ -34,7 +34,7 @@
 #include "ldb_wrap.h"
 #include "dsdb/samdb/samdb.h"
 #include "param/param.h"
-#include "dlinklist.h"
+#include "../lib/util/dlinklist.h"
 #include "../tdb/include/tdb.h"
 
 /*
diff --git a/source4/param/config.mk b/source4/param/config.mk
index 6e5290b..02bbdd5 100644
--- a/source4/param/config.mk
+++ b/source4/param/config.mk
@@ -13,7 +13,7 @@ PUBLIC_HEADERS += param/param.h
 PC_FILES += $(paramsrcdir)/samba-hostconfig.pc
 
 [SUBSYSTEM::PROVISION]
-PRIVATE_DEPENDENCIES = LIBPYTHON pyldb pyparam_util
+PRIVATE_DEPENDENCIES = LIBPYTHON pyparam_util
 
 PROVISION_OBJ_FILES = $(paramsrcdir)/provision.o $(param_OBJ_FILES)
 
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 8c6e1c0..7bd10ca 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -52,6 +52,34 @@ static PyObject *schema_module(void)
 	return PyImport_Import(name);
 }
 
+static PyObject *ldb_module(void)
+{
+	PyObject *name = PyString_FromString("ldb");
+	if (name == NULL)
+		return NULL;
+	return PyImport_Import(name);
+}
+
+static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx)
+{
+	PyLdbObject *ret;
+	PyObject *ldb_mod = ldb_module();
+	PyTypeObject *ldb_ctx_type;
+	if (ldb_mod == NULL)
+		return NULL;
+
+	ldb_ctx_type = PyObject_GetAttrString(ldb_mod, "Ldb");
+
+	ret = (PyLdbObject *)ldb_ctx_type->tp_alloc(ldb_ctx_type, 0);
+	if (ret == NULL) {
+		PyErr_NoMemory();
+		return NULL;
+	}
+	ret->mem_ctx = talloc_new(NULL);
+	ret->ldb_ctx = talloc_reference(ret->mem_ctx, ldb_ctx);
+	return (PyObject *)ret;
+}
+
 NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
 			struct provision_settings *settings, 
 			struct provision_result *result)
@@ -167,8 +195,6 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
 	return NT_STATUS_OK;
 }
 
-extern void initldb(void);
-
 static PyObject *py_dom_sid_FromSid(struct dom_sid *sid)
 {
 	PyObject *mod_security, *dom_sid_Type;
@@ -220,7 +246,6 @@ NTSTATUS provision_store_self_join(TALLOC_CTX *mem_ctx, struct loadparm_context
 	py_load_samba_modules();
 	Py_Initialize();
 	py_update_path("bin"); /* FIXME: Can't assume this is always the case */
-	initldb();
 	provision_mod = provision_module();
 
 	if (provision_mod == NULL) {
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index eb2da11..b425500 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -374,6 +374,9 @@ void initparam(void)
 	if (PyType_Ready(&PyLoadparmContext) < 0)
 		return;
 
+	if (PyType_Ready(&PyLoadparmService) < 0)
+		return;
+
 	m = Py_InitModule3("param", pyparam_methods, "Parsing and writing Samba configuration files.");
 	if (m == NULL)
 		return;
diff --git a/source4/param/tests/bindings.py b/source4/param/tests/bindings.py
index 41a67f9..1915e79 100644
--- a/source4/param/tests/bindings.py
+++ b/source4/param/tests/bindings.py
@@ -2,17 +2,17 @@
 
 # Unix SMB/CIFS implementation.
 # Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2007
-#   
+#
 # This program is free software; you can redistribute it and/or modify
 # 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/>.
 #
@@ -50,3 +50,7 @@ class LoadParmTestCase(unittest.TestCase):
         file = param.LoadParm()
         file.load_default()
 
+    def test_section_nonexistant(self):
+        samba_lp = param.LoadParm()
+        samba_lp.load_default()
+        self.assertRaises(KeyError, samba_lp.__getitem__, "nonexistant")


-- 
Samba Shared Repository


More information about the samba-cvs mailing list