[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri Oct 7 02:18:03 MDT 2011


The branch, master has been updated
       via  556ef6a s4-param copy print_parameter and equal_parameter in from source3
       via  6386251 s3-param Remove odd formatting to allow code merge
       via  0ba6076 s3-param: inline octal_string into caller to allow code merge
       via  80e4394 param: Use a bool to hold boolean parameters
       via  516ee5f s3-param use Auto define for lm_announce default
       via  36b2227 ldb: use ldb directly rather than via a copy
       via  ed41edd build: ndrdump is only built with waf
       via  64d0230 build: Remove obsolete --enable/disable-merged-build
       via  4980cd7 build: Remove _SAMBA_WAF_BUILD_
       via  1da89da autobuild: Remove s3-waf from autobuild
       via  055f017 build: Reduce build systems to just top level waf and autoconf
      from  83f0dc4 s4-dsdb: special case for deleted objects one way link

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


- Log -----------------------------------------------------------------
commit 556ef6ac906ef6155c21714aaa6f3cf3ee52a9ac
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 6 16:59:19 2011 +1100

    s4-param copy print_parameter and equal_parameter in from source3
    
    This will allow these functions to be put into lib/param shortly.
    
    Andrew Bartlett
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Fri Oct  7 10:17:01 CEST 2011 on sn-devel-104

commit 63862516213d9e556db039a3278233c45ff11404
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 6 16:58:32 2011 +1100

    s3-param Remove odd formatting to allow code merge
    
    This code is very old, and has some code styles that we have not used
    in Samba for a very long time.  This fixes up a the extra braces around
    return values.
    
    Andrew Bartlett

commit 0ba60760a3601a41161c93f7b9186c35e3e31621
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 6 16:54:08 2011 +1100

    s3-param: inline octal_string into caller to allow code merge

commit 80e439453d4c0f6e160745826c561dd99e2bd167
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 6 16:35:39 2011 +1100

    param: Use a bool to hold boolean parameters
    
    All three-state parameters invoking Auto (2) are already declared as integers, not
    booleans.
    
    Andrew Bartlett

commit 516ee5f0b04143b72239fae53ec34e4b6e3ca0d7
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 6 16:34:52 2011 +1100

    s3-param use Auto define for lm_announce default

commit 36b2227eca55e769813eecc97366ba18a2832fb3
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Jul 5 10:14:12 2011 +1000

    ldb: use ldb directly rather than via a copy
    
    This avoids needing to manually sync the two files, which due to the
    top level build must be API compatible at all times anyway.
    
    The most important recent change was:
    
    commit e3b76bd6205acfc1a89fbcab5d9588b32cb47b88
    Author: Andrew Tridgell <tridge at samba.org>
    Date:   Thu Jul 28 15:51:31 2011 +1000
    
        ldb: fixed a search expression parse bug
    
    However, as we always control the search expression in the callers to
    this code, no backport to other releases is required.
    
    Andrew Bartlett

commit ed41edddde6b81b759d4b4c8d9e59ee541a37c0a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 8 10:42:02 2011 +1000

    build: ndrdump is only built with waf
    
    We no longer need an #if (_SAMBA_BUILD >= 4) here.
    
    Andrew Bartlett

commit 64d0230332351d37873350722f2ce3bcd39728e4
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 8 10:09:12 2011 +1000

    build: Remove obsolete --enable/disable-merged-build
    
    All waf builds build everything now.
    
    Andrew Bartlett

commit 4980cd772a6c81b528d5a40646f4f1d0dde17b16
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 8 08:46:42 2011 +1000

    build: Remove _SAMBA_WAF_BUILD_
    
    The _SAMBA_BUILD_ macro can pick the difference between autoconf and waf builds now
    
    Andrew Bartlett

commit 1da89da251f225fc2246ac49c9656df1df7336bd
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 1 12:45:53 2011 +1000

    autobuild: Remove s3-waf from autobuild

commit 055f017b3693af95864f6595cf4ead041c389c52
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 1 12:45:38 2011 +1000

    build: Reduce build systems to just top level waf and autoconf
    
    The s3-waf build system is a key component of the top level build, but
    with this commit is is no longer available directly.  This reduces the
    number of build system combinations in master as we prepare for the
    Samba 4.0 release.
    
    Andrew Bartlett

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

Summary of changes:
 buildtools/wafsamba/samba3.py            |    2 +-
 buildtools/wafsamba/samba_autoconf.py    |    3 +-
 dynconfig/wscript                        |    2 -
 lib/util/wscript_build                   |   13 +-
 libcli/ldap/ldap_message.h               |    4 -
 libcli/ldap/ldap_ndr.c                   |    4 -
 libcli/nbt/wscript_build                 |   31 +-
 libcli/security/wscript_build            |   11 +-
 librpc/tools/ndrdump.c                   |    2 -
 script/autobuild.py                      |    9 +-
 script/mkparamdefs.pl                    |    2 +-
 source3/Makefile.in                      |    3 +-
 source3/autogen-waf.sh                   |   27 --
 source3/include/autoconf/ldb_version.h   |    4 +
 source3/lib/ldb_compat.c                 |  639 ------------------------------
 source3/lib/ldb_compat.h                 |   87 ----
 source3/param/loadparm.c                 |   47 ++-
 source3/passdb/machine_account_secrets.c |    8 +-
 source3/passdb/wscript_build             |   13 +-
 source3/selftest/wscript                 |  203 ----------
 source3/wscript                          |   99 +-----
 source3/wscript_build                    |   90 +----
 source4/param/loadparm.c                 |   48 ++-
 wscript                                  |    4 -
 wscript_build                            |    6 +-
 25 files changed, 118 insertions(+), 1243 deletions(-)
 delete mode 100755 source3/autogen-waf.sh
 create mode 100644 source3/include/autoconf/ldb_version.h
 delete mode 100644 source3/lib/ldb_compat.c
 delete mode 100644 source3/lib/ldb_compat.h
 delete mode 100644 source3/selftest/wscript


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py
index b2a3655..1426029 100644
--- a/buildtools/wafsamba/samba3.py
+++ b/buildtools/wafsamba/samba3.py
@@ -52,7 +52,7 @@ def s3_fix_kwargs(bld, kwargs):
 
     # the extra_includes list is relative to the source3 directory
     extra_includes = [ '.', 'include', 'lib', '../lib/tdb_compat' ]
-    if bld.env.use_intree_heimdal:
+    if not bld.CONFIG_SET("USING_SYSTEM_KRB5"):
         extra_includes += [ '../source4/heimdal/lib/com_err',
                             '../source4/heimdal/lib/gssapi',
                             '../source4/heimdal_build' ]
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 207d732..909e836 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -599,8 +599,7 @@ def SAMBA_CONFIG_H(conf, path=None):
         # we add these here to ensure that -Wstrict-prototypes is not set during configure
         conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -fno-common',
                         testflags=True)
