Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
authorAndrew Bartlett <abartlet@samba.org>
Mon, 21 Jan 2008 23:53:14 +0000 (10:53 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 21 Jan 2008 23:53:14 +0000 (10:53 +1100)
(This used to be commit 74220ca244865f97825cabdbc8aa899e71c25c7d)

87 files changed:
.gitignore
howto.txt
source4/build/m4/public.m4
source4/build/smb_build/config_mk.pm
source4/build/smb_build/makefile.pm
source4/dsdb/samdb/ldb_modules/config.mk
source4/dsdb/samdb/ldb_modules/instancetype.c [new file with mode: 0644]
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/heimdal_build/config.mk
source4/lib/ldb/python.mk
source4/lib/nss_wrapper/config.mk
source4/lib/policy/config.mk
source4/lib/registry/dir.c
source4/lib/registry/hive.c
source4/lib/registry/ldb.c
source4/lib/registry/local.c
source4/lib/registry/patchfile.c
source4/lib/registry/regf.c
source4/lib/registry/samba.c
source4/lib/registry/tests/hive.c
source4/lib/registry/tests/registry.c
source4/lib/samba3/config.mk
source4/lib/socket_wrapper/config.mk
source4/lib/tdb/common/freelist.c
source4/lib/tdb/common/open.c
source4/lib/tdb/common/tdb.c
source4/lib/tdb/common/tdb_private.h
source4/lib/tdb/common/transaction.c
source4/lib/tdb/common/traverse.c
source4/lib/tdb/docs/README
source4/lib/tdb/include/tdb.h
source4/lib/tdb/tools/tdbtool.c
source4/lib/tdr/config.mk
source4/libcli/config.mk
source4/libcli/swig/libcli_nbt.i
source4/libcli/swig/libcli_nbt.py
source4/libcli/swig/libcli_nbt_wrap.c
source4/libcli/swig/libcli_smb.i
source4/libcli/swig/libcli_smb.py
source4/libcli/swig/libcli_smb_wrap.c
source4/libnet/config.mk
source4/librpc/config.mk
source4/librpc/idl/lsa.idl
source4/librpc/ndr/ndr_compression.c
source4/nsswitch/config.mk
source4/ntptr/config.mk
source4/ntvfs/config.mk
source4/param/config.mk
source4/pidl/lib/Parse/Pidl.pm
source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
source4/pidl/lib/Parse/Pidl/Samba4.pm
source4/pidl/pidl
source4/pidl/tests/samba3-srv.pl [new file with mode: 0644]
source4/rpc_server/samr/dcesrv_samr.c
source4/scripting/ejs/config.mk
source4/scripting/libjs/provision.js
source4/scripting/python/config.mk
source4/scripting/python/modules.c
source4/scripting/python/samba/provision.py
source4/selftest/README
source4/selftest/selftest.pl
source4/selftest/target/Samba3.pm [moved from source4/selftest/env/Samba3.pm with 100% similarity]
source4/selftest/target/Samba4.pm [moved from source4/selftest/env/Samba4.pm with 100% similarity]
source4/selftest/target/Windows.pm [moved from source4/selftest/env/Windows.pm with 100% similarity]
source4/setup/display_specifiers.ldif
source4/setup/provision
source4/setup/provision-backend
source4/setup/provision.ldif
source4/setup/provision.py
source4/setup/provision_basedn.ldif
source4/setup/provision_computers_modify.ldif
source4/setup/provision_configuration.ldif
source4/setup/provision_configuration_basedn.ldif
source4/setup/provision_configuration_basedn_modify.ldif
source4/setup/provision_schema_basedn.ldif
source4/setup/provision_schema_basedn_modify.ldif
source4/setup/provision_self_join.ldif
source4/setup/provision_templates.ldif
source4/setup/provision_users.ldif
source4/setup/provision_users_modify.ldif
source4/setup/slapd.conf
source4/smbd/config.mk
source4/smbd/process_model.mk
source4/torture/raw/streams.c
source4/torture/rpc/samba3rpc.c

index ccc12650c16175460110801c09dcd5746a378a34..9ed0334ea13a80cb4219e91843b306887fb46ea6 100644 (file)
@@ -67,6 +67,7 @@ source/lib/util/pidfile.h
 source/lib/util/unix_privs.h
 source/lib/util/util_proto.h
 source/lib/util/wrap_xattr.h
+source/lib/util/asn1_proto.h
 source/libcli/finddcs.h
 source/libcli/libcli_proto.h
 source/libcli/auth/proto.h
@@ -79,7 +80,6 @@ source/libcli/resolve/proto.h
 source/libcli/security/proto.h
 source/libcli/smb2/smb2_proto.h
 source/libcli/smb_composite/proto.h
-source/libcli/util/asn1_proto.h
 source/libcli/util/clilsa.h
 source/libcli/util/proto.h
 source/libcli/wrepl/winsrepl_proto.h
index 7b10b5960a4571933ea191b7828c894b47ba7d34..654ad658c8b795c3116840b0f4774a9eaa90b2bd 100644 (file)
--- a/howto.txt
+++ b/howto.txt
@@ -1,9 +1,8 @@
 Samba4 developer howto
-----------------------
+======================
 
 tridge@samba.org, December 2004
 
-
 A more up to date version of this howto can be found in the wiki 
 at http://wiki.samba.org/index.php/Samba4/HOWTO.
 
@@ -12,31 +11,32 @@ server. This is aimed at developers who are already familiar with
 Samba3 and wish to participate in Samba4 development. This is not
 aimed at production use of Samba4.
 
+.. contents::
 
 Step 1: download Samba4
 -----------------------
 
 There are 2 methods of doing this:
 
-  method 1:  "rsync -avz samba.org::ftp/unpacked/samba4 ."
+  method 1:  "rsync -avz samba.org::ftp/unpacked/samba_4_0_test/ samba4"
 
-  method 2:  "svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0 samba4"
+  method 2:  "git clone git://git.samba.org/samba.git samba4; cd samba4; git checkout v4-0-test; cd .."
 
 both methods will create a directory called "samba4" in the current
-directory. If you don't have rsync or svn then install one of them. 
+directory. If you don't have rsync or git then install one of them. 
 
 Since only released versions of Samba contain a pregenerated configure script, 
-you will have to generate it by hand:
+you will have to generate it by hand::
 
  $ cd samba4/source
  $ ./autogen.sh
 
-Note that the above rsync command will give you a checked out svn
-repository. So if you also have svn you can update it to the latest
-version at some future date using:
+Note that the above rsync command will give you a checked out git
+repository. So if you also have git you can update it to the latest
+version at some future date using::
 
   $ cd samba4
-  $ svn up
+  $ git pull origin v4-0-test
 
 Step 2: compile Samba4
 ----------------------
@@ -46,7 +46,7 @@ Recommended optional development libraries:
 - gnutls
 - readline
 
-Run this:
+Run this::
 
   $ cd samba4/source
   $ ./configure
@@ -61,6 +61,8 @@ Step 3: install Samba4
 Run this as a user who have permission to write to the install
 directory (defaults to /usr/local/samba). Use --prefix option to
 configure above to change this.
+
+::
  
   # make install
 
@@ -73,6 +75,8 @@ binary is installed in a directory listed in your PATH environment variable.
 It is presumed it's available just like any other commands from your shell.
 Must be run as a user with permission to write to the install directory.
 
+::
+
   # cd source
   # ./setup/provision --realm=YOUR.REALM --domain=YOURDOM \
   #  --adminpass=SOMEPASSWORD --server-role='domain controller'
@@ -89,7 +93,7 @@ Step 5: Create a simple smb.conf
 
 The provisioning will create a very simple smb.conf with no shares by
 default. You will need to update it to add at least one share. For
-example:
+example::
 
   [test]
        path = /data/test
@@ -100,7 +104,7 @@ Step 6: starting Samba4
 -----------------------
 
 The simplest is to just run "smbd", but as a developer you may find
-the following more useful:
+the following more useful::
 
    # smbd -i -M single
 
@@ -119,11 +123,13 @@ in your $PATH. Make sure you run the right version!
 Step 7: testing Samba4
 ----------------------
 
-try these commands:
+try these commands::
 
-     $ smbclient //localhost/test -Uadministrator%SOMEPASSWORD
-    or
-     $ ./script/tests/test_posix.sh //localhost/test administrator SOMEPASSWORD
+  $ smbclient //localhost/test -Uadministrator%SOMEPASSWORD
+
+or::
+
+  $ ./script/tests/test_posix.sh //localhost/test administrator SOMEPASSWORD
 
 
 NOTE about filesystem support
@@ -133,23 +139,23 @@ To use the advanced features of Samba4 you need a filesystem that
 supports both the "user" and "system" xattr namespaces.
 
 If you run Linux with a 2.6 kernel and ext3 this means you need to
-include the option "user_xattr" in your /etc/fstab. For example:
+include the option "user_xattr" in your /etc/fstab. For example::
 
-/dev/hda3              /home                   ext3    user_xattr     1 1
+   /dev/hda3           /home                   ext3    user_xattr     1 1
 
 You also need to compile your kernel with the XATTR and SECURITY
-options for your filesystem. For ext3 that means you need:
+options for your filesystem. For ext3 that means you need::
 
    CONFIG_EXT3_FS_XATTR=y
    CONFIG_EXT3_FS_SECURITY=y
 
 If you are running a Linux 2.6 kernel with CONFIG_IKCONFIG_PROC
-defined you can check this with the following command:
+defined you can check this with the following command::
 
    $ zgrep CONFIG_EXT3_FS /proc/config.gz
 
 If you don't have a filesystem with xattr support, then you can
-simulate it by using the option:
+simulate it by using the option::
 
    posix:eadb = /usr/local/samba/eadb.tdb
 
@@ -161,7 +167,7 @@ Testing your filesystem
 -----------------------
 
 To test your filesystem support, install the 'attr' package and run
-the following 4 commands as root:
+the following 4 commands as root::
 
   # touch test.txt
   # setfattr -n user.test -v test test.txt
@@ -169,11 +175,11 @@ the following 4 commands as root:
   # getfattr -d test.txt
   # getfattr -n security.test -d test.txt
 
-You should see output like this:
+You should see output like this::
 
   # file: test.txt
   user.test="test"
-
+  
   # file: test.txt
   security.test="test2"
 
@@ -184,4 +190,5 @@ with the right options.
 If you get any "Operation not permitted" errors then it probably means
 you didn't try the test as root.
 
-
+..
+       vim: ft=rest
index 9e82e6aaf199e7c7e2e47d8dae1aa83123deb4bc..6d693eaeeea9a5fbf4a2958a6cb250f2e4044ad0 100644 (file)
@@ -8,7 +8,7 @@ dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems)
 dnl
 dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
 dnl
-dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags)
+dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags,pcname)
 dnl
 dnl SMB_ENABLE(name,default_build)
 dnl
@@ -34,7 +34,7 @@ ENABLE = YES
 "
 ])
 
-dnl SMB_LIBRARY(name,description,obj_files,required_subsystems,version,so_version,cflags,ldflags)
+dnl SMB_LIBRARY(name,description,obj_files,required_subsystems,version,so_version,cflags,ldflags,pcname)
 AC_DEFUN([SMB_LIBRARY],
 [
 SMB_INFO_LIBRARIES="$SMB_INFO_LIBRARIES
@@ -48,6 +48,7 @@ VERSION = $5
 SO_VERSION = $6 
 CFLAGS = $7
 LDFLAGS = $8
+PC_NAME = $9
 ENABLE = YES
 # End Library $1
 ###################################
@@ -93,7 +94,8 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
                                        [`$PKG_CONFIG --libs-only-l '$2'`], 
                                        [`$PKG_CONFIG --cflags-only-other '$2'`],
                                        [`$PKG_CONFIG --cflags-only-I '$2'`],
-                                       [`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`])
+                                       [`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`],
+                                       [ $2 ])
                                ac_cv_$1_found=yes
 
                        else
@@ -125,7 +127,7 @@ include $1
 "
 ])
 
-dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags)
+dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags,pcname)
 AC_DEFUN([SMB_EXT_LIB],
 [
 
@@ -137,6 +139,7 @@ LIBS = $2
 CFLAGS = $3
 CPPFLAGS = $4
 LDFLAGS = $5
+PC_NAME = $6
 # End Ext Lib $1
 ###################################
 "
index 7ad6600a8c4510053d215830dc49734c462612ed..d07660ba1d826365c39a06f8bd3b7e9bdbc26a76 100644 (file)
@@ -18,6 +18,7 @@ my $section_types = {
                "CFLAGS"                => "list",
                "CPPFLAGS"              => "list",
                "LDFLAGS"               => "list",
+               "PC_NAME" => "string",
                },
        "PYTHON" => {
                SWIG_FILE => "string",
@@ -26,6 +27,7 @@ my $section_types = {
                "OBJ_FILES" => "list",
                "ENABLE"                => "bool",
                "LDFLAGS"               => "list",
+               "CFLAGS"                => "list",
        },
        "SUBSYSTEM" => {
                "OBJ_FILES"             => "list",
@@ -87,6 +89,8 @@ my $section_types = {
                "VERSION"               => "string",
                "SO_VERSION"            => "string",
                "LIBRARY_REALNAME" => "string",
+
+               "PC_NAME" => "string",
                
                "INIT_FUNCTION_TYPE"    => "string",
                "INIT_FUNCTION_SENTINEL" => "string",
index 0e7771c3f2a337786abcc17d9b19fcdfc641dbbd..7e715b47eb349db20413b0f2d78a90b52d473b70 100644 (file)
@@ -27,6 +27,7 @@ sub new($$$)
        $self->{torture_progs} = [];
        $self->{static_libs} = [];
        $self->{python_dsos} = [];
+       $self->{python_pys} = [];
        $self->{shared_libs} = [];
        $self->{installable_shared_libs} = [];
        $self->{headers} = [];
@@ -345,7 +346,7 @@ sub SharedModule($$)
 
        push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
 
-       if (defined($ctx->{INIT_FUNCTION})) {
+       if (defined($ctx->{INIT_FUNCTION}) and $ctx->{TYPE} ne "PYTHON") {
                my $init_fn = $ctx->{INIT_FUNCTION_TYPE};
                $init_fn =~ s/\(\*\)/init_module/;
                my $proto_fn = $ctx->{INIT_FUNCTION_TYPE};
@@ -539,7 +540,7 @@ sub PythonFiles($$)
                $self->output("$target: $source\n" .
                                          "\tmkdir -p \$(builddir)/bin/python\n" .
                              "\tcp $source \$@\n\n");
-               push (@{$self->{python_dsos}}, $target);
+               push (@{$self->{python_pys}}, $target);
        }
 }
 
@@ -569,24 +570,21 @@ sub PkgConfig($$$)
        my $pubs;
        my $privs;
        my $privlibs;
+       my $publibs = "";
 
        if (defined($ctx->{PUBLIC_DEPENDENCIES})) {
                foreach (@{$ctx->{PUBLIC_DEPENDENCIES}}) {
                        next if ($other->{$_}->{ENABLE} eq "NO");
-                       if ($other->{$_}->{TYPE} eq "EXT_LIB") {
+                       if (defined($other->{$_}->{PC_NAME})) {
+                               $pubs .= "$other->{$_}->{PC_NAME} ";
+                       } elsif ($other->{$_}->{TYPE} eq "EXT_LIB") {
                                my $e = $other->{$_};
-
                                my $ldflags = join(" ", @{$e->{LDFLAGS}});
                                $ldflags .= " " unless $ldflags eq "";
                                my $libs = join(" ", @{$e->{LIBS}});
                                $libs .= " " unless $libs eq "";
 
-                               $pubs .= $ldflags.$libs;
-                       } elsif ($other->{$_}->{TYPE} eq "LIBRARY") {
-                               s/^LIB//g;
-                               $_ = lc($_);
-
-                               $pubs .= "$_ ";
+                               $publibs .= $ldflags.$libs;
                        } else {
                                s/^LIB//g;
                                $_ = lc($_);
@@ -625,7 +623,7 @@ sub PkgConfig($$$)
        smb_build::env::PkgConfig($self,
                $path,
                $link_name,
-               "-L\${libdir} -l$link_name",
+               "-L\${libdir} -l$link_name $publibs",
                $privlibs,
                "",
                "$ctx->{VERSION}",
@@ -714,6 +712,7 @@ sub write($$)
        $self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n");
        $self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n");
        $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n");
+       $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n");
        $self->output("INSTALLABLE_SHARED_LIBS = " . array2oneperline($self->{installable_shared_libs}) . "\n");
        $self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
        $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
index a41a29b5dd4bad5af2429a1e8396540f0347dcc7..dc407fbd8a9a049b0c8618dc86941d6ff7547852 100644 (file)
@@ -333,3 +333,16 @@ OBJ_FILES = \
 # End MODULE ldb_normalise
 ################################################
 
+################################################
+# Start MODULE ldb_instancetype
+[MODULE::ldb_instancetype]
+INIT_FUNCTION = ldb_instancetype_init
+CFLAGS = -Ilib/ldb/include
+OUTPUT_TYPE = SHARED_LIBRARY
+PRIVATE_DEPENDENCIES = LIBTALLOC
+SUBSYSTEM = LIBLDB
+OBJ_FILES = \
+               instancetype.o
+# End MODULE ldb_instancetype
+################################################
+
diff --git a/source4/dsdb/samdb/ldb_modules/instancetype.c b/source4/dsdb/samdb/ldb_modules/instancetype.c
new file mode 100644 (file)
index 0000000..064c28e
--- /dev/null
@@ -0,0 +1,128 @@
+/* 
+   ldb database library
+
+   Copyright (C) Simo Sorce  2004-2006
+   Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
+   Copyright (C) Andrew Tridgell 2005
+   Copyright (C) Stefan Metzmacher <metze@samba.org> 2007
+
+     ** 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/>.
+*/
+
+/*
+ *  Name: ldb
+ *
+ *  Component: ldb instancetype module
+ *
+ *  Description: add an instanceType onto every new record
+ *
+ *  Author: Andrew Bartlett
+ */
+
+#include "includes.h"
+#include "ldb/include/ldb_includes.h"
+#include "librpc/gen_ndr/ndr_misc.h"
+#include "param/param.h"
+#include "dsdb/samdb/samdb.h"
+#include "dsdb/common/flags.h"
+
+/* add_record: add instancetype attribute */
+static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
+{
+       struct ldb_request *down_req;
+       struct ldb_message *msg;
+       uint32_t instance_type;
+       int ret;
+       const struct ldb_control *partition_ctrl;
+       const struct dsdb_control_current_partition *partition;
+
+       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "instancetype_add_record\n");
+
+       /* do not manipulate our control entries */
+       if (ldb_dn_is_special(req->op.add.message->dn)) {
+               return ldb_next_request(module, req);
+       }
+
+       partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
+       if (!partition_ctrl) {
+               ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
+                             "instancetype_add: no current partition control found");
+               return LDB_ERR_CONSTRAINT_VIOLATION;
+       }
+
+       partition = talloc_get_type(partition_ctrl->data,
+                                   struct dsdb_control_current_partition);
+       SMB_ASSERT(partition && partition->version == DSDB_CONTROL_CURRENT_PARTITION_VERSION);
+
+       down_req = talloc(req, struct ldb_request);
+       if (down_req == NULL) {
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
+
+       *down_req = *req;
+
+       /* we have to copy the message as the caller might have it as a const */
+       down_req->op.add.message = msg = ldb_msg_copy_shallow(down_req, req->op.add.message);
+       if (msg == NULL) {
+               talloc_free(down_req);
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
+
+       /*
+        * TODO: calculate correct instance type
+        */
+       instance_type = INSTANCE_TYPE_WRITE;
+       if (ldb_dn_compare(partition->dn, msg->dn) == 0) {
+               instance_type |= INSTANCE_TYPE_IS_NC_HEAD;
+               if (ldb_dn_compare(msg->dn, samdb_base_dn(module->ldb)) != 0) {
+                       instance_type |= INSTANCE_TYPE_NC_ABOVE;
+               }
+       }
+
+       ret = ldb_msg_add_fmt(msg, "instanceType", "%u", instance_type);
+       if (ret != LDB_SUCCESS) {
+               talloc_free(down_req);
+               ldb_oom(module->ldb);
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
+
+       ldb_set_timeout_from_prev_req(module->ldb, req, down_req);
+
+       /* go on with the call chain */
+       ret = ldb_next_request(module, down_req);
+
+       /* do not free down_req as the call results may be linked to it,
+        * it will be freed when the upper level request get freed */
+       if (ret == LDB_SUCCESS) {
+               req->handle = down_req->handle;
+       }
+
+       return ret;
+}
+
+static const struct ldb_module_ops instancetype_ops = {
+       .name          = "instancetype",
+       .add           = instancetype_add,
+};
+
+
+int ldb_instancetype_init(void)
+{
+       return ldb_register_module(&instancetype_ops);
+}
index 803d24e34ea79db557e5bf6698273ad07d1c60c2..b3fdffe5669f6c88cb02eb8f408bba2958ed947d 100644 (file)
@@ -279,6 +279,27 @@ static int linked_attributes_add(struct ldb_module *module, struct ldb_request *
        return setup_modifies(module->ldb, ac, ac, req->op.add.message, NULL, req->op.add.message->dn);
 }
 
+struct merge {
+       struct ldb_dn *dn;
+       bool add;
+       bool ignore;
+};
+
+static int merge_cmp(struct merge *merge1, struct merge *merge2) {
+       int ret;
+       ret = ldb_dn_compare(merge1->dn, merge2->dn);
+       if (ret == 0) {
+               if (merge1->add == merge2->add) {
+                       return 0;
+               }
+               if (merge1->add == true) {
+                       return 1;
+               }
+               return -1;
+       }
+       return ret;
+}
+
 static int linked_attributes_mod_replace_search_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) 
 {
        struct replace_context *ac2 = talloc_get_type(context, struct replace_context);
@@ -296,16 +317,63 @@ static int linked_attributes_mod_replace_search_callback(struct ldb_context *ldb
                
                /* See if this element already exists */
                if (search_el) {
-                       int ret;
+
+                       struct merge *merged_list = NULL;
+
+                       int ret, size = 0, i;
                        struct ldb_message *msg = ldb_msg_new(ac);
                        if (!msg) {
                                ldb_oom(ac->module->ldb);
                                return LDB_ERR_OPERATIONS_ERROR;
                        }
 
-                       /* Lazy option:  Delete and add the elements on all members */
-                       msg->num_elements = 1;
-                       msg->elements = search_el;
+                       /* Add all the existing elements, marking as 'proposed for delete' by setting .add = false */
+                       for (i=0; i < search_el->num_values; i++) {
+                               merged_list = talloc_realloc(ares, merged_list, struct merge, size + 1);
+                               merged_list[size].dn = ldb_dn_new(merged_list, ldb, (char *)search_el->values[i].data);
+                               merged_list[size].add = false;
+                               merged_list[size].ignore = false;
+                               size++;
+                       }
+
+                       /* Add all the new replacement elements, marking as 'proposed for add' by setting .add = true */
+                       for (i=0; i < ac2->el->num_values; i++) {
+                               merged_list = talloc_realloc(ares, merged_list, struct merge, size + 1);
+                               merged_list[size].dn = ldb_dn_new(merged_list, ldb, (char *)ac2->el->values[i].data);
+                               merged_list[size].add = true;
+                               merged_list[size].ignore = false;
+                               size++;
+                       }
+
+                       /* Sort the list, so we can pick out an add and delete for the same DN, and eliminate them */
+                       qsort(merged_list, size,
+                             sizeof(*merged_list),
+                             (comparison_fn_t)merge_cmp);
+
+                       /* Now things are sorted, it is trivial to mark pairs of DNs as 'ignore' */
+                       for (i=0; i + 1 < size; i++) {
+                               if (ldb_dn_compare(merged_list[i].dn, 
+                                                  merged_list[i+1].dn) == 0 
+                                   /* Fortunetly the sort also sorts 'add == false' first */
+                                   && merged_list[i].add == false
+                                   && merged_list[i+1].add == true) {
+
+                                       /* Mark as ignore, so we include neither in the actual operations */
+                                       merged_list[i].ignore = true;
+                                       merged_list[i+1].ignore = true;
+                               }
+                       }
+
+                       /* Arrange to delete anything the search found that we don't re-add */
+                       for (i=0; i < size; i++) {
+                               if (merged_list[i].ignore == false
+                                   && merged_list[i].add == false) {
+                                       ldb_msg_add_steal_string(msg, search_el->name, 
+                                                                ldb_dn_get_linearized(merged_list[i].dn));
+                               }
+                       }
+
+                       /* The DN to set on the linked attributes is the original DN of the modify message */
                        msg->dn = ac->orig_req->op.mod.message->dn;
                        
                        ret = setup_modifies(ac->module->ldb, ac2, ac, msg, ares->message->dn, NULL);
@@ -313,13 +381,21 @@ static int linked_attributes_mod_replace_search_callback(struct ldb_context *ldb
                                return ret;
                        }
 
-                       msg->elements = ac2->el;
+                       /* Now add links for all the actually new elements */
+                       for (i=0; i < size; i++) {
+                               if (merged_list[i].ignore == false && merged_list[i].add == true) {
+                                       ldb_msg_add_steal_string(msg, search_el->name, 
+                                                                ldb_dn_get_linearized(merged_list[i].dn));
+                               }
+                       }
 
                        ret = setup_modifies(ac->module->ldb, ac2, ac, msg, NULL, ares->message->dn);
                        if (ret != LDB_SUCCESS) {
                                return ret;
                        }
                        
+                       talloc_free(merged_list);
+
                } else {
                        /* Looks like it doesn't exist, process like an 'add' */
                        struct ldb_message *msg = ldb_msg_new(ac);
@@ -411,6 +487,7 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
                        return LDB_ERR_OBJECT_CLASS_VIOLATION;                  
                }
 
+               /* Replace with new set of values */
                if (((el->flags & LDB_FLAG_MOD_MASK) == LDB_FLAG_MOD_REPLACE)
                    && el->num_values > 0) {
                        struct replace_context *ac2 = talloc(ac, struct replace_context);
@@ -461,6 +538,8 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
                        }
                        
                        continue;
+
+                       /* Delete all values case */
                } else if (((el->flags & LDB_FLAG_MOD_MASK) & (LDB_FLAG_MOD_DELETE|LDB_FLAG_MOD_REPLACE)) 
                           && el->num_values == 0) {
                        const char **attrs = talloc_array(ac, const char *, 2);
@@ -508,7 +587,8 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
                        
                        continue;
                }
-               /* Prepare the modify (mod element) on the targets */
+
+               /* Prepare the modify (mod element) on the targets, for a normal modify request */
 
                /* For each value being moded, we need to setup the modify */
                for (j=0; j < el->num_values; j++) {
index d3beedc689ccb488d1c81f2ef921c19206de0ca9..737475ca78b24693bcfb7fd82e6a01b5a7fd9e40 100644 (file)
@@ -532,6 +532,10 @@ static int objectclass_do_add(struct ldb_handle *h)
                                        ldb_msg_add_string(msg, "objectCategory", 
                                                           current->objectclass->defaultObjectCategory);
                                }
+                               if (!ldb_msg_find_element(msg, "showInAdvancedViewOnly") && (current->objectclass->defaultHidingValue == true)) {
+                                       ldb_msg_add_string(msg, "showInAdvancedViewOnly", 
+                                                          "TRUE");
+                               }
                                if (!ldb_msg_find_element(msg, "nTSecurityDescriptor")) {
                                        DATA_BLOB *sd = get_sd(ac->module, mem_ctx, current->objectclass);
                                        ldb_msg_add_steal_value(msg, "nTSecurityDescriptor", sd);
index 6e66d0783a76d7fd92e1455a8b663ffb35e44a7f..acf2fd622cc29ddb04134ec055d5dba6e5d53b99 100644 (file)
@@ -448,6 +448,7 @@ static const char * const entryuuid_wildcard_attributes[] = {
        "whenChanged",
        "usnCreated",
        "usnChanged",
+       "memberOf",
        NULL
 };
 
index b534c9bc9f66aa65528294f5eac78e7ac7487dd5..604516ccf640a88d16d4b7c08fd2fc3195e80b12 100644 (file)
@@ -543,9 +543,7 @@ clean::
 
 #######################
 # Start SUBSYSTEM HEIMDAL
-[LIBRARY::HEIMDAL]
-VERSION = 0.0.1
-SO_VERSION = 0
+[SUBSYSTEM::HEIMDAL]
 CFLAGS = -Iheimdal_build
 OBJ_FILES = ../heimdal/lib/vers/print_version.o
 PUBLIC_DEPENDENCIES = \
index f81c2e3e16a7ff53839a589841158c0b6699004d..bbd4c1c5ebdc772baad3e28bc783d5645b8d58c8 100644 (file)
@@ -1,7 +1,4 @@
-#######################
-# Start LIBRARY swig_ldb
 [PYTHON::swig_ldb]
 PUBLIC_DEPENDENCIES = LIBLDB
+CFLAGS = -Ilib/ldb/include
 SWIG_FILE = ldb.i
-# End LIBRARY swig_ldb
-#######################
index 9751d2bf7349f14fc3b4049990f2e181bc2d13ae..b46f7c3ee7a2fa1cac6985f5b920efce6e3a6036 100644 (file)
@@ -1,9 +1,6 @@
 ##############################
 # Start SUBSYSTEM NSS_WRAPPER
-[LIBRARY::NSS_WRAPPER]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Wrapper library for testing nss calls without being root
+[SUBSYSTEM::NSS_WRAPPER]
 PUBLIC_HEADERS = nss_wrapper.h
 OBJ_FILES = nss_wrapper.o
 # End SUBSYSTEM NSS_WRAPPER
index f404d58377394124fa23e01b7218c8caa242a58d..aae98b86b2e899c0c4abea7954ddc2f23a7e3cb6 100644 (file)
@@ -1,4 +1,4 @@
-[LIBRARY::LIBPOLICY]
+[SUBSYSTEM::LIBPOLICY]
 CFLAGS = -Iheimdal/lib/roken
 OBJ_FILES = lex.o parse_adm.o 
 PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSAMBA-CONFIG LIBTALLOC CHARSET 
index a13e3753b7f0bac4010c0f351d6b76efdccd7a83..27cae8c49062ed9ba1ba670f47f3bc594b422763 100644 (file)
@@ -64,7 +64,7 @@ static WERROR reg_dir_del_key(const struct hive_key *k, const char *name)
        if (rmdir(child) == 0)
                ret = WERR_OK;
        else if (errno == ENOENT)
-               ret = WERR_NOT_FOUND;
+               ret = WERR_BADFILE;
        else
                ret = WERR_GENERAL_FAILURE;
 
@@ -282,7 +282,7 @@ static WERROR reg_dir_get_value(TALLOC_CTX *mem_ctx,
        contents = file_load(path, &size, mem_ctx);
        talloc_free(path);
        if (contents == NULL)
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
 
        if (type != NULL)
                *type = 4; /* FIXME */
@@ -339,7 +339,7 @@ static WERROR reg_dir_del_value (struct hive_key *key, const char *name)
        if (unlink(path) < 0) {
                talloc_free(path);
                if (errno == ENOENT)
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
                return WERR_GENERAL_FAILURE;
        }
        talloc_free(path);
index bbe510772cc9a714e90b631ef81229f261fc5ce7..5d56a30b3e14edaacfcaf4c80801cae9adaca9df 100644 (file)
@@ -41,7 +41,7 @@ _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
        fd = open(location, O_RDWR);
        if (fd == -1) {
                if (errno == ENOENT)
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
                return WERR_BADFILE;
        }
 
index 259315cc3955d93f87e776b9b8433084642c0af6..262859f64b4302395d04cf41f0d0e47b27a4cde1 100644 (file)
@@ -111,6 +111,15 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
        return msg;
 }
 
+static char *reg_ldb_escape(TALLOC_CTX *mem_ctx, const char *value)
+{
+       struct ldb_val val;
+
+       val.data = discard_const_p(uint8_t, value);
+       val.length = strlen(value);
+
+       return ldb_dn_escape_value(mem_ctx, val);
+}
 
 static int reg_close_ldb_key(struct ldb_key_data *key)
 {
@@ -159,7 +168,13 @@ static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx,
                else keyname = mypath;
 
                if(strlen(keyname)) {
-                       ldb_dn_add_base_fmt(ret, "key=%s", keyname);
+                       if (!ldb_dn_add_base_fmt(ret, "key=%s",
+                                                reg_ldb_escape(local_ctx,
+                                                               keyname)))
+                       {
+                               talloc_free(local_ctx);
+                               return NULL;
+                       }
                }
 
                if(begin) {
@@ -293,7 +308,7 @@ static WERROR ldb_get_value(TALLOC_CTX *mem_ctx, struct hive_key *k,
        }
 
        if (res->count == 0)
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
 
        reg_ldb_unpack_value(mem_ctx, res->msgs[0], NULL, data_type, data);
 
@@ -322,7 +337,7 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct hive_key *h,
                DEBUG(3, ("Key '%s' not found\n",
                        ldb_dn_get_linearized(ldap_path)));
                talloc_free(res);
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
        }
 
        newkd = talloc_zero(mem_ctx, struct ldb_key_data);
@@ -385,7 +400,7 @@ static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, const struct hive_key *parent,
                          struct security_descriptor *sd,
                          struct hive_key **newkey)
 {
-       const struct ldb_key_data *parentkd = (const struct ldb_key_data *)parent;
+       struct ldb_key_data *parentkd = (const struct ldb_key_data *)parent;
        struct ldb_message *msg;
        struct ldb_key_data *newkd;
        int ret;
@@ -400,8 +415,12 @@ static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, const struct hive_key *parent,
                                   talloc_strdup(mem_ctx, classname));
 
        ret = ldb_add(parentkd->ldb, msg);
-       if (ret < 0) {
-               DEBUG(1, ("ldb_msg_add: %s\n", ldb_errstring(parentkd->ldb)));
+       if (ret == LDB_ERR_ENTRY_ALREADY_EXISTS) {
+               return WERR_ALREADY_EXISTS;
+       }
+
+       if (ret != LDB_SUCCESS) {
+               DEBUG(1, ("ldb_add: %s\n", ldb_errstring(parentkd->ldb)));
                return WERR_FOOBAR;
        }
 
@@ -414,29 +433,37 @@ static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, const struct hive_key *parent,
 
        *newkey = (struct hive_key *)newkd;
 
+       /* reset cache */
+       talloc_free(parentkd->subkeys);
+       parentkd->subkeys = NULL;
+
        return WERR_OK;
 }
 
-static WERROR ldb_del_key(const struct hive_key *key, const char *child)
+static WERROR ldb_del_key(const struct hive_key *key, const char *name)
 {
        int ret;
        struct ldb_key_data *parentkd = talloc_get_type(key, struct ldb_key_data);
-       struct ldb_dn *childdn;
+       struct ldb_dn *ldap_path;
+       TALLOC_CTX *mem_ctx = talloc_init("ldb_del_key");
 
-       childdn = ldb_dn_copy(parentkd->ldb, parentkd->dn);
-       ldb_dn_add_child_fmt(childdn, "key=%s", child);
+       ldap_path = reg_path_to_ldb(mem_ctx, key, name, NULL);
 
-       ret = ldb_delete(parentkd->ldb, childdn);
+       ret = ldb_delete(parentkd->ldb, ldap_path);
 
-       talloc_free(childdn);
+       talloc_free(mem_ctx);
 
        if (ret == LDB_ERR_NO_SUCH_OBJECT) {
-               return WERR_NOT_FOUND;
-       } else if (ret < 0) {
+               return WERR_BADFILE;
+       } else if (ret != LDB_SUCCESS) {
                DEBUG(1, ("ldb_del_key: %s\n", ldb_errstring(parentkd->ldb)));
                return WERR_FOOBAR;
        }
 
+       /* reset cache */
+       talloc_free(parentkd->subkeys);
+       parentkd->subkeys = NULL;
+
        return WERR_OK;
 }
 
@@ -447,19 +474,28 @@ static WERROR ldb_del_value (struct hive_key *key, const char *child)
        struct ldb_dn *childdn;
 
        childdn = ldb_dn_copy(kd->ldb, kd->dn);
-       ldb_dn_add_child_fmt(childdn, "value=%s", child);
+       if (!ldb_dn_add_child_fmt(childdn, "value=%s",
+                                 reg_ldb_escape(childdn, child)))
+       {
+               talloc_free(childdn);
+               return WERR_FOOBAR;
+       }
 
        ret = ldb_delete(kd->ldb, childdn);
 
        talloc_free(childdn);
 
        if (ret == LDB_ERR_NO_SUCH_OBJECT) {
-               return WERR_NOT_FOUND;
-       } else if (ret < 0) {
+               return WERR_BADFILE;
+       } else if (ret != LDB_SUCCESS) {
                DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb)));
                return WERR_FOOBAR;
        }
 
+       /* reset cache */
+       talloc_free(kd->values);
+       kd->values = NULL;
+
        return WERR_OK;
 }
 
@@ -475,18 +511,32 @@ static WERROR ldb_set_value(struct hive_key *parent,
        msg = reg_ldb_pack_value(kd->ldb, mem_ctx, name, type, data);
 
        msg->dn = ldb_dn_copy(msg, kd->dn);
-       ldb_dn_add_child_fmt(msg->dn, "value=%s", name);
+       if (!ldb_dn_add_child_fmt(msg->dn, "value=%s",
+                                 reg_ldb_escape(mem_ctx, name)))
+       {
+               talloc_free(mem_ctx);
+               return WERR_FOOBAR;
+       }
 
        ret = ldb_add(kd->ldb, msg);
-       if (ret < 0) {
-               ret = ldb_modify(kd->ldb, msg);
-               if (ret < 0) {
-                       DEBUG(1, ("ldb_msg_add: %s\n", ldb_errstring(kd->ldb)));
-                       talloc_free(mem_ctx);
-                       return WERR_FOOBAR;
+       if (ret == LDB_ERR_ENTRY_ALREADY_EXISTS) {
+               int i;
+               for (i = 0; i < msg->num_elements; i++) {
+                       msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
                }
+               ret = ldb_modify(kd->ldb, msg);
+       }
+
+       if (ret != LDB_SUCCESS) {
+               DEBUG(1, ("ldb_msg_add: %s\n", ldb_errstring(kd->ldb)));
+               talloc_free(mem_ctx);
+               return WERR_FOOBAR;
        }
 
+       /* reset cache */
+       talloc_free(kd->values);
+       kd->values = NULL;
+
        talloc_free(mem_ctx);
        return WERR_OK;
 }
@@ -503,17 +553,23 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
 {
        struct ldb_key_data *kd = talloc_get_type(key, struct ldb_key_data);
 
+       if (kd->subkeys == NULL) {
+               W_ERROR_NOT_OK_RETURN(cache_subkeys(kd));
+       }
+
+       if (kd->values == NULL) {
+               W_ERROR_NOT_OK_RETURN(cache_values(kd));
+       }
+
        /* FIXME */
        if (classname != NULL)
                *classname = NULL;
 
        if (num_subkeys != NULL) {
-               W_ERROR_NOT_OK_RETURN(cache_subkeys(kd));
                *num_subkeys = kd->subkey_count;
        }
 
        if (num_values != NULL) {
-               W_ERROR_NOT_OK_RETURN(cache_values(kd));
                *num_values = kd->value_count;
        }
 
@@ -523,7 +579,6 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
        if (max_subkeynamelen != NULL) {
                int i;
                struct ldb_message_element *el;
-               W_ERROR_NOT_OK_RETURN(cache_subkeys(kd));
 
                *max_subkeynamelen = 0;
 
index fa59f255966c0154fd870f2f0499efd0dc9d86e6..3e463100c9cb80380f02066cfd3b6a45010f8c91 100644 (file)
@@ -140,7 +140,7 @@ WERROR local_get_predefined_key(struct registry_context *ctx,
        }
 
        if (mp == NULL)
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
 
        *key = reg_import_hive_key(ctx, mp->key,
                                   mp->path.predefined_key,
index b6ad7dfb1099c72eed4ccdbcd20f8ee80547e7f4..fa1367bbd2cd38f37a8c359e254ec6e84d747269 100644 (file)
@@ -82,11 +82,11 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
                        if (W_ERROR_IS_OK(error2))
                                continue;
                } else {
-                       error2 = WERR_DEST_NOT_FOUND;
+                       error2 = WERR_BADFILE;
                        t2 = NULL;
                }
 
-               if (!W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
+               if (!W_ERROR_EQUAL(error2, WERR_BADFILE)) {
                        DEBUG(0, ("Error occured while getting subkey by name: %s\n",
                                win_errstr(error2)));
                        talloc_free(mem_ctx);
@@ -132,10 +132,10 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
                                continue;
                } else {
                        t1 = NULL;
-                       error2 = WERR_DEST_NOT_FOUND;
+                       error2 = WERR_BADFILE;
                }
 
-               if (!W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
+               if (!W_ERROR_EQUAL(error2, WERR_BADFILE)) {
                        DEBUG(0, ("Error occured while getting subkey by name: %s\n",
                                win_errstr(error2)));
                        talloc_free(mem_ctx);
@@ -174,10 +174,10 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
                                                           name, &type2,
                                                           &contents2);
                } else
-                       error2 = WERR_DEST_NOT_FOUND;
+                       error2 = WERR_BADFILE;
 
                if(!W_ERROR_IS_OK(error2) &&
-                  !W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
+                  !W_ERROR_EQUAL(error2, WERR_BADFILE)) {
                        DEBUG(0, ("Error occured while getting value by name: %s\n",
                                win_errstr(error2)));
                        talloc_free(mem_ctx);
@@ -210,7 +210,7 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
                if (W_ERROR_IS_OK(error2))
                        continue;
 
-               if (!W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
+               if (!W_ERROR_EQUAL(error2, WERR_BADFILE)) {
                        DEBUG(0, ("Error occured while getting value by name: %s\n",
                                win_errstr(error2)));
                        return error2;
@@ -238,14 +238,14 @@ _PUBLIC_ WERROR reg_generate_diff(struct registry_context *ctx1,
                struct registry_key *r1 = NULL, *r2 = NULL;
                error = reg_get_predefined_key(ctx1, i, &r1);
                if (!W_ERROR_IS_OK(error) &&
-                   !W_ERROR_EQUAL(error, WERR_NOT_FOUND)) {
+                   !W_ERROR_EQUAL(error, WERR_BADFILE)) {
                        DEBUG(0, ("Unable to open hive %s for backend 1\n",
                                reg_get_predef_name(i)));
                }
 
                error = reg_get_predefined_key(ctx2, i, &r2);
                if (!W_ERROR_IS_OK(error) &&
-                   !W_ERROR_EQUAL(error, WERR_NOT_FOUND)) {
+                   !W_ERROR_EQUAL(error, WERR_BADFILE)) {
                        DEBUG(0, ("Unable to open hive %s for backend 2\n",
                                reg_get_predef_name(i)));
                }
@@ -356,7 +356,7 @@ static WERROR reg_diff_apply_set_value(void *_ctx, const char *path,
        /* Open key */
        error = reg_open_key_abs(ctx, ctx, path, &tmp);
 
-       if (W_ERROR_EQUAL(error, WERR_DEST_NOT_FOUND)) {
+       if (W_ERROR_EQUAL(error, WERR_BADFILE)) {
                DEBUG(0, ("Error opening key '%s'\n", path));
                return error;
        }
index 9b126cc8084fe4d08748c6ce000ee5138dd3e224..15b60745f05612dea2b5d9ebdd06b6d161743d03 100644 (file)
@@ -575,7 +575,7 @@ static WERROR regf_get_value_by_name(TALLOC_CTX *mem_ctx,
        }
 
        if (W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS))
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
 
        return error;
 }
@@ -870,7 +870,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx,
                                break;
                }
                if (key_off == 0)
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
        } else if (!strncmp((char *)data.data, "lf", 2)) {
                struct lf_block lf;
                struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience);
@@ -905,7 +905,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx,
                                break;
                }
                if (key_off == 0)
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
        } else if (!strncmp((char *)data.data, "lh", 2)) {
                struct lh_block lh;
                struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience);
@@ -942,7 +942,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx,
                                break;
                }
                if (key_off == 0)
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
        } else if (!strncmp((char *)data.data, "ri", 2)) {
                struct ri_block ri;
                struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience);
@@ -1022,7 +1022,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx,
                }
                talloc_free(pull);
                if (!key_off)
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
        } else {
                DEBUG(0, ("Unknown subkey list type.\n"));
                return WERR_GENERAL_FAILURE;
@@ -1419,7 +1419,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset,
                }
                if (!found_offset) {
                        DEBUG(2, ("Subkey not found\n"));
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
                }
                li.key_count--;
 
@@ -1464,7 +1464,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset,
                }
                if (!found_offset) {
                        DEBUG(2, ("Subkey not found\n"));
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
                }
                lf.key_count--;
 
@@ -1510,7 +1510,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset,
                }
                if (!found_offset) {
                        DEBUG(0, ("Subkey not found\n"));
-                       return WERR_NOT_FOUND;
+                       return WERR_BADFILE;
                }
                lh.key_count--;
 
@@ -1548,7 +1548,7 @@ static WERROR regf_del_value (struct hive_key *key, const char *name)
        uint32_t i;
 
        if (nk->values_offset == -1) {
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
        }
 
        values = hbin_get(regf, nk->values_offset);
@@ -1572,7 +1572,7 @@ static WERROR regf_del_value (struct hive_key *key, const char *name)
                }
        }
        if (!found_offset) {
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
        } else {
                nk->num_values--;
                values.length = (nk->num_values)*4;
@@ -1608,14 +1608,14 @@ static WERROR regf_del_key(const struct hive_key *parent, const char *name)
 
        if (parent_nk->subkeys_offset == -1) {
                DEBUG(4, ("Subkey list is empty, this key cannot contain subkeys.\n"));
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
        }
 
        /* Find the key */
        if (!W_ERROR_IS_OK(regf_get_subkey_by_name(parent_nk, parent, name,
                                                   (struct hive_key **)&key))) {
                DEBUG(2, ("Key '%s' not found\n", name));
-               return WERR_NOT_FOUND;
+               return WERR_BADFILE;
        }
 
        if (key->nk->subkeys_offset != -1 ||
index 02f3363bab97366e806eaf393425c5e1854cb7bf..599385e73c210819a59d539aae946966fe4421ed 100644 (file)
@@ -42,7 +42,7 @@ static WERROR mount_samba_hive(struct registry_context *ctx,
 
        error = reg_open_hive(ctx, location, auth_info, creds, lp_ctx, &hive);
 
-       if (W_ERROR_EQUAL(error, WERR_NOT_FOUND))
+       if (W_ERROR_EQUAL(error, WERR_BADFILE))
                error = reg_open_ldb_file(ctx, location, auth_info,
                                          creds, lp_ctx, &hive);
 
index 22b4785222567f0b71238e32a4204f12e4930bfb..4d27e83a74747375a245906f48b7e369318f5ad4 100644 (file)
@@ -31,7 +31,7 @@ static bool test_del_nonexistant_key(struct torture_context *tctx,
 {
        const struct hive_key *root = (const struct hive_key *)test_data;
        WERROR error = hive_key_del(root, "bla");
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "invalid return code");
 
        return true;
@@ -134,7 +134,7 @@ static bool test_del_key(struct torture_context *tctx, const void *test_data)
        torture_assert_werr_ok(tctx, error, "reg_key_del");
 
        error = hive_key_del(root, "Nested Key");
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "reg_key_del");
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE, "reg_key_del");
 
        return true;
 }
@@ -174,7 +174,7 @@ static bool test_get_value(struct torture_context *tctx, const void *test_data)
        torture_assert_werr_ok(tctx, error, "hive_key_add_name");
 
        error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value);
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "getting missing value");
 
        error = hive_key_set_value(subkey, "Answer", REG_DWORD,
@@ -215,10 +215,10 @@ static bool test_del_value(struct torture_context *tctx, const void *test_data)
        torture_assert_werr_ok(tctx, error, "deleting value");
 
        error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value);
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "getting value");
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE, "getting value");
 
        error = hive_key_del_value(subkey, "Answer");
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "deleting value");
 
        return true;
index 75fbe1cbea8bca48d2815d97b84e5387d132ac17..7d14b3a4121d4c5d5246ed98daf094d537960d2b 100644 (file)
@@ -53,7 +53,7 @@ static bool test_get_predefined_unknown(struct torture_context *tctx,
        WERROR error;
 
        error = reg_get_predefined_key(rctx, 1337, &root);
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "getting predefined key failed");
        return true;
 }