-        if os.getenv('TOPLEVEL_BUILD'):
-            conf.ADD_CFLAGS('-Wcast-qual', testflags=True)
+        conf.ADD_CFLAGS('-Wcast-qual', testflags=True)
         conf.env.DEVELOPER_MODE = True
 
     if Options.options.picky_developer:
diff --git a/dynconfig/wscript b/dynconfig/wscript
index e9815e0..28f6e8d 100755
--- a/dynconfig/wscript
+++ b/dynconfig/wscript
@@ -357,8 +357,6 @@ Build.BuildContext.dynconfig_cflags = dynconfig_cflags
 def build(bld):
     cflags = bld.dynconfig_cflags()
     version_header = 'version.h'
-    if not os.getenv('TOPLEVEL_BUILD'):
-        version_header = 'include/version.h'
     bld.SAMBA_SUBSYSTEM('DYNCONFIG',
                         'dynconfig.c',
                         deps='replace talloc',
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index f4bd885..8b4901a 100755
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -65,13 +65,12 @@ bld.SAMBA_LIBRARY('tevent-util',
 	)
 
 
-if bld.env._SAMBA_BUILD_ == 4:
-	bld.SAMBA_SUBSYSTEM('util_ldb',
-		source='util_ldb.c',
-		local_include=False,
-		public_deps='ldb',
-		public_headers='util_ldb.h'
-		)
+bld.SAMBA_SUBSYSTEM('util_ldb',
+		    source='util_ldb.c',
+		    local_include=False,
+		    public_deps='ldb',
+		    public_headers='util_ldb.h'
+		    )
 
 
 bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
diff --git a/libcli/ldap/ldap_message.h b/libcli/ldap/ldap_message.h
index 94eaed2..eb7e620 100644
--- a/libcli/ldap/ldap_message.h
+++ b/libcli/ldap/ldap_message.h
@@ -22,11 +22,7 @@
 #define _LIBCLI_LDAP_MESSAGE_H_
 
 #include "../libcli/ldap/ldap_errors.h"
-#if _SAMBA_BUILD_ == 3
-#include "lib/ldb_compat.h"
-#else
 #include <ldb.h>
-#endif
 
 enum ldap_request_tag {
 	LDAP_TAG_BindRequest = 0,
diff --git a/libcli/ldap/ldap_ndr.c b/libcli/ldap/ldap_ndr.c
index f77a6f2..9cc502e 100644
--- a/libcli/ldap/ldap_ndr.c
+++ b/libcli/ldap/ldap_ndr.c
@@ -21,11 +21,7 @@
 */
 
 #include "includes.h"
-#if _SAMBA_BUILD_ == 3
-#include "lib/ldb_compat.h"
-#else
 #include <ldb.h>
-#endif
 #include "librpc/gen_ndr/ndr_security.h"
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "libcli/ldap/ldap_ndr.h"
diff --git a/libcli/nbt/wscript_build b/libcli/nbt/wscript_build
index 2c70a1d..b531dba 100644
--- a/libcli/nbt/wscript_build
+++ b/libcli/nbt/wscript_build
@@ -11,22 +11,21 @@ bld.SAMBA_SUBSYSTEM('lmhosts',
                     deps='replace talloc'
                     )
 
-if bld.env._SAMBA_BUILD_ == 4:
-    bld.SAMBA_LIBRARY('cli-nbt',
-                      source='nbtsocket.c namequery.c nameregister.c namerefresh.c namerelease.c',
-                      public_deps='ndr NDR_NBT tevent tevent-util NDR_SECURITY samba_socket samba-util lmhosts',
-                      private_library=True
-                      )
+bld.SAMBA_LIBRARY('cli-nbt',
+                  source='nbtsocket.c namequery.c nameregister.c namerefresh.c namerelease.c',
+                  public_deps='ndr NDR_NBT tevent tevent-util NDR_SECURITY samba_socket samba-util lmhosts',
+                  private_library=True
+                  )
 
-    bld.SAMBA_BINARY('nmblookup',
-                     source='tools/nmblookup.c',
-                     manpages='man/nmblookup.1',
-                     deps='samba-hostconfig samba-util cli-nbt popt POPT_SAMBA netif LIBCLI_RESOLVE'
-                     )
+bld.SAMBA_BINARY('nmblookup',
+                 source='tools/nmblookup.c',
+                 manpages='man/nmblookup.1',
+                 deps='samba-hostconfig samba-util cli-nbt popt POPT_SAMBA netif LIBCLI_RESOLVE'
+                 )
 
-    bld.SAMBA_PYTHON('python_netbios',
-                     source='pynbt.c',
-                     public_deps='cli-nbt DYNCONFIG samba-hostconfig',
-                     realname='samba/netbios.so'
-                     )
+bld.SAMBA_PYTHON('python_netbios',
+                 source='pynbt.c',
+                 public_deps='cli-nbt DYNCONFIG samba-hostconfig',
+                 realname='samba/netbios.so'
+                 )
 
diff --git a/libcli/security/wscript_build b/libcli/security/wscript_build
index 940ee70..f3b654e 100644
--- a/libcli/security/wscript_build
+++ b/libcli/security/wscript_build
@@ -7,9 +7,8 @@ bld.SAMBA_LIBRARY('security',
                   deps='talloc ndr NDR_SECURITY'
                   )
 
-if getattr(bld.env, '_SAMBA_BUILD_', 0) == 4:
-    bld.SAMBA_PYTHON('pysecurity',
-                     source='pysecurity.c',
-                     deps='security pytalloc-util',
-                     realname='samba/security.so'
-                     )
+bld.SAMBA_PYTHON('pysecurity',
+                 source='pysecurity.c',
+                 deps='security pytalloc-util',
+                 realname='samba/security.so'
+                 )
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index 01618d5..e33115d 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -23,10 +23,8 @@
 #include "system/locale.h"
 #include "librpc/ndr/libndr.h"
 #include "librpc/ndr/ndr_table.h"
-#if (_SAMBA_BUILD_ >= 4)
 #include "lib/cmdline/popt_common.h"
 #include "param/param.h"
-#endif
 
 static const struct ndr_interface_call *find_function(
 	const struct ndr_interface_table *p,
diff --git a/script/autobuild.py b/script/autobuild.py
index 3a8c0f8..9945c66 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -16,7 +16,6 @@ cleanup_list = []
 
 builddirs = {
     "samba3"  : "source3",
-    "samba3-waf": "source3",
     "samba4"  : ".",
     "ldb"     : "lib/ldb",
     "tdb"     : "lib/tdb",
@@ -29,7 +28,7 @@ builddirs = {
     "retry"   : "."
     }
 
-defaulttasks = [ "samba3", "samba3-waf", "samba4", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ]
+defaulttasks = [ "samba3", "samba4", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ]
 
 tasks = {
     "samba3" : [ ("autogen", "./autogen.sh", "text/plain"),
@@ -41,12 +40,6 @@ tasks = {
                  ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
                  ("clean", "make clean", "text/plain") ],
 
-    "samba3-waf" : [ ("autogen", "./autogen-waf.sh", "text/plain"),
-                 ("configure", "./configure.developer ${PREFIX}", "text/plain"),
-                 ("make", "make -j", "text/plain"),
-                 ("install", "make install", "text/plain"),
-                 ("clean", "make clean", "text/plain") ],
-
     # We have 'test' before 'install' because, 'test' should work without 'install'
     "samba4" : [ ("configure", "./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab", "text/plain"),
                  ("make", "make -j", "text/plain"),
diff --git a/script/mkparamdefs.pl b/script/mkparamdefs.pl
index eacdebd..b489cc9 100644
--- a/script/mkparamdefs.pl
+++ b/script/mkparamdefs.pl
@@ -130,7 +130,7 @@ sub handle_loadparm($$$)
 	        return;
 	}
 	my %tmap = (
-	    "BOOL" => "int ",
+	    "BOOL" => "bool ",
 	    "CONST_STRING" => "char *",
 	    "STRING" => "char *",
 	    "INTEGER" => "int ",
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 1bb987e..1264611 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -177,6 +177,7 @@ FLAGS = -I. \
 	$(ISA) \
 	-I$(srcdir)/lib \
 	-I.. \
+	-I./../lib/ldb/include \
 	-D_SAMBA_BUILD_=3
 
 PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
@@ -567,7 +568,7 @@ LIBSAMBA_OBJ = $(LIBSMB_OBJ0) \
 	       $(LIBSMB_ERR_OBJ)
 
 LIBCLI_LDAP_MESSAGE_OBJ = ../libcli/ldap/ldap_message.o
-LIBCLI_LDAP_NDR_OBJ = ../libcli/ldap/ldap_ndr.o lib/ldb_compat.o
+LIBCLI_LDAP_NDR_OBJ = ../libcli/ldap/ldap_ndr.o ../lib/ldb/common/ldb_parse.o
 
 LIBTSOCKET_OBJ = ../lib/tsocket/tsocket.o \
 		../lib/tsocket/tsocket_helpers.o \
diff --git a/source3/autogen-waf.sh b/source3/autogen-waf.sh
deleted file mode 100755
index 432b523..0000000
--- a/source3/autogen-waf.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-p=`dirname $0`
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d "$p/$d"; do d="../$d"; done
-
-echo "Found buildtools in $p/$d"
-
-echo "Setting up configure"
-rm -f $p/configure $p/include/config*.h*
-sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure
-chmod +x $p/configure
-
-echo "Setting up Makefile"
-rm -f $p/makefile $p/Makefile
-sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/Makefile
-
-echo "done. Now run $p/configure or $p/configure.developer then make."
-if [ $p != "." ]; then
-	echo "Notice: The build invoke path is not 'source3'! Use make with the parameter"
-	echo "-C <'source3' path>. Example: make -C source3 all"
-fi
diff --git a/source3/include/autoconf/ldb_version.h b/source3/include/autoconf/ldb_version.h
new file mode 100644
index 0000000..e1c1afc
--- /dev/null
+++ b/source3/include/autoconf/ldb_version.h
@@ -0,0 +1,4 @@
+
+/* This define and header file is needed so we can include ldb.h
+ * without building ldb properly */
+#define LDB_VERSION "dummy ldb version for ldb.h without ldb"
diff --git a/source3/lib/ldb_compat.c b/source3/lib/ldb_compat.c
deleted file mode 100644
index 36a29e6..0000000
--- a/source3/lib/ldb_compat.c
+++ /dev/null
@@ -1,639 +0,0 @@
-/* 
-   ldb database library
-
-   Copyright (C) Andrew Tridgell  2004
-
-     ** NOTE! The following LGPL license applies to the ldb
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 3 of the License, or (at your option) any later version.
-
-   This library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "lib/ldb_compat.h"
-
-static struct ldb_parse_tree *ldb_parse_filter(void *mem_ctx, const char **s);
-
-static int ldb_parse_hex2char(const char *x)
-{
-	if (isxdigit(x[0]) && isxdigit(x[1])) {
-		const char h1 = x[0], h2 = x[1];
-		int c = 0;
-
-		if (h1 >= 'a') c = h1 - (int)'a' + 10;
-		else if (h1 >= 'A') c = h1 - (int)'A' + 10;
-		else if (h1 >= '0') c = h1 - (int)'0';
-		c = c << 4;
-		if (h2 >= 'a') c += h2 - (int)'a' + 10;
-		else if (h2 >= 'A') c += h2 - (int)'A' + 10;
-		else if (h2 >= '0') c += h2 - (int)'0';
-
-		return c;
-	}
-
-	return -1;
-}
-
-
-
-/*
-   decode a RFC2254 binary string representation of a buffer.
-   Used in LDAP filters.
-*/
-static struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str)
-{
-	size_t i, j;
-	struct ldb_val ret;
-	size_t slen = str?strlen(str):0;
-
-	ret.data = (uint8_t *)talloc_size(mem_ctx, slen+1);
-	ret.length = 0;
-	if (ret.data == NULL) return ret;
-
-	for (i=j=0;i<slen;i++) {
-		if (str[i] == '\\') {
-			int c;
-
-			c = ldb_parse_hex2char(&str[i+1]);
-			if (c == -1) {
-				talloc_free(ret.data);
-				memset(&ret, 0, sizeof(ret));
-				return ret;
-			}
-			((uint8_t *)ret.data)[j++] = c;
-			i += 2;
-		} else {
-			((uint8_t *)ret.data)[j++] = str[i];
-		}
-	}
-	ret.length = j;
-	((uint8_t *)ret.data)[j] = 0;
-
-	return ret;
-}
-
-
-
-
-/*
-   encode a blob as a RFC2254 binary string, escaping any
-   non-printable or '\' characters
-*/
-char *ldb_binary_encode(void *mem_ctx, struct ldb_val val)
-{
-	size_t i;
-	char *ret;
-	size_t len = val.length;
-	unsigned char *buf = val.data;
-
-	for (i=0;i<val.length;i++) {
-		if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
-			len += 2;
-		}
-	}
-	ret = talloc_array(mem_ctx, char, len+1);
-	if (ret == NULL) return NULL;
-
-	len = 0;
-	for (i=0;i<val.length;i++) {
-		if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
-			snprintf(ret+len, 4, "\\%02X", buf[i]);
-			len += 3;
-		} else {
-			ret[len++] = buf[i];
-		}
-	}
-
-	ret[len] = 0;
-
-	return ret;	
-}
-
-
-
-static enum ldb_parse_op ldb_parse_filtertype(void *mem_ctx, char **type, char **value, const char **s)
-{
-	enum ldb_parse_op filter = 0;
-	char *name, *val, *k;
-	const char *p = *s;
-	const char *t, *t1;
-
-	/* retrieve attributetype name */
-	t = p;
-
-	if (*p == '@') { /* for internal attributes the first char can be @ */
-		p++;
-	}
-
-	while ((isascii(*p) && isalnum((unsigned char)*p)) || (*p == '-') || (*p == '.')) { 
-		/* attribute names can only be alphanums */
-		p++;
-	}
-
-	if (*p == ':') { /* but extended searches have : and . chars too */
-		p = strstr(p, ":=");
-		if (p == NULL) { /* malformed attribute name */
-			return 0;
-		}
-	}
-
-	t1 = p;
-
-	while (isspace((unsigned char)*p)) p++;
-
-	if (!strchr("=<>~:", *p)) {
-		return 0;
-	}
-
-	/* save name */
-	name = (char *)talloc_memdup(mem_ctx, t, t1 - t + 1);
-	if (name == NULL) return 0;
-	name[t1 - t] = '\0';
-
-	/* retrieve filtertype */
-
-	if (*p == '=') {
-		filter = LDB_OP_EQUALITY;
-	} else if (*(p + 1) == '=') {
-		switch (*p) {
-		case '<':
-			filter = LDB_OP_LESS;
-			p++;
-			break;
-		case '>':
-			filter = LDB_OP_GREATER;
-			p++;
-			break;
-		case '~':
-			filter = LDB_OP_APPROX;
-			p++;
-			break;
-		case ':':
-			filter = LDB_OP_EXTENDED;
-			p++;
-			break;
-		}
-	}
-	if (!filter) {
-		talloc_free(name);
-		return filter;
-	}
-	p++;
-
-	while (isspace((unsigned char)*p)) p++;
-
-	/* retrieve value */
-	t = p;
-
-	while (*p && ((*p != ')') || ((*p == ')') && (*(p - 1) == '\\')))) p++;
-
-	val = (char *)talloc_memdup(mem_ctx, t, p - t + 1);
-	if (val == NULL) {
-		talloc_free(name);
-		return 0;
-	}
-	val[p - t] = '\0';
-
-	k = &(val[p - t]);
-
-	/* remove trailing spaces from value */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list