@@ -195,16 +195,16 @@ static bool test_del_key(struct torture_context *tctx, void *_data)
        torture_assert_werr_ok(tctx, error,
                               "getting predefined key failed");
 
-       error = reg_key_add_name(rctx, root, "Hamburg", NULL, NULL, &newkey);
+       error = reg_key_add_name(rctx, root, "Polen", NULL, NULL, &newkey);
 
        torture_assert_werr_ok(tctx, error, "Creating key return code");
        torture_assert(tctx, newkey != NULL, "Creating new key");
 
-       error = reg_key_del(root, "Hamburg");
+       error = reg_key_del(root, "Polen");
        torture_assert_werr_ok(tctx, error, "Delete key");
 
-       error = reg_key_del(root, "Hamburg");
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       error = reg_key_del(root, "Polen");
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "Delete missing key");
 
        return true;
@@ -239,7 +239,7 @@ static bool test_flush_key(struct torture_context *tctx, void *_data)
        struct registry_key *root, *subkey;
        WERROR error;
 
-       if (!create_test_key(tctx, rctx, "Munchen", &root, &subkey))
+       if (!create_test_key(tctx, rctx, "Bremen", &root, &subkey))
                return false;
 
        error = reg_key_flush(subkey);
@@ -416,7 +416,7 @@ static bool test_get_value(struct torture_context *tctx, void *_data)
 
        error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type,
                                          &data);
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "getting missing value");
 
        error = reg_val_set(subkey, __FUNCTION__, REG_DWORD,
@@ -447,12 +447,12 @@ static bool test_del_value(struct torture_context *tctx, void *_data)
        uint32_t value = 42;
        uint32_t type;
 
-       if (!create_test_key(tctx, rctx, "Duisburg", &root, &subkey))
+       if (!create_test_key(tctx, rctx, "Warschau", &root, &subkey))
                return false;
 
        error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type,
                                          &data);
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "getting missing value");
 
        error = reg_val_set(subkey, __FUNCTION__, REG_DWORD,
@@ -464,7 +464,7 @@ static bool test_del_value(struct torture_context *tctx, void *_data)
 
        error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__,
                                          &type, &data);
-       torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+       torture_assert_werr_equal(tctx, error, WERR_BADFILE,
                                  "getting missing value");
 
        return true;
index 76f1ce50967eda142cf5c2d9942369fe1e0d3c5d..705bdd40026a05a42c4bdde16b10cc32ec97fc84 100644 (file)
@@ -1,9 +1,6 @@
 ################################################
 # Start SUBSYSTEM LIBSAMBA3
-[LIBRARY::LIBSAMBA3]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Library for reading Samba3 data files
+[SUBSYSTEM::LIBSAMBA3]
 PRIVATE_PROTO_HEADER = samba3_proto.h
 PUBLIC_HEADERS = samba3.h
 OBJ_FILES = tdbsam.o policy.o \
index 9e194230dc1ebd63a5e8ec028918783f431dd998..4c5cf9434855e563b71dae5ee9539c8a095d519d 100644 (file)
@@ -1,9 +1,6 @@
 ##############################
 # Start SUBSYSTEM SOCKET_WRAPPER
-[LIBRARY::SOCKET_WRAPPER]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Wrapper library for testing TCP/IP connections using Unix Sockets
+[SUBSYSTEM::SOCKET_WRAPPER]
 PUBLIC_HEADERS = socket_wrapper.h
 OBJ_FILES = socket_wrapper.o
 PRIVATE_DEPENDENCIES = EXT_SOCKET
index c086c151fa686ceafd421c563313a734bf6d279f..2f2a4c379b0690399a9f4065b15960e667300bf0 100644 (file)
@@ -208,62 +208,61 @@ update:
 }
 
 
+
 /* 
    the core of tdb_allocate - called when we have decided which
    free list entry to use
+
+   Note that we try to allocate by grabbing data from the end of an existing record,
+   not the beginning. This is so the left merge in a free is more likely to be
+   able to free up the record without fragmentation
  */
-static tdb_off_t tdb_allocate_ofs(struct tdb_context *tdb, tdb_len_t length, tdb_off_t rec_ptr,
-                               struct list_struct *rec, tdb_off_t last_ptr)
+static tdb_off_t tdb_allocate_ofs(struct tdb_context *tdb, 
+                                 tdb_len_t length, tdb_off_t rec_ptr,
+                                 struct list_struct *rec, tdb_off_t last_ptr)
 {
-       struct list_struct newrec;
-       tdb_off_t newrec_ptr;
+#define MIN_REC_SIZE (sizeof(struct list_struct) + sizeof(tdb_off_t) + 8)
 
-       memset(&newrec, '\0', sizeof(newrec));
+       if (rec->rec_len < length + MIN_REC_SIZE) {
+               /* we have to grab the whole record */
 
-       /* found it - now possibly split it up  */
-       if (rec->rec_len > length + MIN_REC_SIZE) {
-               /* Length of left piece */
-               length = TDB_ALIGN(length, TDB_ALIGNMENT);
-               
-               /* Right piece to go on free list */
-               newrec.rec_len = rec->rec_len - (sizeof(*rec) + length);
-               newrec_ptr = rec_ptr + sizeof(*rec) + length;
-               
-               /* And left record is shortened */
-               rec->rec_len = length;
-       } else {
-               newrec_ptr = 0;
+               /* unlink it from the previous record */
+               if (tdb_ofs_write(tdb, last_ptr, &rec->next) == -1) {
+                       return 0;
+               }
+
+               /* mark it not free */
+               rec->magic = TDB_MAGIC;
+               if (tdb_rec_write(tdb, rec_ptr, rec) == -1) {
+                       return 0;
+               }
+               return rec_ptr;
+       }
+
+       /* we're going to just shorten the existing record */
+       rec->rec_len -= (length + sizeof(*rec));
+       if (tdb_rec_write(tdb, rec_ptr, rec) == -1) {
+               return 0;
        }
-       
-       /* Remove allocated record from the free list */
-       if (tdb_ofs_write(tdb, last_ptr, &rec->next) == -1) {
+       if (update_tailer(tdb, rec_ptr, rec) == -1) {
                return 0;
        }
-       
-       /* Update header: do this before we drop alloc
-          lock, otherwise tdb_free() might try to
-          merge with us, thinking we're free.
-          (Thanks Jeremy Allison). */
+
+       /* and setup the new record */
+       rec_ptr += sizeof(*rec) + rec->rec_len; 
+
+       memset(rec, '\0', sizeof(*rec));
+       rec->rec_len = length;
        rec->magic = TDB_MAGIC;
+
        if (tdb_rec_write(tdb, rec_ptr, rec) == -1) {
                return 0;
        }
-       
-       /* Did we create new block? */
-       if (newrec_ptr) {
-               /* Update allocated record tailer (we
-                  shortened it). */
-               if (update_tailer(tdb, rec_ptr, rec) == -1) {
-                       return 0;
-               }
-               
-               /* Free new record */
-               if (tdb_free(tdb, newrec_ptr, &newrec) == -1) {
-                       return 0;
-               }
+
+       if (update_tailer(tdb, rec_ptr, rec) == -1) {
+               return 0;
        }
-       
-       /* all done - return the new record offset */
+
        return rec_ptr;
 }
 
@@ -287,6 +286,7 @@ tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_st
 
        /* Extra bytes required for tailer */
        length += sizeof(tdb_off_t);
+       length = TDB_ALIGN(length, TDB_ALIGNMENT);
 
  again:
        last_ptr = FREELIST_TOP;
@@ -343,7 +343,8 @@ tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_st
                        goto fail;
                }
 
-               newrec_ptr = tdb_allocate_ofs(tdb, length, bestfit.rec_ptr, rec, bestfit.last_ptr);
+               newrec_ptr = tdb_allocate_ofs(tdb, length, bestfit.rec_ptr, 
+                                             rec, bestfit.last_ptr);
                tdb_unlock(tdb, -1, F_WRLCK);
                return newrec_ptr;
        }
index 6bd8fda2bf1a4a5212578bfcc60edcf74bd76f93..b19e4cea293df769a588db89c71df25529d677ec 100644 (file)
@@ -179,9 +179,7 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
                tdb->page_size = 0x2000;
        }
 
-       if (open_flags & TDB_VOLATILE) {
-               tdb->max_dead_records = 5;
-       }
+       tdb->max_dead_records = (tdb_flags & TDB_VOLATILE) ? 5 : 0;
 
        if ((open_flags & O_ACCMODE) == O_WRONLY) {
                TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: can't open tdb %s write-only\n",
@@ -229,6 +227,7 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 
        /* we need to zero database if we are the only one with it open */
        if ((tdb_flags & TDB_CLEAR_IF_FIRST) &&
+           (!tdb->read_only) &&
            (locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0))) {
                open_flags |= O_CREAT;
                if (ftruncate(tdb->fd, 0) == -1) {
@@ -288,7 +287,6 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
        tdb->map_size = st.st_size;
        tdb->device = st.st_dev;
        tdb->inode = st.st_ino;
-       tdb->max_dead_records = 0;
        tdb_mmap(tdb);
        if (locked) {
                if (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0, 1) == -1) {
index fd4e1cc8af2d36f6c09c4e9f71a54edd980b37a9..ea5d9ccc6014ff9cd205e42579b48ed1c3390093 100644 (file)
@@ -743,45 +743,3 @@ failed:
        tdb_unlockall(tdb);
        return -1;
 }
-
-
-/* 
-   validate the integrity of all tdb hash chains. Useful when debugging
- */
-int tdb_validate(struct tdb_context *tdb)
-{
-       int h;
-       for (h=-1;h<(int)tdb->header.hash_size;h++) {
-               tdb_off_t rec_ptr;
-               uint32_t count = 0;
-               if (tdb_ofs_read(tdb, TDB_HASH_TOP(h), &rec_ptr) == -1) {
-                       TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed ofs_read at top of hash %d\n", h));
-                       return -1;
-               }
-               while (rec_ptr) {
-                       struct list_struct r;
-                       tdb_off_t size;
-
-                       if (tdb_rec_read(tdb, rec_ptr, &r) == -1) {
-                               TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed rec_read h=%d rec_ptr=%u count=%u\n",
-                                        h, rec_ptr, count));
-                               return -1;
-                       }
-                       if (tdb_ofs_read(tdb, rec_ptr + sizeof(r) + r.rec_len - sizeof(tdb_off_t), &size) == -1) {
-                               TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed ofs_read h=%d rec_ptr=%u count=%u\n",
-                                        h, rec_ptr, count));
-                               return -1;
-                       }
-                       if (size != r.rec_len + sizeof(r)) {
-                               TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed size check size=%u h=%d rec_ptr=%u count=%u\n",
-                                        size, h, rec_ptr, count));
-                               return -1;
-                       }
-                       rec_ptr = r.next;
-                       count++;
-               }               
-       }
-       return 0;
-}
-
-
index 63a6d04e72d00db22f8c87c6cf3222963f1d1562..ffac89ff0e315195b3defdebc35184ef7ab6a038 100644 (file)
@@ -49,7 +49,6 @@ typedef uint32_t tdb_off_t;
 #define TDB_DEAD_MAGIC (0xFEE1DEAD)
 #define TDB_RECOVERY_MAGIC (0xf53bc0e7U)
 #define TDB_ALIGNMENT 4
-#define MIN_REC_SIZE (2*sizeof(struct list_struct) + TDB_ALIGNMENT)
 #define DEFAULT_HASH_SIZE 131
 #define FREELIST_TOP (sizeof(struct tdb_header))
 #define TDB_ALIGN(x,a) (((x) + (a)-1) & ~((a)-1))
@@ -178,6 +177,7 @@ struct tdb_context {
 int tdb_munmap(struct tdb_context *tdb);
 void tdb_mmap(struct tdb_context *tdb);
 int tdb_lock(struct tdb_context *tdb, int list, int ltype);
+int tdb_lock_nonblock(struct tdb_context *tdb, int list, int ltype);
 int tdb_unlock(struct tdb_context *tdb, int list, int ltype);
 int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int probe, size_t len);
 int tdb_transaction_lock(struct tdb_context *tdb, int ltype);
index 0ecfb9b7ff610f9665ba7e53ae6eef78f71c98a3..c3e7a4e2c065d55492fbc9ddb3c1ff6946bf7057 100644 (file)
@@ -219,9 +219,12 @@ static int transaction_write(struct tdb_context *tdb, tdb_off_t off,
                uint8_t **new_blocks;
                /* expand the blocks array */
                if (tdb->transaction->blocks == NULL) {
-                       new_blocks = malloc((blk+1)*sizeof(uint8_t *));
+                       new_blocks = (uint8_t **)malloc(
+                               (blk+1)*sizeof(uint8_t *));
                } else {
-                       new_blocks = realloc(tdb->transaction->blocks, (blk+1)*sizeof(uint8_t *));
+                       new_blocks = (uint8_t **)realloc(
+                               tdb->transaction->blocks,
+                               (blk+1)*sizeof(uint8_t *));
                }
                if (new_blocks == NULL) {
                        tdb->ecode = TDB_ERR_OOM;
@@ -316,25 +319,15 @@ static int transaction_write_existing(struct tdb_context *tdb, tdb_off_t off,
                return 0;
        }
 
-       /* overwrite part of an existing block */
-       if (buf == NULL) {
-               memset(tdb->transaction->blocks[blk] + off, 0, len);
-       } else {
-               memcpy(tdb->transaction->blocks[blk] + off, buf, len);
-       }
-       if (blk == tdb->transaction->num_blocks-1) {
-               if (len + off > tdb->transaction->last_block_size) {
-                       tdb->transaction->last_block_size = len + off;
-               }
+       if (blk == tdb->transaction->num_blocks-1 &&
+           off + len > tdb->transaction->last_block_size) {
+               len = tdb->transaction->last_block_size - off;
        }
 
-       return 0;
+       /* overwrite part of an existing block */
+       memcpy(tdb->transaction->blocks[blk] + off, buf, len);
 
-fail:
-       TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_write: failed at off=%d len=%d\n", 
-                (blk*tdb->transaction->block_size) + off, len));
-       tdb->transaction->transaction_error = 1;
-       return -1;
+       return 0;
 }
 
 
index 2bde1270a078f2df05ddf235fb14cd6fd5218df0..07b0c238587eb85fe3945b61b71dbd9dd0729d58 100644 (file)
@@ -223,6 +223,9 @@ int tdb_traverse_read(struct tdb_context *tdb,
 /*
   a write style traverse - needs to get the transaction lock to
   prevent deadlocks
+
+  WARNING: The data buffer given to the callback fn does NOT meet the
+  alignment restrictions malloc gives you.
 */
 int tdb_traverse(struct tdb_context *tdb, 
                 tdb_traverse_func fn, void *private_data)
index b31ce36ab149b7416043990de4f2eda528e66637..63fcf5e049b13ef01fc3cae78c7326be332287a8 100644 (file)
@@ -130,6 +130,9 @@ int tdb_traverse(TDB_CONTEXT *tdb, int (*fn)(TDB_CONTEXT *tdb,
    a non-zero return value from fn() indicates that the traversal
    should stop. Traversal callbacks may not start transactions.
 
+   WARNING: The data buffer given to the callback fn does NOT meet the
+   alignment restrictions malloc gives you.
+
 ----------------------------------------------------------------------
 int tdb_traverse_read(TDB_CONTEXT *tdb, int (*fn)(TDB_CONTEXT *tdb,
                      TDB_DATA key, TDB_DATA dbuf, void *state), void *state);
index 0058d55793efcd4ad83a1edea692882143be2709..0008085de540b525bb02fc1ff178d06bc898a02d 100644 (file)
@@ -32,9 +32,9 @@ extern "C" {
 
 
 /* flags to tdb_store() */
-#define TDB_REPLACE 1
-#define TDB_INSERT 2
-#define TDB_MODIFY 3
+#define TDB_REPLACE 1          /* Unused */
+#define TDB_INSERT 2           /* Don't overwrite an existing entry */
+#define TDB_MODIFY 3           /* Don't create an existing entry    */
 
 /* flags for tdb_open() */
 #define TDB_DEFAULT 0 /* just a readability place holder */
@@ -157,7 +157,6 @@ int tdb_printfreelist(struct tdb_context *tdb);
 int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries);
 int tdb_wipe_all(struct tdb_context *tdb);
 int tdb_freelist_size(struct tdb_context *tdb);
-int tdb_validate(struct tdb_context *tdb);
 
 extern TDB_DATA tdb_null;
 
index 79435a3571cf61f02233d088e7ce3f01354b19af..d104ccd7c44994e9d0f8ba138cbf4584343983dc 100644 (file)
@@ -135,7 +135,7 @@ static void print_data(const char *buf,int len)
        if (len<=0) return;
        printf("[%03X] ",i);
        for (i=0;i<len;) {
-               printf("%02X ",(int)buf[i]);
+               printf("%02X ",(int)((unsigned char)buf[i]));
                i++;
                if (i%8 == 0) printf(" ");
                if (i%16 == 0) {      
index f0e24c54b4aa39a5cd11bde1aeaf7c268cee02b7..b8473e5ba8376f326c0cdba1945835b6143bf2f1 100644 (file)
@@ -1,9 +1,6 @@
-[LIBRARY::TDR]
+[SUBSYSTEM::TDR]
 CFLAGS = -Ilib/tdr
 PUBLIC_HEADERS = tdr.h
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Simple marshall/unmarshall library
 PUBLIC_PROTO_HEADER = tdr_proto.h
 PUBLIC_DEPENDENCIES = LIBTALLOC LIBSAMBA-UTIL
 OBJ_FILES = tdr.o
index eb3c56cf7f6f7a4b8ab219450ef9141789d140e1..a538d607bbfa09fac69eec2abf946c299d194dd6 100644 (file)
@@ -50,17 +50,13 @@ OBJ_FILES = \
 PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT LIBCLI_COMPOSITE LIBEVENTS \
        NDR_SECURITY samba-socket LIBSAMBA-UTIL
 
-[LIBRARY::swig_libcli_nbt]
-LIBRARY_REALNAME = swig/_libcli_nbt.$(SHLIBEXT)
-OBJ_FILES = swig/libcli_nbt_wrap.o
+[PYTHON::python_libcli_nbt]
+SWIG_FILE = swig/libcli_nbt.i
 PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-CONFIG
-ENABLE = NO
 
-[LIBRARY::swig_libcli_smb]
-LIBRARY_REALNAME = swig/_libcli_smb.$(SHLIBEXT)
-OBJ_FILES = swig/libcli_smb_wrap.o
+[PYTHON::python_libcli_smb]
+SWIG_FILE = swig/libcli_smb.i
 PUBLIC_DEPENDENCIES = LIBCLI_SMB DYNCONFIG LIBSAMBA-CONFIG
-ENABLE = NO
 
 [SUBSYSTEM::LIBCLI_DGRAM]
 OBJ_FILES = \
@@ -71,20 +67,14 @@ OBJ_FILES = \
        dgram/browse.o
 PUBLIC_DEPENDENCIES = LIBCLI_NBT LIBNDR LIBCLI_RESOLVE
 
-[LIBRARY::LIBCLI_CLDAP]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = CLDAP client library
+[SUBSYSTEM::LIBCLI_CLDAP]
 OBJ_FILES = cldap/cldap.o
 PUBLIC_HEADERS = cldap/cldap.h
 PUBLIC_DEPENDENCIES = LIBCLI_LDAP
 PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBLDB
 
-[LIBRARY::LIBCLI_WREPL]
+[SUBSYSTEM::LIBCLI_WREPL]
 PRIVATE_PROTO_HEADER = wrepl/winsrepl_proto.h
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = WINS Replication client library
 OBJ_FILES = \
        wrepl/winsrepl.o
 PUBLIC_DEPENDENCIES = NDR_WINSREPL samba-socket LIBCLI_RESOLVE LIBEVENTS \
@@ -112,12 +102,9 @@ OBJ_FILES = \
        finddcs.o
 PUBLIC_DEPENDENCIES = LIBCLI_NBT MESSAGING
 
-[LIBRARY::LIBCLI_SMB]
+[SUBSYSTEM::LIBCLI_SMB]
 PUBLIC_HEADERS = libcli.h
 PUBLIC_PROTO_HEADER = libcli_proto.h
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = SMB/CIFS client library
 OBJ_FILES = clireadwrite.o \
                cliconnect.o \
                clifile.o \
index 6fd85c2b8cd374d3786198712b55dfaa248fbc69..827230b113912af612e2202525864cf2afbe853e 100644 (file)
@@ -31,6 +31,7 @@
 #include "lib/talloc/talloc.h"
 #include "libcli/nbt/libnbt.h"
 #include "param/param.h"
+#include "lib/events/events.h"
 
 /* Undo strcpy safety macro as it's used by swig )-: */
 
index 938ab382f6b2e14ddf4fe5caec9142198a99be63..b49e240bc287bbaf358b91fb815e958f6359391e 100644 (file)
@@ -2,7 +2,6 @@
 # Version 1.3.33
 #
 # Don't modify this file, modify the SWIG interface instead.
-# This file is compatible with both classic and new-style classes.
 
 import _libcli_nbt
 import new
@@ -48,6 +47,16 @@ except AttributeError:
 del types
 
 
+def _swig_setattr_nondynamic_method(set):
+    def set_attr(self,name,value):
+        if (name == "thisown"): return self.this.own(value)
+        if hasattr(self,name) or (name == "this"):
+            set(self,name,value)
+        else:
+            raise AttributeError("You cannot add attributes to %s" % self)
+    return set_attr
+
+
 import events
 nbt_name_socket_init = _libcli_nbt.nbt_name_socket_init
 NBT_NAME_CLIENT = _libcli_nbt.NBT_NAME_CLIENT
@@ -58,106 +67,54 @@ NBT_NAME_PDC = _libcli_nbt.NBT_NAME_PDC
 NBT_NAME_LOGON = _libcli_nbt.NBT_NAME_LOGON
 NBT_NAME_MASTER = _libcli_nbt.NBT_NAME_MASTER
 NBT_NAME_BROWSER = _libcli_nbt.NBT_NAME_BROWSER
-class nbt_name(_object):
-    __swig_setmethods__ = {}
-    __setattr__ = lambda self, name, value: _swig_setattr(self, nbt_name, name, value)
-    __swig_getmethods__ = {}
-    __getattr__ = lambda self, name: _swig_getattr(self, nbt_name, name)
+class nbt_name(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
-    __swig_setmethods__["name"] = _libcli_nbt.nbt_name_name_set
-    __swig_getmethods__["name"] = _libcli_nbt.nbt_name_name_get
-    if _newclass:name = _swig_property(_libcli_nbt.nbt_name_name_get, _libcli_nbt.nbt_name_name_set)
-    __swig_setmethods__["scope"] = _libcli_nbt.nbt_name_scope_set
-    __swig_getmethods__["scope"] = _libcli_nbt.nbt_name_scope_get
-    if _newclass:scope = _swig_property(_libcli_nbt.nbt_name_scope_get, _libcli_nbt.nbt_name_scope_set)
-    __swig_setmethods__["type"] = _libcli_nbt.nbt_name_type_set
-    __swig_getmethods__["type"] = _libcli_nbt.nbt_name_type_get
-    if _newclass:type = _swig_property(_libcli_nbt.nbt_name_type_get, _libcli_nbt.nbt_name_type_set)
+    name = _swig_property(_libcli_nbt.nbt_name_name_get, _libcli_nbt.nbt_name_name_set)
+    scope = _swig_property(_libcli_nbt.nbt_name_scope_get, _libcli_nbt.nbt_name_scope_set)
+    type = _swig_property(_libcli_nbt.nbt_name_type_get, _libcli_nbt.nbt_name_type_set)
     def __init__(self, *args, **kwargs): 
-        this = _libcli_nbt.new_nbt_name(*args, **kwargs)
-        try: self.this.append(this)
-        except: self.this = this
+        _libcli_nbt.nbt_name_swiginit(self,_libcli_nbt.new_nbt_name(*args, **kwargs))
     __swig_destroy__ = _libcli_nbt.delete_nbt_name
-    __del__ = lambda self : None;
 nbt_name_swigregister = _libcli_nbt.nbt_name_swigregister
 nbt_name_swigregister(nbt_name)
 
-class nbt_name_query(_object):
-    __swig_setmethods__ = {}
-    __setattr__ = lambda self, name, value: _swig_setattr(self, nbt_name_query, name, value)
-    __swig_getmethods__ = {}
-    __getattr__ = lambda self, name: _swig_getattr(self, nbt_name_query, name)
+class nbt_name_query(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
-    __swig_getmethods__["data_out"] = _libcli_nbt.nbt_name_query_data_out_get
-    if _newclass:data_out = _swig_property(_libcli_nbt.nbt_name_query_data_out_get)
-    __swig_getmethods__["data_in"] = _libcli_nbt.nbt_name_query_data_in_get
-    if _newclass:data_in = _swig_property(_libcli_nbt.nbt_name_query_data_in_get)
+    data_out = _swig_property(_libcli_nbt.nbt_name_query_data_out_get)
+    data_in = _swig_property(_libcli_nbt.nbt_name_query_data_in_get)
     def __init__(self, *args, **kwargs): 
-        this = _libcli_nbt.new_nbt_name_query(*args, **kwargs)
-        try: self.this.append(this)
-        except: self.this = this
+        _libcli_nbt.nbt_name_query_swiginit(self,_libcli_nbt.new_nbt_name_query(*args, **kwargs))
     __swig_destroy__ = _libcli_nbt.delete_nbt_name_query
-    __del__ = lambda self : None;
 nbt_name_query_swigregister = _libcli_nbt.nbt_name_query_swigregister
 nbt_name_query_swigregister(nbt_name_query)
 
-class nbt_name_query_out(_object):
-    __swig_setmethods__ = {}
-    __setattr__ = lambda self, name, value: _swig_setattr(self, nbt_name_query_out, name, value)
-    __swig_getmethods__ = {}
-    __getattr__ = lambda self, name: _swig_getattr(self, nbt_name_query_out, name)
+class nbt_name_query_out(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
-    __swig_setmethods__["reply_from"] = _libcli_nbt.nbt_name_query_out_reply_from_set
-    __swig_getmethods__["reply_from"] = _libcli_nbt.nbt_name_query_out_reply_from_get
-    if _newclass:reply_from = _swig_property(_libcli_nbt.nbt_name_query_out_reply_from_get, _libcli_nbt.nbt_name_query_out_reply_from_set)
-    __swig_setmethods__["name"] = _libcli_nbt.nbt_name_query_out_name_set
-    __swig_getmethods__["name"] = _libcli_nbt.nbt_name_query_out_name_get
-    if _newclass:name = _swig_property(_libcli_nbt.nbt_name_query_out_name_get, _libcli_nbt.nbt_name_query_out_name_set)
-    __swig_setmethods__["num_addrs"] = _libcli_nbt.nbt_name_query_out_num_addrs_set
-    __swig_getmethods__["num_addrs"] = _libcli_nbt.nbt_name_query_out_num_addrs_get
-    if _newclass:num_addrs = _swig_property(_libcli_nbt.nbt_name_query_out_num_addrs_get, _libcli_nbt.nbt_name_query_out_num_addrs_set)
-    __swig_setmethods__["reply_addrs"] = _libcli_nbt.nbt_name_query_out_reply_addrs_set
-    __swig_getmethods__["reply_addrs"] = _libcli_nbt.nbt_name_query_out_reply_addrs_get
-    if _newclass:reply_addrs = _swig_property(_libcli_nbt.nbt_name_query_out_reply_addrs_get, _libcli_nbt.nbt_name_query_out_reply_addrs_set)
+    reply_from = _swig_property(_libcli_nbt.nbt_name_query_out_reply_from_get, _libcli_nbt.nbt_name_query_out_reply_from_set)
+    name = _swig_property(_libcli_nbt.nbt_name_query_out_name_get, _libcli_nbt.nbt_name_query_out_name_set)
+    num_addrs = _swig_property(_libcli_nbt.nbt_name_query_out_num_addrs_get, _libcli_nbt.nbt_name_query_out_num_addrs_set)
+    reply_addrs = _swig_property(_libcli_nbt.nbt_name_query_out_reply_addrs_get, _libcli_nbt.nbt_name_query_out_reply_addrs_set)
     def __init__(self, *args, **kwargs): 
-        this = _libcli_nbt.new_nbt_name_query_out(*args, **kwargs)
-        try: self.this.append(this)
-        except: self.this = this
+        _libcli_nbt.nbt_name_query_out_swiginit(self,_libcli_nbt.new_nbt_name_query_out(*args, **kwargs))
     __swig_destroy__ = _libcli_nbt.delete_nbt_name_query_out
-    __del__ = lambda self : None;
 nbt_name_query_out_swigregister = _libcli_nbt.nbt_name_query_out_swigregister
 nbt_name_query_out_swigregister(nbt_name_query_out)
 
-class nbt_name_query_in(_object):
-    __swig_setmethods__ = {}
-    __setattr__ = lambda self, name, value: _swig_setattr(self, nbt_name_query_in, name, value)
-    __swig_getmethods__ = {}
-    __getattr__ = lambda self, name: _swig_getattr(self, nbt_name_query_in, name)
+class nbt_name_query_in(object):
+    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
-    __swig_setmethods__["name"] = _libcli_nbt.nbt_name_query_in_name_set
-    __swig_getmethods__["name"] = _libcli_nbt.nbt_name_query_in_name_get
-    if _newclass:name = _swig_property(_libcli_nbt.nbt_name_query_in_name_get, _libcli_nbt.nbt_name_query_in_name_set)
-    __swig_setmethods__["dest_addr"] = _libcli_nbt.nbt_name_query_in_dest_addr_set
-    __swig_getmethods__["dest_addr"] = _libcli_nbt.nbt_name_query_in_dest_addr_get
-    if _newclass:dest_addr = _swig_property(_libcli_nbt.nbt_name_query_in_dest_addr_get, _libcli_nbt.nbt_name_query_in_dest_addr_set)
-    __swig_setmethods__["broadcast"] = _libcli_nbt.nbt_name_query_in_broadcast_set
-    __swig_getmethods__["broadcast"] = _libcli_nbt.nbt_name_query_in_broadcast_get
-    if _newclass:broadcast = _swig_property(_libcli_nbt.nbt_name_query_in_broadcast_get, _libcli_nbt.nbt_name_query_in_broadcast_set)
-    __swig_setmethods__["wins_lookup"] = _libcli_nbt.nbt_name_query_in_wins_lookup_set
-    __swig_getmethods__["wins_lookup"] = _libcli_nbt.nbt_name_query_in_wins_lookup_get
-    if _newclass:wins_lookup = _swig_property(_libcli_nbt.nbt_name_query_in_wins_lookup_get, _libcli_nbt.nbt_name_query_in_wins_lookup_set)
-    __swig_setmethods__["timeout"] = _libcli_nbt.nbt_name_query_in_timeout_set
-    __swig_getmethods__["timeout"] = _libcli_nbt.nbt_name_query_in_timeout_get
-    if _newclass:timeout = _swig_property(_libcli_nbt.nbt_name_query_in_timeout_get, _libcli_nbt.nbt_name_query_in_timeout_set)
-    __swig_setmethods__["retries"] = _libcli_nbt.nbt_name_query_in_retries_set
-    __swig_getmethods__["retries"] = _libcli_nbt.nbt_name_query_in_retries_get
-    if _newclass:retries = _swig_property(_libcli_nbt.nbt_name_query_in_retries_get, _libcli_nbt.nbt_name_query_in_retries_set)
+    name = _swig_property(_libcli_nbt.nbt_name_query_in_name_get, _libcli_nbt.nbt_name_query_in_name_set)
+    dest_addr = _swig_property(_libcli_nbt.nbt_name_query_in_dest_addr_get, _libcli_nbt.nbt_name_query_in_dest_addr_set)
+    broadcast = _swig_property(_libcli_nbt.nbt_name_query_in_broadcast_get, _libcli_nbt.nbt_name_query_in_broadcast_set)
+    wins_lookup = _swig_property(_libcli_nbt.nbt_name_query_in_wins_lookup_get, _libcli_nbt.nbt_name_query_in_wins_lookup_set)
+    timeout = _swig_property(_libcli_nbt.nbt_name_query_in_timeout_get, _libcli_nbt.nbt_name_query_in_timeout_set)
+    retries = _swig_property(_libcli_nbt.nbt_name_query_in_retries_get, _libcli_nbt.nbt_name_query_in_retries_set)
     def __init__(self, *args, **kwargs): 
-        this = _libcli_nbt.new_nbt_name_query_in(*args, **kwargs)
-        try: self.this.append(this)
-        except: self.this = this
+        _libcli_nbt.nbt_name_query_in_swiginit(self,_libcli_nbt.new_nbt_name_query_in(*args, **kwargs))
     __swig_destroy__ = _libcli_nbt.delete_nbt_name_query_in
-    __del__ = lambda self : None;
 nbt_name_query_in_swigregister = _libcli_nbt.nbt_name_query_in_swigregister
 nbt_name_query_in_swigregister(nbt_name_query_in)
 
index 149e63884a59bdd8b6cecfa62484b71ec1fb7507..6c1b5013592cf30b009a5d9dd6addf4a58af8330 100644 (file)
@@ -9,7 +9,7 @@
  * ----------------------------------------------------------------------------- */
 
 #define SWIGPYTHON
-#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+#define SWIG_PYTHON_NO_BUILD_NONE
 /* -----------------------------------------------------------------------------
  *  This section contains generic SWIG labels for method/variable
  *  declarations/attributes, and other compiler dependent labels.
@@ -2485,6 +2485,19 @@ static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
 #  error "This python version requires swig to be run with the '-classic' option"
 # endif
 #endif
+#if (PY_VERSION_HEX <= 0x02020000)
+# error "This python version requires swig to be run with the '-nomodern' option"
+#endif
+#if (PY_VERSION_HEX <= 0x02020000)
+# error "This python version requires swig to be run with the '-nomodernargs' option"
+#endif
+#ifndef METH_O
+# error "This python version requires swig to be run with the '-nofastunpack' option"
+#endif
+#ifdef SWIG_TypeQuery
+# undef SWIG_TypeQuery
+#endif
+#define SWIG_TypeQuery SWIG_Python_TypeQuery
 
 /*-----------------------------------------------
               @(target):= _libcli_nbt.so
@@ -2506,6 +2519,7 @@ static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
 #include "lib/talloc/talloc.h"
 #include "libcli/nbt/libnbt.h"
 #include "param/param.h"
+#include "lib/events/events.h"
 
 /* Undo strcpy safety macro as it's used by swig )-: */
 
@@ -2912,12 +2926,8 @@ SWIGINTERN PyObject *_wrap_nbt_name_socket_init(PyObject *SWIGUNUSEDPARM(self),
     (char *) "event_ctx", NULL 
   };
   
-  {
-    arg2 = event_context_init(NULL);
-  }
-  {
-    arg1 = NULL;
-  }
+  arg2 = event_context_init(NULL);
+  arg1 = NULL;
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:nbt_name_socket_init",kwnames,&obj0)) SWIG_fail;
   if (obj0) {
     res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_event_context, 0 |  0 );
@@ -2943,16 +2953,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_name_set(PyObject *SWIGUNUSEDPARM(self), PyO
   int res2 ;
   char *buf2 = 0 ;
   int alloc2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_name_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_name_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_name_set" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
   arg1 = (struct nbt_name *)(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_name_set" "', argument " "2"" of type '" "char const *""'");
   }
@@ -2978,10 +2987,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_name_get(PyObject *SWIGUNUSEDPARM(self), PyO
   char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_name_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_name_get" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
@@ -3003,16 +3013,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_scope_set(PyObject *SWIGUNUSEDPARM(self), Py
   int res2 ;
   char *buf2 = 0 ;
   int alloc2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_scope_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_scope_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_scope_set" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
   arg1 = (struct nbt_name *)(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_scope_set" "', argument " "2"" of type '" "char const *""'");
   }
@@ -3038,10 +3047,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_scope_get(PyObject *SWIGUNUSEDPARM(self), Py
   char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_scope_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_scope_get" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
@@ -3062,16 +3072,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_type_set(PyObject *SWIGUNUSEDPARM(self), PyO
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_type_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_type_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_type_set" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
   arg1 = (struct nbt_name *)(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nbt_name_type_set" "', argument " "2"" of type '" "enum nbt_name_type""'");
   } 
@@ -3091,10 +3100,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_type_get(PyObject *SWIGUNUSEDPARM(self), PyO
   enum nbt_name_type result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_type_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_type_get" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
@@ -3111,7 +3121,7 @@ SWIGINTERN PyObject *_wrap_new_nbt_name(PyObject *SWIGUNUSEDPARM(self), PyObject
   PyObject *resultobj = 0;
   struct nbt_name *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_nbt_name")) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args,"new_nbt_name",0,0,0)) SWIG_fail;
   result = (struct nbt_name *)(struct nbt_name *) calloc(1, sizeof(struct nbt_name));
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nbt_name, SWIG_POINTER_NEW |  0 );
   return resultobj;
@@ -3125,10 +3135,11 @@ SWIGINTERN PyObject *_wrap_delete_nbt_name(PyObject *SWIGUNUSEDPARM(self), PyObj
   struct nbt_name *arg1 = (struct nbt_name *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_nbt_name",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name, SWIG_POINTER_DISOWN |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_nbt_name" "', argument " "1"" of type '" "struct nbt_name *""'"); 
   }
@@ -3144,21 +3155,26 @@ fail:
 
 SWIGINTERN PyObject *nbt_name_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
   SWIG_TypeNewClientData(SWIGTYPE_p_nbt_name, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
+SWIGINTERN PyObject *nbt_name_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  return SWIG_Python_InitShadowInstance(args);
+}
+
 SWIGINTERN PyObject *_wrap_nbt_name_query_data_out_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   struct nbt_name_query *arg1 = (struct nbt_name_query *) 0 ;
   nbt_name_query_out *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_data_out_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_data_out_get" "', argument " "1"" of type '" "struct nbt_name_query *""'"); 
   }
@@ -3177,10 +3193,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_data_in_get(PyObject *SWIGUNUSEDPARM(s
   nbt_name_query_in *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_data_in_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_data_in_get" "', argument " "1"" of type '" "struct nbt_name_query *""'"); 
   }
@@ -3197,7 +3214,7 @@ SWIGINTERN PyObject *_wrap_new_nbt_name_query(PyObject *SWIGUNUSEDPARM(self), Py
   PyObject *resultobj = 0;
   struct nbt_name_query *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_nbt_name_query")) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args,"new_nbt_name_query",0,0,0)) SWIG_fail;
   result = (struct nbt_name_query *)(struct nbt_name_query *) calloc(1, sizeof(struct nbt_name_query));
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nbt_name_query, SWIG_POINTER_NEW |  0 );
   return resultobj;
@@ -3211,10 +3228,11 @@ SWIGINTERN PyObject *_wrap_delete_nbt_name_query(PyObject *SWIGUNUSEDPARM(self),
   struct nbt_name_query *arg1 = (struct nbt_name_query *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_nbt_name_query",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query, SWIG_POINTER_DISOWN |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_nbt_name_query" "', argument " "1"" of type '" "struct nbt_name_query *""'"); 
   }
@@ -3230,11 +3248,15 @@ fail:
 
 SWIGINTERN PyObject *nbt_name_query_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
   SWIG_TypeNewClientData(SWIGTYPE_p_nbt_name_query, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
+SWIGINTERN PyObject *nbt_name_query_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  return SWIG_Python_InitShadowInstance(args);
+}
+
 SWIGINTERN PyObject *_wrap_nbt_name_query_out_reply_from_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   nbt_name_query_out *arg1 = (nbt_name_query_out *) 0 ;
@@ -3244,16 +3266,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_reply_from_set(PyObject *SWIGUNUSE
   int res2 ;
   char *buf2 = 0 ;
   int alloc2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_out_reply_from_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_out_reply_from_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_reply_from_set" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
   arg1 = (nbt_name_query_out *)(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_query_out_reply_from_set" "', argument " "2"" of type '" "char const *""'");
   }
@@ -3279,10 +3300,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_reply_from_get(PyObject *SWIGUNUSE
   char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_out_reply_from_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_reply_from_get" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
@@ -3303,16 +3325,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_name_set(PyObject *SWIGUNUSEDPARM(
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_out_name_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_out_name_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_name_set" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
   arg1 = (nbt_name_query_out *)(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_nbt_name, 0 |  0 );
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_query_out_name_set" "', argument " "2"" of type '" "struct nbt_name *""'"); 
   }
@@ -3332,10 +3353,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_name_get(PyObject *SWIGUNUSEDPARM(
   struct nbt_name *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_out_name_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_name_get" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
@@ -3356,16 +3378,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_num_addrs_set(PyObject *SWIGUNUSED
   int res1 = 0 ;
   short val2 ;
   int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_out_num_addrs_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_out_num_addrs_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_num_addrs_set" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
   arg1 = (nbt_name_query_out *)(argp1);
-  ecode2 = SWIG_AsVal_short(obj1, &val2);
+  ecode2 = SWIG_AsVal_short(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nbt_name_query_out_num_addrs_set" "', argument " "2"" of type '" "int16_t""'");
   } 
@@ -3385,10 +3406,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_num_addrs_get(PyObject *SWIGUNUSED
   int16_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_out_num_addrs_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_num_addrs_get" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
@@ -3409,16 +3431,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_reply_addrs_set(PyObject *SWIGUNUS
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_out_reply_addrs_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_out_reply_addrs_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_reply_addrs_set" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
   arg1 = (nbt_name_query_out *)(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 |  0 );
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_char, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_query_out_reply_addrs_set" "', argument " "2"" of type '" "char const **""'"); 
   }
@@ -3438,10 +3459,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_out_reply_addrs_get(PyObject *SWIGUNUS
   char **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_out_reply_addrs_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_out_reply_addrs_get" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
@@ -3458,7 +3480,7 @@ SWIGINTERN PyObject *_wrap_new_nbt_name_query_out(PyObject *SWIGUNUSEDPARM(self)
   PyObject *resultobj = 0;
   nbt_name_query_out *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_nbt_name_query_out")) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args,"new_nbt_name_query_out",0,0,0)) SWIG_fail;
   result = (nbt_name_query_out *)(nbt_name_query_out *) calloc(1, sizeof(nbt_name_query_out));
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nbt_name_query_out, SWIG_POINTER_NEW |  0 );
   return resultobj;
@@ -3472,10 +3494,11 @@ SWIGINTERN PyObject *_wrap_delete_nbt_name_query_out(PyObject *SWIGUNUSEDPARM(se
   nbt_name_query_out *arg1 = (nbt_name_query_out *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_nbt_name_query_out",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_out, SWIG_POINTER_DISOWN |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_out, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_nbt_name_query_out" "', argument " "1"" of type '" "nbt_name_query_out *""'"); 
   }
@@ -3491,11 +3514,15 @@ fail:
 
 SWIGINTERN PyObject *nbt_name_query_out_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
   SWIG_TypeNewClientData(SWIGTYPE_p_nbt_name_query_out, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
+SWIGINTERN PyObject *nbt_name_query_out_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  return SWIG_Python_InitShadowInstance(args);
+}
+
 SWIGINTERN PyObject *_wrap_nbt_name_query_in_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   nbt_name_query_in *arg1 = (nbt_name_query_in *) 0 ;
@@ -3504,16 +3531,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_name_set(PyObject *SWIGUNUSEDPARM(s
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_in_name_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_in_name_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_name_set" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
   arg1 = (nbt_name_query_in *)(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_nbt_name, 0 |  0 );
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_nbt_name, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_query_in_name_set" "', argument " "2"" of type '" "struct nbt_name *""'"); 
   }
@@ -3533,10 +3559,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_name_get(PyObject *SWIGUNUSEDPARM(s
   struct nbt_name *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_in_name_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_name_get" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3558,16 +3585,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_dest_addr_set(PyObject *SWIGUNUSEDP
   int res2 ;
   char *buf2 = 0 ;
   int alloc2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_in_dest_addr_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_in_dest_addr_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_dest_addr_set" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
   arg1 = (nbt_name_query_in *)(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nbt_name_query_in_dest_addr_set" "', argument " "2"" of type '" "char const *""'");
   }
@@ -3593,10 +3619,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_dest_addr_get(PyObject *SWIGUNUSEDP
   char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_in_dest_addr_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_dest_addr_get" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3617,16 +3644,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_broadcast_set(PyObject *SWIGUNUSEDP
   int res1 = 0 ;
   bool val2 ;
   int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_in_broadcast_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_in_broadcast_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_broadcast_set" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
   arg1 = (nbt_name_query_in *)(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nbt_name_query_in_broadcast_set" "', argument " "2"" of type '" "bool""'");
   } 
@@ -3646,10 +3672,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_broadcast_get(PyObject *SWIGUNUSEDP
   bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_in_broadcast_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_broadcast_get" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3670,16 +3697,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_wins_lookup_set(PyObject *SWIGUNUSE
   int res1 = 0 ;
   bool val2 ;
   int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_in_wins_lookup_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_in_wins_lookup_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_wins_lookup_set" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
   arg1 = (nbt_name_query_in *)(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nbt_name_query_in_wins_lookup_set" "', argument " "2"" of type '" "bool""'");
   } 
@@ -3699,10 +3725,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_wins_lookup_get(PyObject *SWIGUNUSE
   bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_in_wins_lookup_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_wins_lookup_get" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3723,16 +3750,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_timeout_set(PyObject *SWIGUNUSEDPAR
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_in_timeout_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_in_timeout_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_timeout_set" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
   arg1 = (nbt_name_query_in *)(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nbt_name_query_in_timeout_set" "', argument " "2"" of type '" "int""'");
   } 
@@ -3752,10 +3778,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_timeout_get(PyObject *SWIGUNUSEDPAR
   int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_in_timeout_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_timeout_get" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3776,16 +3803,15 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_retries_set(PyObject *SWIGUNUSEDPAR
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  PyObject *swig_obj[2] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:nbt_name_query_in_retries_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args,"nbt_name_query_in_retries_set",2,2,swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_retries_set" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
   arg1 = (nbt_name_query_in *)(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nbt_name_query_in_retries_set" "', argument " "2"" of type '" "int""'");
   } 
@@ -3805,10 +3831,11 @@ SWIGINTERN PyObject *_wrap_nbt_name_query_in_retries_get(PyObject *SWIGUNUSEDPAR
   int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:nbt_name_query_in_retries_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nbt_name_query_in_retries_get" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3825,7 +3852,7 @@ SWIGINTERN PyObject *_wrap_new_nbt_name_query_in(PyObject *SWIGUNUSEDPARM(self),
   PyObject *resultobj = 0;
   nbt_name_query_in *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_nbt_name_query_in")) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args,"new_nbt_name_query_in",0,0,0)) SWIG_fail;
   result = (nbt_name_query_in *)(nbt_name_query_in *) calloc(1, sizeof(nbt_name_query_in));
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_nbt_name_query_in, SWIG_POINTER_NEW |  0 );
   return resultobj;
@@ -3839,10 +3866,11 @@ SWIGINTERN PyObject *_wrap_delete_nbt_name_query_in(PyObject *SWIGUNUSEDPARM(sel
   nbt_name_query_in *arg1 = (nbt_name_query_in *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  PyObject *swig_obj[1] ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_nbt_name_query_in",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_query_in, SWIG_POINTER_DISOWN |  0 );
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_nbt_name_query_in, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_nbt_name_query_in" "', argument " "1"" of type '" "nbt_name_query_in *""'"); 
   }
@@ -3858,11 +3886,15 @@ fail:
 
 SWIGINTERN PyObject *nbt_name_query_in_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
   SWIG_TypeNewClientData(SWIGTYPE_p_nbt_name_query_in, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
+SWIGINTERN PyObject *nbt_name_query_in_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  return SWIG_Python_InitShadowInstance(args);
+}
+
 SWIGINTERN PyObject *_wrap_new_char_ptr_array(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
   PyObject *resultobj = 0;
   size_t arg1 ;
@@ -4007,9 +4039,7 @@ SWIGINTERN PyObject *_wrap_do_nbt_name_query(PyObject *SWIGUNUSEDPARM(self), PyO
     (char *) "nbtsock",(char *) "io", NULL 
   };
   
-  {
-    arg2 = NULL;
-  }
+  arg2 = NULL;
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:do_nbt_name_query",kwnames,&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_nbt_name_socket, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
@@ -4022,13 +4052,12 @@ SWIGINTERN PyObject *_wrap_do_nbt_name_query(PyObject *SWIGUNUSEDPARM(self), PyO
   }
   arg3 = (struct nbt_name_query *)(argp3);
   result = do_nbt_name_query(arg1,arg2,arg3);
-  {
-    if (NT_STATUS_IS_ERR(result)) {
-      PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, nt_errstr(result));
-      PyErr_SetObject(PyExc_RuntimeError, obj);
-    } else if (resultobj == NULL) {
-      resultobj = Py_None;
-    }
+  if (NT_STATUS_IS_ERR(result)) {
+    PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, nt_errstr(result));
+    PyErr_SetObject(PyExc_RuntimeError, obj);
+    SWIG_fail;
+  } else if (resultobj == NULL) {
+    resultobj = Py_None;
   }
   return resultobj;
 fail:
@@ -4039,45 +4068,49 @@ fail:
 static PyMethodDef SwigMethods[] = {
         { (char *)"nbt_name_socket_init", (PyCFunction) _wrap_nbt_name_socket_init, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"nbt_name_name_set", _wrap_nbt_name_name_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_name_get", _wrap_nbt_name_name_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_name_get", (PyCFunction)_wrap_nbt_name_name_get, METH_O, NULL},
         { (char *)"nbt_name_scope_set", _wrap_nbt_name_scope_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_scope_get", _wrap_nbt_name_scope_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_scope_get", (PyCFunction)_wrap_nbt_name_scope_get, METH_O, NULL},
         { (char *)"nbt_name_type_set", _wrap_nbt_name_type_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_type_get", _wrap_nbt_name_type_get, METH_VARARGS, NULL},
-        { (char *)"new_nbt_name", _wrap_new_nbt_name, METH_VARARGS, NULL},
-        { (char *)"delete_nbt_name", _wrap_delete_nbt_name, METH_VARARGS, NULL},
+        { (char *)"nbt_name_type_get", (PyCFunction)_wrap_nbt_name_type_get, METH_O, NULL},
+        { (char *)"new_nbt_name", (PyCFunction)_wrap_new_nbt_name, METH_NOARGS, NULL},
+        { (char *)"delete_nbt_name", (PyCFunction)_wrap_delete_nbt_name, METH_O, NULL},
         { (char *)"nbt_name_swigregister", nbt_name_swigregister, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_data_out_get", _wrap_nbt_name_query_data_out_get, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_data_in_get", _wrap_nbt_name_query_data_in_get, METH_VARARGS, NULL},
-        { (char *)"new_nbt_name_query", _wrap_new_nbt_name_query, METH_VARARGS, NULL},
-        { (char *)"delete_nbt_name_query", _wrap_delete_nbt_name_query, METH_VARARGS, NULL},
+        { (char *)"nbt_name_swiginit", nbt_name_swiginit, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_data_out_get", (PyCFunction)_wrap_nbt_name_query_data_out_get, METH_O, NULL},
+        { (char *)"nbt_name_query_data_in_get", (PyCFunction)_wrap_nbt_name_query_data_in_get, METH_O, NULL},
+        { (char *)"new_nbt_name_query", (PyCFunction)_wrap_new_nbt_name_query, METH_NOARGS, NULL},
+        { (char *)"delete_nbt_name_query", (PyCFunction)_wrap_delete_nbt_name_query, METH_O, NULL},
         { (char *)"nbt_name_query_swigregister", nbt_name_query_swigregister, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_swiginit", nbt_name_query_swiginit, METH_VARARGS, NULL},
         { (char *)"nbt_name_query_out_reply_from_set", _wrap_nbt_name_query_out_reply_from_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_out_reply_from_get", _wrap_nbt_name_query_out_reply_from_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_out_reply_from_get", (PyCFunction)_wrap_nbt_name_query_out_reply_from_get, METH_O, NULL},
         { (char *)"nbt_name_query_out_name_set", _wrap_nbt_name_query_out_name_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_out_name_get", _wrap_nbt_name_query_out_name_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_out_name_get", (PyCFunction)_wrap_nbt_name_query_out_name_get, METH_O, NULL},
         { (char *)"nbt_name_query_out_num_addrs_set", _wrap_nbt_name_query_out_num_addrs_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_out_num_addrs_get", _wrap_nbt_name_query_out_num_addrs_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_out_num_addrs_get", (PyCFunction)_wrap_nbt_name_query_out_num_addrs_get, METH_O, NULL},
         { (char *)"nbt_name_query_out_reply_addrs_set", _wrap_nbt_name_query_out_reply_addrs_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_out_reply_addrs_get", _wrap_nbt_name_query_out_reply_addrs_get, METH_VARARGS, NULL},
-        { (char *)"new_nbt_name_query_out", _wrap_new_nbt_name_query_out, METH_VARARGS, NULL},
-        { (char *)"delete_nbt_name_query_out", _wrap_delete_nbt_name_query_out, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_out_reply_addrs_get", (PyCFunction)_wrap_nbt_name_query_out_reply_addrs_get, METH_O, NULL},
+        { (char *)"new_nbt_name_query_out", (PyCFunction)_wrap_new_nbt_name_query_out, METH_NOARGS, NULL},
+        { (char *)"delete_nbt_name_query_out", (PyCFunction)_wrap_delete_nbt_name_query_out, METH_O, NULL},
         { (char *)"nbt_name_query_out_swigregister", nbt_name_query_out_swigregister, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_out_swiginit", nbt_name_query_out_swiginit, METH_VARARGS, NULL},
         { (char *)"nbt_name_query_in_name_set", _wrap_nbt_name_query_in_name_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_in_name_get", _wrap_nbt_name_query_in_name_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_name_get", (PyCFunction)_wrap_nbt_name_query_in_name_get, METH_O, NULL},
         { (char *)"nbt_name_query_in_dest_addr_set", _wrap_nbt_name_query_in_dest_addr_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_in_dest_addr_get", _wrap_nbt_name_query_in_dest_addr_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_dest_addr_get", (PyCFunction)_wrap_nbt_name_query_in_dest_addr_get, METH_O, NULL},
         { (char *)"nbt_name_query_in_broadcast_set", _wrap_nbt_name_query_in_broadcast_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_in_broadcast_get", _wrap_nbt_name_query_in_broadcast_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_broadcast_get", (PyCFunction)_wrap_nbt_name_query_in_broadcast_get, METH_O, NULL},
         { (char *)"nbt_name_query_in_wins_lookup_set", _wrap_nbt_name_query_in_wins_lookup_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_in_wins_lookup_get", _wrap_nbt_name_query_in_wins_lookup_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_wins_lookup_get", (PyCFunction)_wrap_nbt_name_query_in_wins_lookup_get, METH_O, NULL},
         { (char *)"nbt_name_query_in_timeout_set", _wrap_nbt_name_query_in_timeout_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_in_timeout_get", _wrap_nbt_name_query_in_timeout_get, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_timeout_get", (PyCFunction)_wrap_nbt_name_query_in_timeout_get, METH_O, NULL},
         { (char *)"nbt_name_query_in_retries_set", _wrap_nbt_name_query_in_retries_set, METH_VARARGS, NULL},
-        { (char *)"nbt_name_query_in_retries_get", _wrap_nbt_name_query_in_retries_get, METH_VARARGS, NULL},
-        { (char *)"new_nbt_name_query_in", _wrap_new_nbt_name_query_in, METH_VARARGS, NULL},
-        { (char *)"delete_nbt_name_query_in", _wrap_delete_nbt_name_query_in, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_retries_get", (PyCFunction)_wrap_nbt_name_query_in_retries_get, METH_O, NULL},
+        { (char *)"new_nbt_name_query_in", (PyCFunction)_wrap_new_nbt_name_query_in, METH_NOARGS, NULL},
+        { (char *)"delete_nbt_name_query_in", (PyCFunction)_wrap_delete_nbt_name_query_in, METH_O, NULL},
         { (char *)"nbt_name_query_in_swigregister", nbt_name_query_in_swigregister, METH_VARARGS, NULL},
+        { (char *)"nbt_name_query_in_swiginit", nbt_name_query_in_swiginit, METH_VARARGS, NULL},
         { (char *)"new_char_ptr_array", (PyCFunction) _wrap_new_char_ptr_array, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"delete_char_ptr_array", (PyCFunction) _wrap_delete_char_ptr_array, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"char_ptr_array_getitem", (PyCFunction) _wrap_char_ptr_array_getitem, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -4091,7 +4124,7 @@ static PyMethodDef SwigMethods[] = {
 
 static swig_type_info _swigt__p_TALLOC_CTX = {"_p_TALLOC_CTX", "TALLOC_CTX *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_event_context = {"_p_event_context", "struct event_context *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_event_context = {"_p_event_context", "struct event_context *|event *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_long_long = {"_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_nbt_name = {"_p_nbt_name", "struct nbt_name *|nbt_name *", 0, 0, (void*)0, 0};
index 32e043b2c651f005213c085486f014977e9cd978..4125bcf5a912bb8bc57f4e55a80e7c14120a55b1 100644 (file)
@@ -9,8 +9,9 @@
 #include "libcli/raw/libcliraw.h"
 %}
 
-struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
+struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports,
                                                 TALLOC_CTX *mem_ctx,
+                         struct resolve_context *resolve_ctx,
                                                 struct event_context *event_ctx);
 
 void smbcli_sock_dead(struct smbcli_socket *sock);
index 466a04b9ebd59af5722213b822308931397ecd55..80c40402375782acfbf97e383aab74432baff343 100644 (file)
@@ -2,7 +2,6 @@
 # Version 1.3.33
 #
 # Don't modify this file, modify the SWIG interface instead.
-# This file is compatible with both classic and new-style classes.
 
 import _libcli_smb
 import new
@@ -48,6 +47,16 @@ except AttributeError:
 del types
 
 
+def _swig_setattr_nondynamic_method(set):
+    def set_attr(self,name,value):
+        if (name == "thisown"): return self.this.own(value)
+        if hasattr(self,name) or (name == "this"):
+            set(self,name,value)
+        else:
+            raise AttributeError("You cannot add attributes to %s" % self)
+    return set_attr
+
+
 import events
 smbcli_sock_connect_byname = _libcli_smb.smbcli_sock_connect_byname
 smbcli_sock_dead = _libcli_smb.smbcli_sock_dead
index 313bcfeed39d7ded267465bea30e76de154f494f..8b71f2c3be5b69c671ea6a96aabab98c883bc9c9 100644 (file)
@@ -9,7 +9,7 @@
  * ----------------------------------------------------------------------------- */
 
 #define SWIGPYTHON
-#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+#define SWIG_PYTHON_NO_BUILD_NONE
 /* -----------------------------------------------------------------------------
  *  This section contains generic SWIG labels for method/variable
  *  declarations/attributes, and other compiler dependent labels.
@@ -2459,9 +2459,11 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
 #define SWIGTYPE_p_TALLOC_CTX swig_types[0]
 #define SWIGTYPE_p_char swig_types[1]
 #define SWIGTYPE_p_event_context swig_types[2]
-#define SWIGTYPE_p_smbcli_socket swig_types[3]
-static swig_type_info *swig_types[5];
-static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
+#define SWIGTYPE_p_p_char swig_types[3]
+#define SWIGTYPE_p_resolve_context swig_types[4]
+#define SWIGTYPE_p_smbcli_socket swig_types[5]
+static swig_type_info *swig_types[7];
+static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -2472,6 +2474,19 @@ static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
 #  error "This python version requires swig to be run with the '-classic' option"
 # endif
 #endif
+#if (PY_VERSION_HEX <= 0x02020000)
+# error "This python version requires swig to be run with the '-nomodern' option"
+#endif
+#if (PY_VERSION_HEX <= 0x02020000)
+# error "This python version requires swig to be run with the '-nomodernargs' option"
+#endif
+#ifndef METH_O
+# error "This python version requires swig to be run with the '-nofastunpack' option"
+#endif
+#ifdef SWIG_TypeQuery
+# undef SWIG_TypeQuery
+#endif
+#define SWIG_TypeQuery SWIG_Python_TypeQuery
 
 /*-----------------------------------------------
               @(target):= _libcli_smb.so
@@ -2560,200 +2575,60 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 
 
 
-
-#include <limits.h>
-#if !defined(SWIG_NO_LLONG_MAX)
-# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
-#   define LLONG_MAX __LONG_LONG_MAX__
-#   define LLONG_MIN (-LLONG_MAX - 1LL)
-#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
-# endif
-#endif
-
-
-SWIGINTERN int
-SWIG_AsVal_double (PyObject *obj, double *val)
-{
-  int res = SWIG_TypeError;
-  if (PyFloat_Check(obj)) {
-    if (val) *val = PyFloat_AsDouble(obj);
-    return SWIG_OK;
-  } else if (PyInt_Check(obj)) {
-    if (val) *val = PyInt_AsLong(obj);
-    return SWIG_OK;
-  } else if (PyLong_Check(obj)) {
-    double v = PyLong_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    double d = PyFloat_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = d;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      long v = PyLong_AsLong(obj);
-      if (!PyErr_Occurred()) {
-       if (val) *val = v;
-       return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
-      } else {
-       PyErr_Clear();
-      }
-    }
-  }
-#endif
-  return res;
-}
-
-
-#include <float.h>
-
-
-#include <math.h>
-
-
-SWIGINTERNINLINE int
-SWIG_CanCastAsInteger(double *d, double min, double max) {
-  double x = *d;
-  if ((min <= x && x <= max)) {
-   double fx = floor(x);
-   double cx = ceil(x);
-   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
-   if ((errno == EDOM) || (errno == ERANGE)) {
-     errno = 0;
-   } else {
-     double summ, reps, diff;
-     if (rd < x) {
-       diff = x - rd;
-     } else if (rd > x) {
-       diff = rd - x;
-     } else {
-       return 1;
-     }
-     summ = rd + x;
-     reps = diff/summ;
-     if (reps < 8*DBL_EPSILON) {
-       *d = rd;
-       return 1;
-     }
-   }
-  }
-  return 0;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_long (PyObject *obj, long* val)
-{
-  if (PyInt_Check(obj)) {
-    if (val) *val = PyInt_AsLong(obj);
-    return SWIG_OK;
-  } else if (PyLong_Check(obj)) {
-    long v = PyLong_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    long v = PyInt_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      double d;
-      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
-       if (val) *val = (long)(d);
-       return res;
-      }
-    }
-  }
-#endif
-  return SWIG_TypeError;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_int (PyObject * obj, int *val)
-{
-  long v;
-  int res = SWIG_AsVal_long (obj, &v);
-  if (SWIG_IsOK(res)) {
-    if ((v < INT_MIN || v > INT_MAX)) {
-      return SWIG_OverflowError;
-    } else {
-      if (val) *val = (int)(v);
-    }
-  }  
-  return res;
-}
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 SWIGINTERN PyObject *_wrap_smbcli_sock_connect_byname(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
   PyObject *resultobj = 0;
   char *arg1 = (char *) 0 ;
-  int arg2 ;
+  char **arg2 = (char **) 0 ;
   TALLOC_CTX *arg3 = (TALLOC_CTX *) 0 ;
-  struct event_context *arg4 = (struct event_context *) 0 ;
+  struct resolve_context *arg4 = (struct resolve_context *) 0 ;
+  struct event_context *arg5 = (struct event_context *) 0 ;
   struct smbcli_socket *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   void *argp4 = 0 ;
   int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   char *  kwnames[] = {
-    (char *) "host",(char *) "port",(char *) "event_ctx", NULL 
+    (char *) "host",(char *) "ports",(char *) "resolve_ctx",(char *) "event_ctx", NULL 
   };
   
-  {
-    arg4 = event_context_init(NULL);
-  }
-  {
-    arg3 = NULL;
-  }
-  if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:smbcli_sock_connect_byname",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
+  arg5 = event_context_init(NULL);
+  arg3 = NULL;
+  if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:smbcli_sock_connect_byname",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smbcli_sock_connect_byname" "', argument " "1"" of type '" "char const *""'");
   }
   arg1 = (char *)(buf1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "smbcli_sock_connect_byname" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = (int)(val2);
-  if (obj2) {
-    res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_event_context, 0 |  0 );
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "smbcli_sock_connect_byname" "', argument " "4"" of type '" "struct event_context *""'"); 
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smbcli_sock_connect_byname" "', argument " "2"" of type '" "char const **""'"); 
+  }
+  arg2 = (char **)(argp2);
+  res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_resolve_context, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "smbcli_sock_connect_byname" "', argument " "4"" of type '" "struct resolve_context *""'"); 
+  }
+  arg4 = (struct resolve_context *)(argp4);
+  if (obj3) {
+    res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_event_context, 0 |  0 );
+    if (!SWIG_IsOK(res5)) {
+      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "smbcli_sock_connect_byname" "', argument " "5"" of type '" "struct event_context *""'"); 
     }
-    arg4 = (struct event_context *)(argp4);
+    arg5 = (struct event_context *)(argp5);
   }
-  result = (struct smbcli_socket *)smbcli_sock_connect_byname((char const *)arg1,arg2,arg3,arg4);
+  result = (struct smbcli_socket *)smbcli_sock_connect_byname((char const *)arg1,(char const **)arg2,arg3,arg4,arg5);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_smbcli_socket, 0 |  0 );
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
   return resultobj;
@@ -2798,25 +2673,33 @@ static PyMethodDef SwigMethods[] = {
 
 static swig_type_info _swigt__p_TALLOC_CTX = {"_p_TALLOC_CTX", "TALLOC_CTX *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_event_context = {"_p_event_context", "struct event_context *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_event_context = {"_p_event_context", "struct event_context *|event *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_resolve_context = {"_p_resolve_context", "struct resolve_context *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_smbcli_socket = {"_p_smbcli_socket", "struct smbcli_socket *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
   &_swigt__p_TALLOC_CTX,
   &_swigt__p_char,
   &_swigt__p_event_context,
+  &_swigt__p_p_char,
+  &_swigt__p_resolve_context,
   &_swigt__p_smbcli_socket,
 };
 
 static swig_cast_info _swigc__p_TALLOC_CTX[] = {  {&_swigt__p_TALLOC_CTX, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_event_context[] = {  {&_swigt__p_event_context, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_resolve_context[] = {  {&_swigt__p_resolve_context, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_smbcli_socket[] = {  {&_swigt__p_smbcli_socket, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_TALLOC_CTX,
   _swigc__p_char,
   _swigc__p_event_context,
+  _swigc__p_p_char,
+  _swigc__p_resolve_context,
   _swigc__p_smbcli_socket,
 };
 
index aadd3b88d0aedce7559f04abee5afca503494f81..9041ff5a23a09375a96453dccefeb120cf37e98a 100644 (file)
@@ -1,7 +1,4 @@
-[LIBRARY::LIBSAMBA-NET]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Convenient high level access to Samba management interfaces
+[SUBSYSTEM::LIBSAMBA-NET]
 PRIVATE_PROTO_HEADER = libnet_proto.h
 PUBLIC_HEADERS = libnet.h libnet_join.h libnet_lookup.h libnet_passwd.h \
                                 libnet_rpc.h libnet_share.h libnet_time.h \
index 8774f2fd172232b5a4a04a28f53389b0366ce79f..4d4167ba04a55bee82320e5e71c7a0931a336342 100644 (file)
@@ -36,10 +36,7 @@ MANPAGE = tools/ndrdump.1
 
 ################################################
 # Start SUBSYSTEM NDR_COMPRESSION
-[LIBRARY::NDR_COMPRESSION]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = NDR support for compressed subcontexts
+[SUBSYSTEM::NDR_COMPRESSION]
 PRIVATE_PROTO_HEADER = ndr/ndr_compression.h
 OBJ_FILES = \
                ndr/ndr_compression.o
@@ -370,13 +367,10 @@ OBJ_FILES = gen_ndr/ndr_svcctl_c.o
 PUBLIC_HEADERS = gen_ndr/ndr_svcctl_c.h
 PUBLIC_DEPENDENCIES = dcerpc NDR_SVCCTL
 
-[LIBRARY::dcerpc_atsvc]
+[SUBSYSTEM::dcerpc_atsvc]
 OBJ_FILES = gen_ndr/ndr_atsvc_c.o
 PUBLIC_HEADERS = gen_ndr/ndr_atsvc_c.h
 PUBLIC_DEPENDENCIES = dcerpc NDR_ATSVC
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = DCE/RPC client library - ATSVC
 
 [SUBSYSTEM::RPC_NDR_EVENTLOG]
 OBJ_FILES = gen_ndr/ndr_eventlog_c.o
@@ -410,12 +404,9 @@ PUBLIC_DEPENDENCIES = dcerpc NDR_WINREG
 OBJ_FILES = gen_ndr/ndr_initshutdown_c.o
 PUBLIC_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN
 
-[LIBRARY::dcerpc_mgmt]
+[SUBSYSTEM::dcerpc_mgmt]
 OBJ_FILES = gen_ndr/ndr_mgmt_c.o
 PRIVATE_DEPENDENCIES = NDR_MGMT
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = DCE/RPC client library - MGMT
 
 [SUBSYSTEM::RPC_NDR_PROTECTED_STORAGE]
 OBJ_FILES = gen_ndr/ndr_protected_storage_c.o
index 705c86e39b3209f234385ee869661f1a58afeb38..8d26ec0aad2719dd6316c6ac1eefb0f750b6afc3 100644 (file)
@@ -138,9 +138,29 @@ import "security.idl";
                uint32 unknown;
        } lsa_AuditLogInfo;
 
+       typedef [v1_enum] enum {
+               LSA_AUDIT_POLICY_NONE=0,
+               LSA_AUDIT_POLICY_SUCCESS=1,
+               LSA_AUDIT_POLICY_FAILURE=2,
+               LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE),
+               LSA_AUDIT_POLICY_CLEAR=4
+       } lsa_PolicyAuditPolicy;
+
+       typedef enum {
+               LSA_AUDIT_CATEGORY_SYSTEM = 0,
+               LSA_AUDIT_CATEGORY_LOGON = 1,
+               LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS = 2,
+               LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS = 3,
+               LSA_AUDIT_CATEGORY_PROCCESS_TRACKING = 4,
+               LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES = 5,
+               LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT = 6,
+               LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS = 7,        /* only in win2k/2k3 */
+               LSA_AUDIT_CATEGORY_ACCOUNT_LOGON = 8                    /* only in win2k/2k3 */
+       } lsa_PolicyAuditEventType;
+
        typedef struct {
                uint32 auditing_mode;
-               [size_is(count)] uint32 *settings;
+               [size_is(count)] lsa_PolicyAuditPolicy *settings;
                uint32 count;
        } lsa_AuditEventsInfo;
 
index 310f8c4ce44dfa487535c0bafc96aa76f03701fb..86a5a2560ef2ba400309dbd151d2710475989f1c 100644 (file)
@@ -112,6 +112,8 @@ static enum ndr_err_code ndr_pull_compression_mszip(struct ndr_pull *subndr,
        comndr->data_size       = uncompressed.length;
        comndr->offset          = 0;
 
+       comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);
+
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[0]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[1]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[2]));
@@ -215,6 +217,8 @@ static enum ndr_err_code ndr_pull_compression_xpress(struct ndr_pull *subndr,
        comndr->data_size       = uncompressed.length;
        comndr->offset          = 0;
 
+       comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);
+
        *_comndr = comndr;
        return NDR_ERR_SUCCESS;
 }
index 8982024516518610ae91525caf58ba2c58a7e03d..621939256c96e91eed9248320e0d29a813fcc16b 100644 (file)
@@ -1,7 +1,4 @@
-[LIBRARY::LIBWINBIND-CLIENT]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Client library for communicating with winbind
+[SUBSYSTEM::LIBWINBIND-CLIENT]
 OBJ_FILES = wb_common.o
 PRIVATE_DEPENDENCIES = SOCKET_WRAPPER
 
index 38a582291f307aef144dbbac20aa4c36939aa945..4c1f46ff1707da5dff3dff4f75e4f11a241ea27a 100644 (file)
@@ -14,7 +14,7 @@ PRIVATE_DEPENDENCIES = \
 
 ################################################
 # Start SUBSYSTEM ntptr
-[LIBRARY::ntptr]
+[SUBSYSTEM::ntptr]
 PRIVATE_PROTO_HEADER = ntptr_proto.h
 OBJ_FILES = \
                ntptr_base.o \
index ae8d5d9b4ab088ccc14f2f2fe77a23005774474a..017614b7bed96a4b9782d85dd328706296594b99 100644 (file)
@@ -79,11 +79,8 @@ OBJ_FILES = \
 
 ################################################
 # Start SUBSYSTEM NTVFS
-[LIBRARY::ntvfs]
+[SUBSYSTEM::ntvfs]
 PUBLIC_HEADERS = ntvfs.h
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Virtual File System with NTFS semantics
 PRIVATE_PROTO_HEADER = ntvfs_proto.h
 OBJ_FILES = \
                ntvfs_base.o \
index b28f6639c046b59d368a1b9dc79befbb3362a5b0..f7d5d03d43baa130113c4cb4d25975fea2fb40b0 100644 (file)
@@ -14,10 +14,7 @@ PUBLIC_HEADERS = param.h
 
 #################################
 # Start SUBSYSTEM share
-[LIBRARY::share]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Services Configuration Library
+[SUBSYSTEM::share]
 PUBLIC_HEADERS = share.h
 PUBLIC_PROTO_HEADER = share_proto.h
 OBJ_FILES = share.o
index 0c6e0e57279ed905c2007991fab5217b1bcabaee..c2c9463d03f9445b65dc27913b53ff18d954c897 100644 (file)
@@ -9,7 +9,7 @@ package Parse::Pidl;
 
 require Exporter;
 @ISA = qw(Exporter);
-@EXPORT_OK = qw(warning error fatal);
+@EXPORT_OK = qw(warning error fatal $VERSION);
 
 use strict;
 
index 47312bc83d73add15b11946b6ee193b616a0c2b5..ca9e7d15db019f0ef8c3ddb2d27f155fdf39260d 100644 (file)
@@ -6,13 +6,17 @@
 
 package Parse::Pidl::Samba3::ServerNDR;
 
+use Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(DeclLevel);
+
 use strict;
 use Parse::Pidl qw(warning fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
 use Parse::Pidl::Util qw(ParseExpr has_property is_constant);
 use Parse::Pidl::NDR qw(GetNextLevel);
 use Parse::Pidl::Samba4 qw(ElementStars DeclLong);
-use Parse::Pidl::Samba4::NDR::Parser qw(GenerateFunctionOutEnv);
+use Parse::Pidl::Samba4::Header qw(GenerateFunctionOutEnv);
 
 use vars qw($VERSION);
 $VERSION = '0.01';
index 5848543a6036e141b39d377f7448f77bc0601161..d42e01cdb0424cc51d413fcfa496a934ae534d4e 100644 (file)
@@ -12,6 +12,7 @@ require Exporter;
 use Parse::Pidl::Util qw(has_property is_constant);
 use Parse::Pidl::NDR qw(GetNextLevel);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
+use Parse::Pidl qw(fatal);
 use strict;
 
 use vars qw($VERSION);
index 4dfd57dc20a7c17083bbbfe78ef9ffb2c89c7275..220d62cd715f8be269b5f62412124a3f86d9d41f 100755 (executable)
@@ -52,6 +52,10 @@ both marshalling/unmarshalling and debugging purposes).
 =item I<--help>
 
 Show list of available options.
+
+=item I<--version>
+
+Show pidl version
                
 =item I<--outputdir OUTNAME>
 
@@ -403,7 +407,7 @@ use lib "$RealBin";
 use lib "$RealBin/lib";
 use Getopt::Long;
 use File::Basename;
-use Parse::Pidl;
+use Parse::Pidl qw ( $VERSION );
 use Parse::Pidl::Util;
 
 #####################################################################
@@ -453,6 +457,7 @@ sub FileSave($$)
 
 my(@opt_incdirs) = (); 
 my($opt_help) = 0;
+my($opt_version) = 0;
 my($opt_parse_idl_tree) = 0;
 my($opt_dump_idl_tree);
 my($opt_dump_ndr_tree);
@@ -483,7 +488,9 @@ my($opt_warn_compat) = 0;
 # display help text
 sub ShowHelp()
 {
-print "perl IDL parser and code generator
+print "perl IDL parser and code generator\n";
+ShowVersion();
+print"
 Copyright (C) Andrew Tridgell <tridge\@samba.org>
 Copyright (C) Jelmer Vernooij <jelmer\@samba.org>
 
@@ -491,6 +498,7 @@ Usage: $Script [options] [--] <idlfile> [<idlfile>...]
 
 Generic Options:
  --help                  this help page
+ --version               show pidl version
  --outputdir=OUTDIR      put output in OUTDIR/ [.]
  --warn-compat           warn about incompatibility with other compilers
  --quiet                 be quiet
@@ -528,9 +536,17 @@ Wireshark parsers:
     exit(0);
 }
 
+#########################################
+# Display version
+sub ShowVersion()
+{
+    print "perl IDL version $VERSION\n";
+}
+
 # main program
 my $result = GetOptions (
            'help|h|?' => \$opt_help, 
+            'version' => \$opt_version,
            'outputdir=s' => \$opt_outputdir,
            'dump-idl' => \$opt_dump_idl,
                'dump-idl-tree:s' => \$opt_dump_idl_tree,
@@ -565,6 +581,11 @@ if ($opt_help) {
     exit(0);
 }
 
+if ($opt_version) {
+    ShowVersion();
+    exit(0);
+}
+
 sub process_file($)
 {
        my $idl_file = shift;
diff --git a/source4/pidl/tests/samba3-srv.pl b/source4/pidl/tests/samba3-srv.pl
new file mode 100644 (file)
index 0000000..d1e2bc9
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+# (C) 2008 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU General Public License
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl::Util qw(MyDumper has_property);
+use Parse::Pidl::Samba3::ServerNDR qw(DeclLevel);
+
+my $l = { TYPE => "DATA", DATA_TYPE => "uint32" }; 
+my $e = { FILE => "foo", LINE => 0, PROPERTIES => { }, TYPE => "uint32",
+          LEVELS => [ $l ] };
+
+is("uint32_t", DeclLevel($e, 0));
index 03f360125766a3efdee58910a6a43b35188f2b43..760d774f2ea6ebc46a8bcebaf199bb077f8e894f 100644 (file)
@@ -2910,6 +2910,9 @@ static NTSTATUS dcesrv_samr_DeleteUser(struct dcesrv_call_state *dce_call, TALLO
 
        ret = ldb_delete(a_state->sam_ctx, a_state->account_dn);
        if (ret != 0) {
+               DEBUG(1, ("Failed to delete user: %s: %s\n", 
+                         ldb_dn_get_linearized(a_state->account_dn), 
+                         ldb_errstring(a_state->sam_ctx)));
                return NT_STATUS_UNSUCCESSFUL;
        }
 
index 8b680ba973a8c7c07d6f445a5b3a3550d34c99db..656ecdae1622c1023dfe084ae7c8b7928b6e46a9 100644 (file)
@@ -1,10 +1,6 @@
-#######################
-# Start LIBRARY EJSRPC
 [SUBSYSTEM::EJSRPC]
 OBJ_FILES = \
                ejsrpc.o
-# End SUBSYSTEM EJSRPC
-#######################
 
 [MODULE::smbcalls_config]
 OBJ_FILES = smbcalls_config.o
@@ -79,11 +75,7 @@ INIT_FUNCTION = smb_setup_ejs_system
 
 include ejsnet/config.mk
 
-#######################
-# Start LIBRARY smbcalls
-[LIBRARY::smbcalls]
-SO_VERSION = 0
-VERSION = 0.0.1
+[SUBSYSTEM::smbcalls]
 PRIVATE_PROTO_HEADER = proto.h
 OBJ_FILES = \
                smbcalls.o \
@@ -101,8 +93,6 @@ PRIVATE_DEPENDENCIES = \
                CREDENTIALS POPT_CREDENTIALS POPT_SAMBA \
                dcerpc \
                NDR_TABLE
-# End SUBSYSTEM smbcalls
-#######################
 
 #######################
 # Start BINARY SMBSCRIPT
index 266bac1a75d70909b944587f7d751fa047d10e7d..0cca49dec912488a494c95cd236bd4880fece22d 100644 (file)
@@ -398,9 +398,6 @@ function provision_default_paths(subobj)
        paths.named_conf = lp.get("private dir") + "/named.conf";
        paths.winsdb = "wins.ldb";
        paths.ldapdir = lp.get("private dir") + "/ldap";
-       paths.ldap_basedn_ldif = paths.ldapdir + "/" + dnsdomain + ".ldif";
-       paths.ldap_config_basedn_ldif = paths.ldapdir + "/" + dnsdomain + "-config.ldif";
-       paths.ldap_schema_basedn_ldif = paths.ldapdir + "/" + dnsdomain + "-schema.ldif";
 
        paths.s4_ldapi_socket = lp.get("private dir") + "/ldapi";
        paths.phpldapadminconfig = lp.get("private dir") + "/phpldapadmin-config.php";
@@ -866,6 +863,12 @@ function provision_schema(subobj, message, tmp_schema_path, paths)
        /* This will erase anything in the tmp db */
        var samdb = open_ldb(info, tmp_schema_path, true);
 
+       message("Setting up sam.ldb attributes\n");
+       setup_add_ldif("provision_init.ldif", info, samdb, false);
+
+       message("Setting up sam.ldb rootDSE\n");
+       setup_add_ldif("provision_rootdse_add.ldif", info, samdb, false);
+
        message("Adding schema container (permitted to fail)\n");
        var add_ok = setup_add_ldif("provision_schema_basedn.ldif", info, samdb, true);
        message("Modifying schema container\n");
@@ -934,34 +937,6 @@ function provision_dns(subobj, message, paths, session_info, credentials)
        message("Please install the zone located in " + paths.dns + " into your DNS server.  A sample BIND configuration snippit is at " + paths.named_conf + "\n");
 }
 
-/* Write out a DNS zone file, from the info in the current database */
-function provision_ldapbase(subobj, message, paths)
-{
-       var ok = provision_fix_subobj(subobj, paths);
-       assert(ok);
-
-       message("Setting up LDAP base entry: " + subobj.DOMAINDN + " \n");
-       var rdns = split(",", subobj.DOMAINDN);
-       subobj.EXTENSIBLEOBJECT = "objectClass: extensibleObject";
-
-       subobj.RDN_DC = substr(rdns[0], strlen("DC="));
-
-       sys.mkdir(paths.ldapdir, 0700);
-
-       setup_file("provision_basedn.ldif", 
-                  message, paths.ldap_basedn_ldif, 
-                  subobj);
-
-       setup_file("provision_configuration_basedn.ldif", 
-                  message, paths.ldap_config_basedn_ldif, 
-                  subobj);
-
-       setup_file("provision_schema_basedn.ldif", 
-                  message, paths.ldap_schema_basedn_ldif, 
-                  subobj);
-
-}
-
 
 /*
   guess reasonably default options for provisioning
@@ -1038,14 +1013,13 @@ function provision_guess()
        subobj.DOMAINDN_LDB = "users.ldb";
        subobj.CONFIGDN_LDB = "configuration.ldb";
        subobj.SCHEMADN_LDB = "schema.ldb";
-       subobj.DOMAINDN_MOD = "pdc_fsmo,password_hash";
-       subobj.CONFIGDN_MOD = "naming_fsmo";
-       subobj.SCHEMADN_MOD = "schema_fsmo";
+       subobj.DOMAINDN_MOD = "pdc_fsmo,password_hash,instancetype";
+       subobj.CONFIGDN_MOD = "naming_fsmo,instancetype";
+       subobj.SCHEMADN_MOD = "schema_fsmo,instancetype";
        subobj.DOMAINDN_MOD2 = ",objectguid";
        subobj.CONFIGDN_MOD2 = ",objectguid";
        subobj.SCHEMADN_MOD2 = ",objectguid";
 
-       subobj.EXTENSIBLEOBJECT = "# no objectClass: extensibleObject for local ldb";
        subobj.ACI              = "# no aci for local ldb";
 
        return subobj;
index f00b4779199a0d6b00b7a607329e51b6c1b73ebd..450da0e90a66603ed4bbff7b2e479089bc29b4ee 100644 (file)
@@ -16,7 +16,7 @@ PRIVATE_DEPENDENCIES = LIBNDR LIBLDB SAMDB CREDENTIALS
 SWIG_FILE = misc.i
 
 # Swig extensions
-swig: pythonmods
+swig:: pythonmods
 
 .SUFFIXES: _wrap.c .i
 
@@ -28,13 +28,19 @@ realdistclean::
        @-rm -f bin/python/*
        # FIXME: Remove _wrap.c files
 
-pythonmods: $(PYTHON_DSOS)
+pythonmods:: $(PYTHON_DSOS) $(PYTHON_PYS)
 
 PYDOCTOR_MODULES=bin/python/ldb.py bin/python/auth.py bin/python/credentials.py bin/python/registry.py bin/python/tdb.py bin/python/security.py bin/python/events.py bin/python/net.py
 
 pydoctor:: pythonmods
        LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --make-html --docformat=restructuredtext --add-package scripting/python/samba/ $(addprefix --add-module , $(PYDOCTOR_MODULES))
 
+installpython:: pythonmods
+       @$(SHELL) $(srcdir)/script/installpython.sh \
+               $(INSTALLPERMS) \
+               $(DESTDIR)$(PYTHONDIR) \
+               scripting/python bin/python
+
 clean::
        @echo "Removing python modules"
        @rm -f bin/python/*
index b2dd50b507961aea005804a9b4d5f2acd0ce9cb9..fff981e94176c1bf4eab060fcbd261c4c61e5afd 100644 (file)
@@ -46,6 +46,8 @@ static void initdcerpc_security(void) {}
 extern void initlsa(void);
 extern void initsvcctl(void);
 extern void initwkssvc(void);
+extern void init_libcli_nbt(void);
+extern void init_libcli_smb(void);
 
 static struct _inittab py_modules[] = { STATIC_LIBPYTHON_MODULES };
 
index 1607cb343bf6d3397e3ff5db587d7d98113e7b80..d59cea121e8b0e4c0467867bd1d4e4eed110c1f2 100644 (file)
@@ -180,12 +180,6 @@ def provision_paths_from_lp(lp, dnsdomain):
     paths.dns_keytab = os.path.join(private_dir, "dns.keytab")
     paths.dns = os.path.join(private_dir, dnsdomain + ".zone")
     paths.winsdb = os.path.join(private_dir, "wins.ldb")
-    paths.ldap_basedn_ldif = os.path.join(private_dir, 
-                                          dnsdomain + ".ldif")
-    paths.ldap_config_basedn_ldif = os.path.join(private_dir, 
-                                             dnsdomain + "-config.ldif")
-    paths.ldap_schema_basedn_ldif = os.path.join(private_dir, 
-                                              dnsdomain + "-schema.ldif")
     paths.s4_ldapi_path = os.path.join(private_dir, "ldapi")
     paths.phpldapadminconfig = os.path.join(private_dir, 
                                             "phpldapadmin-config.php")
@@ -465,7 +459,6 @@ def setup_samdb(path, setup_path, session_info, credentials, lp,
         setup_add_ldif(samdb, setup_path("provision_basedn.ldif"), {
             "DOMAINDN": domaindn,
             "ACI": aci,
-            "EXTENSIBLEOBJECT": "# no objectClass: extensibleObject for local ldb",
             "RDN_DC": rdn_dc,
             })
 
@@ -823,31 +816,6 @@ def create_zone_file(path, setup_path, samdb, dnsdomain, domaindn,
         })
 
 
-def provision_ldapbase(setup_dir, message, paths):
-    """Write out a DNS zone file, from the info in the current database."""
-    message("Setting up LDAP base entry: %s" % domaindn)
-    rdns = domaindn.split(",")
-
-    rdn_dc = rdns[0][len("DC="):]
-
-    def setup_path(file):
-        return os.path.join(setup_dir, file)
-
-    setup_file(setup_path("provision_basedn.ldif"), 
-           paths.ldap_basedn_ldif)
-
-    setup_file(setup_path("provision_configuration_basedn.ldif"), 
-           paths.ldap_config_basedn_ldif)
-
-    setup_file(setup_path("provision_schema_basedn.ldif"), 
-           paths.ldap_schema_basedn_ldif, {
-            "SCHEMADN": schemadn,
-            "ACI": "# no aci for local ldb",
-            "EXTENSIBLEOBJECT": "objectClass: extensibleObject"})
-
-    message("Please install the LDIF located in " + paths.ldap_basedn_ldif + ", " + paths.ldap_config_basedn_ldif + " and " + paths.ldap_schema_basedn_ldif + " into your LDAP server, and re-run with --ldap-backend=ldap://my.ldap.server")
-
-
 def load_schema(setup_path, samdb, schemadn, netbiosname, configdn):
     """Load schema.
     
index a0afda3d1966744d8aeee48bedcf9334a23750c6..3250f32ec7891073a48e5e5b7f60f5f476fe7aa9 100644 (file)
@@ -1,6 +1,23 @@
+# vim: ft=rst
+
 This directory contains test scripts that are useful for running a
 bunch of tests all at once. 
 
+===============
+Available tests
+===============
+The available tests are obtained from a script, usually 
+selftest/samba{3,4}_tests.sh. This script should for each test output 
+the name of the test, the command to run and the environment that should be 
+provided.
+
+============
+Environments
+============
+Tests often need to run against a server with particular things set up, 
+a "environment". This environment is provided by the test "target": Samba 3, 
+Samba 4 or Windows.
+
 The following environments are currently available:
 
  - none: No server set up, no variables set.
index 96409558b186daf5c5203d1d4514688bcc7e4a8b..004332a1fc0b131fd3fdc9bc8c6430e85274f399 100755 (executable)
@@ -67,7 +67,7 @@ these tests will be counted as successes, successes will be counted as failures.
 
 The format for the file is, one entry per line:
 
-TESTSUITE-NAME/TEST-NAME
+TESTSUITE-NAME.TEST-NAME
 
 The reason for a test can also be specified, by adding a hash sign (#) and the reason 
 after the test name.
@@ -130,9 +130,6 @@ use POSIX;
 use Cwd qw(abs_path);
 use lib "$RealBin";
 use Subunit qw(parse_results);
-use env::Samba3;
-use env::Samba4;
-use env::Windows;
 use SocketWrapper;
 
 my $opt_help = 0;
@@ -429,17 +426,20 @@ my $testenv_default = "none";
 
 if ($opt_target eq "samba4") {
        $testenv_default = "member";
+       require target::Samba4;
        $target = new Samba4($opt_bindir or "$srcdir/bin", $ldap, "$srcdir/setup");
 } elsif ($opt_target eq "samba3") {
        if ($opt_socket_wrapper and `$opt_bindir/smbd -b | grep SOCKET_WRAPPER` eq "") {
                die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'.  Exiting....");
        }
        $testenv_default = "dc";
+       require target::Samba3;
        $target = new Samba3($opt_bindir);
 } elsif ($opt_target eq "win") {
        die("Windows tests will not run with socket wrapper enabled.") 
                if ($opt_socket_wrapper);
        $testenv_default = "dc";
+       require target::Windows;
        $target = new Windows();
 }
 
@@ -741,7 +741,6 @@ sub teardown_env($)
        delete $running_envs{$envname};
 }
 
-
 if ($opt_no_lazy_setup) {
        setup_env($_) foreach (keys %required_envs);
 }
index b76955a0cbeb45ff8eda65180c2c61575eba43df..7d6633244de8bea9916b4bc16b3c26f268a128e9 100644 (file)
@@ -1,22 +1,16 @@
 dn: CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: container
-showInAdvancedViewOnly: TRUE
-instanceType: 4
 
 dn: CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: container
 cn: 409
-name: 409
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 
 dn: CN=user-Display,CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: displaySpecifier
 cn: user-Display
-name: user-Display
 contextMenu: 0,{62AE1F9A-126A-11D0-A14B-0800361B1103}
 adminPropertyPages: 9,{FA3E1D55-16DF-446d-872E-BD04D4F39C93}
 adminPropertyPages: 8,{0910dd01-df8c-11d1-ae27-00c04fa35813}
@@ -35,7 +29,6 @@ dn: CN=group-Display,CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: displaySpecifier
 cn: group-Display
-name: group-Display
 contextMenu: 0,{62AE1F9A-126A-11D0-A14B-0800361B1103}
 adminPropertyPages: 4,{4E40F770-369C-11d0-8922-00A024AB2DBB}
 adminPropertyPages: 3,{6dfe6488-a212-11d0-bcd5-00c04fd8d5b6}
@@ -63,7 +56,6 @@ dn: CN=computer-Display,CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: displaySpecifier
 cn: computer-Display
-name: computer-Display
 contextMenu: 0,{62AE1F9A-126A-11D0-A14B-0800361B1103}
 adminPropertyPages: 10,{0F65B1BF-740F-11d1-BBE6-0060081692B3}
 adminPropertyPages: 7,{B52C1E50-1DD2-11D1-BC43-00C04FC31FD3}
@@ -81,7 +73,6 @@ dn: CN=organizationalUnit-Display,CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: displaySpecifier
 cn: organizationalUnit-Display
-name: organizationalUnit-Display
 contextMenu: 0,{62AE1F9A-126A-11D0-A14B-0800361B1103}
 adminPropertyPages: 6,{FA3E1D55-16DF-446d-872E-BD04D4F39C93}
 adminPropertyPages: 5,{4E40F770-369C-11d0-8922-00A024AB2DBB}
@@ -97,7 +88,6 @@ dn: CN=container-Display,CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: displaySpecifier
 cn: container-Display
-name: container-Display
 contextMenu: 0,{62AE1F9A-126A-11D0-A14B-0800361B1103}
 adminPropertyPages: 3,{4E40F770-369C-11d0-8922-00A024AB2DBB}
 adminPropertyPages: 2,{6dfe6488-a212-11d0-bcd5-00c04fd8d5b6}
@@ -112,7 +102,6 @@ dn: CN=default-Display,CN=409,CN=DisplaySpecifiers,${CONFIGDN}
 objectClass: top
 objectClass: displaySpecifier
 cn: default-Display
-name: default-Display
 adminPropertyPages: 3,{4E40F770-369C-11d0-8922-00A024AB2DBB}
 adminPropertyPages: 2,{6dfe6488-a212-11d0-bcd5-00c04fd8d5b6}
 adminPropertyPages: 1,{6384e23e-736d-11d1-bd0d-00c04fd8d5b6}
index ce1e8a6b4f0c74b589157f0c28bbf365b559f57e..8b24c510401c24c81c0bc3211eeb490e7be195b2 100755 (executable)
@@ -123,7 +123,6 @@ for (r in options) {
 }
 
 var blank = (options["blank"] != undefined);
-var ldapbase = (options["ldap-base"] != undefined);
 var ldapbackend = (options["ldap-backend"] != undefined);
 var ldapmodule = (options["ldap-module"] != undefined);
 var partitions_only = (options["partitions-only"] != undefined);
@@ -161,10 +160,7 @@ var system_session = system_session();
 var creds = options.get_credentials();
 message("Provisioning for %s in realm %s\n", subobj.DOMAIN, subobj.REALM);
 message("Using administrator password: %s\n", subobj.ADMINPASS);
-if (ldapbase) {
-       provision_ldapbase(subobj, message, paths);
-       message("Please install the LDIF located in " + paths.ldap_basedn_ldif + ", " + paths.ldap_config_basedn_ldif + " and " + paths.ldap_schema_basedn_ldif + " into your LDAP server, and re-run with --ldap-backend=ldap://my.ldap.server\n");
-} else if (partitions_only) {
+if (partitions_only) {
        provision_become_dc(subobj, message, false, paths, system_session);
 } else {
        provision(subobj, message, blank, paths, system_session, creds, ldapbackend);
index ba9e67f22955bdf4a9c2fa157e7bdc846f8dc809..abd1b9a875a25614001fbd05027badc5877fe71d 100755 (executable)
@@ -101,7 +101,7 @@ var backend_schema;
 var slapd_command;
 if (options["ldap-backend-type"] == "fedora-ds") {
        mapping = "schema-map-fedora-ds-1.0";
-       backend_schema = "backend-schema.ldif";
+       backend_schema = "99_ad.ldif";
        if (options["ldap-backend-port"] != undefined) {
                message("Will listen on TCP port " + options["ldap-backend-port"] + "\n");
                subobj.SERVERPORT="ServerPort = " + options["ldap-backend-port"];
@@ -114,9 +114,8 @@ if (options["ldap-backend-type"] == "fedora-ds") {
 
        slapd_command = "(see documentation)";
 } else if (options["ldap-backend-type"] == "openldap") {
-       provision_ldapbase(subobj, message, paths);
        mapping = "schema-map-openldap-2.3";
-       backend_schema = "99_ad.ldif";
+       backend_schema = "backend-schema.schema";
        setup_file("slapd.conf", message, subobj.LDAPDIR + "/slapd.conf", subobj);
        setup_file("modules.conf", message, subobj.LDAPDIR + "/modules.conf", subobj);
        sys.mkdir(subobj.LDAPDIR + "/db", 0700);
@@ -169,9 +168,10 @@ memberof-dangling-error 32
                }
        }
 
-       memberof_config = "overlay refint
+       memberof_config = memberof_config + "
+overlay refint
 refint_attributes" + refint_attributes + "
-" + memberof_config;
+";
        
        ok = sys.file_save(subobj.LDAPDIR + "/memberof.conf", memberof_config);
        if (!ok) {
index c6b07c5751eae60fdd01ed4a2414c792c3f2cb71..3fb9361d0b399fdb9ff7b99862e05afcdeeafb79 100644 (file)
@@ -3,28 +3,24 @@ objectClass: top
 objectClass: organizationalUnit
 cn: Domain Controllers
 description: Default container for domain controllers
-instanceType: 4
-showInAdvancedViewOnly: FALSE
 systemFlags: 2348810240
 isCriticalSystemObject: TRUE
+showInAdvancedViewOnly: FALSE
 
 dn: CN=ForeignSecurityPrincipals,${DOMAINDN}
 objectClass: top
 objectClass: container
 cn: ForeignSecurityPrincipals
 description: Default container for security identifiers (SIDs) associated with objects from external, trusted domains
-instanceType: 4
-showInAdvancedViewOnly: FALSE
 systemFlags: 2348810240
 isCriticalSystemObject: TRUE
+showInAdvancedViewOnly: FALSE
 
 dn: CN=System,${DOMAINDN}
 objectClass: top
 objectClass: container
 cn: System
 description: Builtin system settings
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2348810240
 isCriticalSystemObject: TRUE
 
@@ -32,8 +28,6 @@ dn: CN=RID Manager$,CN=System,${DOMAINDN}
 objectclass: top
 objectclass: rIDManager
 cn: RID Manager$
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2348810240
 isCriticalSystemObject: TRUE
 fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
@@ -43,23 +37,17 @@ dn: CN=DomainUpdates,CN=System,${DOMAINDN}
 objectClass: top
 objectClass: container
 cn: DomainUpdates
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Windows2003Update,CN=DomainUpdates,CN=System,${DOMAINDN}
 objectClass: top
 objectClass: container
 cn: Windows2003Update
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 revision: 8
 
 dn: CN=Infrastructure,${DOMAINDN}
 objectclass: top
 objectclass: infrastructureUpdate
 cn: Infrastructure
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2348810240
 isCriticalSystemObject: TRUE
 fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
@@ -68,8 +56,6 @@ dn: CN=Builtin,${DOMAINDN}
 objectClass: top
 objectClass: builtinDomain
 cn: Builtin
-instanceType: 4
-showInAdvancedViewOnly: FALSE
 forceLogoff: 9223372036854775808
 lockoutDuration: -18000000000
 lockOutObservationWindow: -18000000000
@@ -86,6 +72,7 @@ serverState: 1
 uASCompat: 1
 modifiedCount: 1
 isCriticalSystemObject: TRUE
+showInAdvancedViewOnly: FALSE
 
 dn: CN=Policies,CN=System,${DOMAINDN}
 objectClass: top
index e166d5f3dd28fc76ba06cd7732b12d0b23ceb702..88015ce0a314f9ef0945a39b4f0bd59d27a462f6 100755 (executable)
@@ -34,7 +34,7 @@ from auth import system_session
 import samba.getopt as options
 import param
 from samba.provision import (provision,  
-                             provision_paths_from_lp, provision_ldapbase)
+                             provision_paths_from_lp)
 
 parser = optparse.OptionParser("provision [options]")
 parser.add_option_group(options.SambaOptions(parser))
@@ -81,9 +81,6 @@ parser.add_option("--users", type="string", metavar="GROUPNAME",
 parser.add_option("--quiet", help="Be quiet", action="store_true")
 parser.add_option("--blank", action="store_true",
                help="do not add users or groups, just the structure")
-parser.add_option("--ldap-base", 
-               help="output only an LDIF file, suitable for creating an LDAP baseDN",
-        action="store_true")
 parser.add_option("--ldap-backend", type="string", metavar="LDAPSERVER", 
                help="LDAP server to use for this provision")
 parser.add_option("--ldap-module=", type="string", metavar="MODULE", 
@@ -152,10 +149,7 @@ creds = credopts.get_credentials()
 setup_dir = opts.setupdir
 if setup_dir is None:
        setup_dir = "setup"
-if opts.ldap_base:
-       provision_ldapbase(setup_dir, message, paths)
-       message("Please install the LDIF located in %s, %s and  into your LDAP server, and re-run with --ldap-backend=ldap://my.ldap.server" % (paths.ldap_basedn_ldif, paths.ldap_config_basedn_ldif, paths.ldap_schema_basedn_ldif))
-elif opts.partitions_only:
+if opts.partitions_only:
     provision_become_dc(setup_dir, message, False, 
                         paths, lp, system_session(), creds)
 else:
index 234c1f9e8ff4e73bd561a9d98874aa2a3dedfdab..3c7537f013ad942a57f6763bfcc63cafc6cc0c7e 100644 (file)
@@ -5,7 +5,6 @@ dn: ${DOMAINDN}
 objectClass: top
 objectClass: domain
 objectClass: domainDNS
-${EXTENSIBLEOBJECT}
 ${ACI}
 dc: ${RDN_DC}
 
index b7502e5107fac230573893a8fb09dc4767e64633..3bb4074d424d1e51d468f573c6b9db0744d6a9e8 100644 (file)
@@ -3,9 +3,6 @@ changetype: modify
 replace: description
 description: Default container for upgraded computer accounts
 -
-replace: instanceType
-instanceType: 4
--
 replace: showInAdvancedViewOnly
 showInAdvancedViewOnly: FALSE
 -
index 050f110d9a4adad188c9b0af71bac031a6a5a8ce..0fe90b07395f19b80d422344a480c496eb02f312 100644 (file)
@@ -5,8 +5,6 @@ dn: CN=Partitions,${CONFIGDN}
 objectClass: top
 objectClass: crossRefContainer
 cn: Partitions
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2147483648
 msDS-Behavior-Version: 0
 fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
@@ -15,8 +13,6 @@ dn: CN=Enterprise Configuration,CN=Partitions,${CONFIGDN}
 objectClass: top
 objectClass: crossRef
 cn: Enterprise Configuration
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 1
 nCName: ${CONFIGDN}
 dnsRoot: ${DNSDOMAIN}
@@ -25,8 +21,6 @@ dn: CN=Enterprise Schema,CN=Partitions,${CONFIGDN}
 objectClass: top
 objectClass: crossRef
 cn: Enterprise Schema
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 1
 nCName: ${SCHEMADN}
 dnsRoot: ${DNSDOMAIN}
@@ -35,8 +29,6 @@ dn: CN=${DOMAIN},CN=Partitions,${CONFIGDN}
 objectClass: top
 objectClass: crossRef
 cn: ${DOMAIN}
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 3
 nCName: ${DOMAINDN}
 nETBIOSName: ${DOMAIN}
@@ -46,62 +38,46 @@ dn: CN=Sites,${CONFIGDN}
 objectClass: top
 objectClass: sitesContainer
 cn: Sites
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2181038080
 
 dn: CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
 objectClass: top
 objectClass: site
 cn: ${DEFAULTSITE}
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2181038080
 
 dn: CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
 objectClass: top
 objectClass: serversContainer
 cn: Servers
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2181038080
 
 dn: CN=Services,${CONFIGDN}
 objectClass: top
 objectClass: container
 cn: Services
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 2147483648
 
 dn: CN=Windows NT,CN=Services,${CONFIGDN}
 objectClass: top
 objectClass: container
 cn: Windows NT
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Directory Service,CN=Windows NT,CN=Services,${CONFIGDN}
 objectClass: top
 objectClass: nTDSService
 cn: Directory Service
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 sPNMappings: host=ldap,dns,cifs,http
 
 dn: CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,${CONFIGDN}
 objectClass: top
 objectClass: container
 cn: Query-Policies
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Default Query Policy,CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,${CONFIGDN}
 objectClass: top
 objectClass: queryPolicy
 cn: Default Query Policy
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 lDAPAdminLimits: MaxValRange=1500
 lDAPAdminLimits: MaxReceiveBuffer=10485760
 lDAPAdminLimits: MaxDatagramRecv=4096
index df1e1b19bad899c48b45ce39408322ae7c53c233..575f8faa0a0b9e778e68104e93fa585e8c977414 100644 (file)
@@ -4,6 +4,5 @@
 dn: ${CONFIGDN}
 objectClass: top
 objectClass: configuration
-${EXTENSIBLEOBJECT}
 ${ACI}
 cn: Configuration
index 46ba4e9649a5a398f8f3ede8f61bbf84a8775a55..9b87e1ceadd7b4cff675fee23931ef0c604f1d1b 100644 (file)
@@ -3,14 +3,5 @@
 ###############################
 dn: ${CONFIGDN}
 changetype: modify
-replace: instanceType
-instanceType: 13
--
-replace: showInAdvancedViewOnly
-showInAdvancedViewOnly: TRUE
--
-replace: objectCategory
-objectCategory: CN=Configuration,${SCHEMADN}
--
 replace: subRefs
 subRefs: ${SCHEMADN}
index 7b4f59907236da775726f7cdd42be95db67b6a27..fbfd4c09d671cef4d838a3841d5651b6ce981c9e 100644 (file)
@@ -4,6 +4,5 @@
 dn: ${SCHEMADN}
 objectClass: top
 objectClass: dMD
-${EXTENSIBLEOBJECT}
 ${ACI}
 cn: Schema
index 92c5cf1ace42e601c24baada6f9e6c8619889906..4e690376d7b9e1eb86d58f88e1a0a872f43b2964 100644 (file)
@@ -3,12 +3,6 @@
 ###############################
 dn: ${SCHEMADN}
 changetype: modify
-replace: instanceType
-instanceType: 13
--
-replace: showInAdvancedViewOnly
-showInAdvancedViewOnly: TRUE
--
 replace: fSMORoleOwner
 fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
 -
index 06230e8d005673d5d8ab0f65f16b8b5a5309cafe..58669660f4d339b2f8f195b1bc00965a7271919c 100644 (file)
@@ -30,7 +30,6 @@ objectClass: organizationalPerson
 objectClass: user
 cn: dns
 description: DNS Service Account
-showInAdvancedViewOnly: TRUE
 userAccountControl: 514
 accountExpires: 9223372036854775807
 sAMAccountName: dns
@@ -38,13 +37,12 @@ sAMAccountType: 805306368
 servicePrincipalName: DNS/${DNSDOMAIN}
 isCriticalSystemObject: TRUE
 sambaPassword:: ${DNSPASS_B64}
+showInAdvancedViewOnly: TRUE
 
 dn: CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
 objectClass: top
 objectClass: server
 cn: ${NETBIOSNAME}
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 1375731712
 dNSHostName: ${DNSNAME}
 serverReference: CN=${NETBIOSNAME},OU=Domain Controllers,${DOMAINDN}
@@ -55,8 +53,6 @@ objectClass: applicationSettings
 objectClass: nTDSDSA
 cn: NTDS Settings
 options: 1
-instanceType: 4
-showInAdvancedViewOnly: TRUE
 systemFlags: 33554432
 dMDLocation: ${SCHEMADN}
 invocationId: ${INVOCATIONID}
index 8797efaf9861d2f1f224b13c3be8ea7933ff447d..fafedc6966925160a9f07d492facf710caee4f09 100644 (file)
@@ -66,12 +66,10 @@ sAMAccountType: 268435456
 #
 # dn: CN=TemplateAlias,CN=Templates
 # cn: TemplateAlias
-# instanceType: 4
 # groupType: -2147483644
 # sAMAccountType: 268435456
 
 dn: CN=TemplateForeignSecurityPrincipal,CN=Templates
-showInAdvancedViewOnly: TRUE
 
 dn: CN=TemplateSecret,CN=Templates
 
index 7c1a438d8e0f681f0788cb6df504214a408a9e4f..05fde1597405e2999510f94a3d82db11daee4569 100644 (file)
@@ -134,7 +134,6 @@ objectClass: top
 objectClass: group
 cn: RAS and IAS Servers
 description: Servers in this group can access remote access properties of users
-instanceType: 4
 objectSid: ${DOMAINSID}-553
 sAMAccountName: RAS and IAS Servers
 sAMAccountType: 536870912
@@ -307,7 +306,6 @@ objectClass: top
 objectClass: group
 cn: Server Operators
 description: Members can administer domain servers
-instanceType: 4
 objectSid: S-1-5-32-549
 adminCount: 1
 sAMAccountName: Server Operators
@@ -327,7 +325,6 @@ objectClass: top
 objectClass: group
 cn: Account Operators
 description: Members can administer domain user and group accounts
-instanceType: 4
 objectSid: S-1-5-32-548
 adminCount: 1
 sAMAccountName: Account Operators
@@ -404,173 +401,148 @@ objectClass: top
 objectClass: container
 cn: WellKnown Security Principals
 systemFlags: 2147483648
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Anonymous Logon,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Anonymous Logon
 objectSid: S-1-5-7
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Authenticated Users,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Authenticated Users
 objectSid: S-1-5-11
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Batch,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Batch
 objectSid: S-1-5-3
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Creator Group,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Creator Group
 objectSid: S-1-3-1
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Creator Owner,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Creator Owner
 objectSid: S-1-3-0
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Dialup,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Dialup
 objectSid: S-1-5-1
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Digest Authentication,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Digest Authentication
 objectSid: S-1-5-64-21
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Enterprise Domain Controllers,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Enterprise Domain Controllers
 objectSid: S-1-5-9
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Everyone,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Everyone
 objectSid: S-1-1-0
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Interactive,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Interactive
 objectSid: S-1-5-4
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Local Service,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Local Service
 objectSid: S-1-5-19
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Network,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Network
 objectSid: S-1-5-2
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Network Service,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Network Service
 objectSid: S-1-5-20
-showInAdvancedViewOnly: TRUE
 
 dn: CN=NTLM Authentication,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: NTLM Authentication
 objectSid: S-1-5-64-10
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Other Organization,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Other Organization
 objectSid: S-1-5-1000
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Proxy,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Proxy
 objectSid: S-1-5-8
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Remote Interactive Logon,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Remote Interactive Logon
 objectSid: S-1-5-14
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Restricted,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Restricted
 objectSid: S-1-5-12
-showInAdvancedViewOnly: TRUE
 
 dn: CN=SChannel Authentication,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: SChannel Authentication
 objectSid: S-1-5-64-14
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Self,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Self
 objectSid: S-1-5-10
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Service,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Service
 objectSid: S-1-5-6
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Terminal Server User,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Terminal Server User
 objectSid: S-1-5-13
-showInAdvancedViewOnly: TRUE
 
 dn: CN=This Organization,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: This Organization
 objectSid: S-1-5-15
-showInAdvancedViewOnly: TRUE
 
 dn: CN=Well-Known-Security-Id-System,CN=WellKnown Security Principals,${CONFIGDN}
 objectClass: top
 objectClass: foreignSecurityPrincipal
 cn: Well-Known-Security-Id-System
 objectSid: S-1-5-18
-showInAdvancedViewOnly: TRUE
 
index 42dff070807765132218dc784cc442186d2d9f1c..06954c44f06324b2cf93599438636c257be2d116 100644 (file)
@@ -3,9 +3,6 @@ changetype: modify
 replace: description
 description: Default container for upgraded user accounts
 -
-replace: instanceType
-instanceType: 4
--
 replace: showInAdvancedViewOnly
 showInAdvancedViewOnly: FALSE
 -
index e4e86eece93c06a4f43cb797f07e483dabd7f139..83f4da335901daf6055463186860e2bd5b927a41 100644 (file)
@@ -34,6 +34,12 @@ index lDAPDisplayName eq
 index subClassOf eq
 index cn eq
 
+#syncprov is stable in OpenLDAP 2.3, and available in 2.2.  
+#We only need this for the contextCSN attribute anyway....
+overlay syncprov
+syncprov-checkpoint 100 10
+syncprov-sessionlog 100
+
 database        hdb
 suffix         ${CONFIGDN}
 directory      ${LDAPDIR}/db/config
@@ -48,6 +54,12 @@ index dnsRoot eq
 index nETBIOSName eq
 index cn eq
 
+#syncprov is stable in OpenLDAP 2.3, and available in 2.2.  
+#We only need this for the contextCSN attribute anyway....
+overlay syncprov
+syncprov-checkpoint 100 10
+syncprov-sessionlog 100
+
 database        hdb
 suffix         ${DOMAINDN}
 rootdn          ${LDAPMANAGERDN}
index ea0df63f3210f71c173ab368487fc0e2c625183d..c4d1070992ecf79a91727ed4d960bdd7baec99a8 100644 (file)
@@ -10,9 +10,7 @@ PRIVATE_DEPENDENCIES = \
 # End MODULE server_auth
 ################################################
 
-#######################
-# Start SUBSERVICE
-[LIBRARY::service]
+[SUBSYSTEM::service]
 PRIVATE_PROTO_HEADER = service_proto.h
 OBJ_FILES = \
                service.o \
@@ -20,8 +18,6 @@ OBJ_FILES = \
                service_task.o
 PRIVATE_DEPENDENCIES = \
                MESSAGING samba-socket
-# End SUBSYSTEM SERVER
-#######################
 
 [SUBSYSTEM::PIDFILE]
 OBJ_FILES = pidfile.o
index 4d927a640c8bbb8df6542bd5249669f0604f55ac..d6b7698e74f60924dd8e91a53e007fcaab5ba33e 100644 (file)
@@ -32,15 +32,8 @@ PRIVATE_DEPENDENCIES = PTHREAD
 # End MODULE process_model_thread
 ################################################
 
-################################################
-# Start SUBSYSTEM process_model
-[LIBRARY::process_model]
-VERSION = 0.0.1
-SO_VERSION = 0
+[SUBSYSTEM::process_model]
 PRIVATE_PROTO_HEADER = process_model_proto.h
 OBJ_FILES = \
                process_model.o
 PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSAMBA-CONFIG
-#
-# End SUBSYSTEM process_model
-################################################
index bbc0bcae82b3870200eb5ef578585fe77ab94fa3..ca6b488af5a0dd86f478be5b5d07cbf8f2c20d19 100644 (file)
@@ -490,9 +490,16 @@ static bool test_stream_delete(struct torture_context *tctx,
        status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo);
        CHECK_STATUS(status, NT_STATUS_DELETE_PENDING);
 
-       finfo.generic.in.file.path = sname1;
-       status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo);
-       CHECK_STATUS(status, NT_STATUS_DELETE_PENDING);
+       if (!torture_setting_bool(tctx, "samba3", false)) {
+
+               /*
+                * S3 doesn't do this yet
+                */
+
+               finfo.generic.in.file.path = sname1;
+               status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo);
+               CHECK_STATUS(status, NT_STATUS_DELETE_PENDING);
+       }
 
        /*
         * fd-based qfileinfo on the stream still works, the stream does not
index 3b96140fb232fc2d786f5ba58e8296f16724bf7a..b08cd05bdb8b89a269ba6d86e5353450bd0a7372 100644 (file)
@@ -529,7 +529,7 @@ static bool create_user(TALLOC_CTX *mem_ctx, struct smbcli_state *cli,
                                username, domain_name, &samr_pipe, &wks_handle,
                                user_sid);
        if (!NT_STATUS_IS_OK(status)) {
-               d_printf("get_wks_handle failed: %s\n", nt_errstr(status));
+               d_printf("get_usr_handle failed: %s\n", nt_errstr(status));
                goto done;
        }