summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--howto.txt59
-rw-r--r--source4/build/m4/public.m411
-rw-r--r--source4/build/smb_build/config_mk.pm4
-rw-r--r--source4/build/smb_build/makefile.pm21
-rw-r--r--source4/dsdb/samdb/ldb_modules/config.mk13
-rw-r--r--source4/dsdb/samdb/ldb_modules/instancetype.c128
-rw-r--r--source4/dsdb/samdb/ldb_modules/linked_attributes.c92
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/simple_ldap_map.c1
-rw-r--r--source4/heimdal_build/config.mk4
-rw-r--r--source4/lib/ldb/python.mk5
-rw-r--r--source4/lib/nss_wrapper/config.mk5
-rw-r--r--source4/lib/policy/config.mk2
-rw-r--r--source4/lib/registry/dir.c6
-rw-r--r--source4/lib/registry/hive.c2
-rw-r--r--source4/lib/registry/ldb.c109
-rw-r--r--source4/lib/registry/local.c2
-rw-r--r--source4/lib/registry/patchfile.c20
-rw-r--r--source4/lib/registry/regf.c24
-rw-r--r--source4/lib/registry/samba.c2
-rw-r--r--source4/lib/registry/tests/hive.c10
-rw-r--r--source4/lib/registry/tests/registry.c20
-rw-r--r--source4/lib/samba3/config.mk5
-rw-r--r--source4/lib/socket_wrapper/config.mk5
-rw-r--r--source4/lib/tdb/common/freelist.c85
-rw-r--r--source4/lib/tdb/common/open.c6
-rw-r--r--source4/lib/tdb/common/tdb.c42
-rw-r--r--source4/lib/tdb/common/tdb_private.h2
-rw-r--r--source4/lib/tdb/common/transaction.c29
-rw-r--r--source4/lib/tdb/common/traverse.c3
-rw-r--r--source4/lib/tdb/docs/README3
-rw-r--r--source4/lib/tdb/include/tdb.h7
-rw-r--r--source4/lib/tdb/tools/tdbtool.c2
-rw-r--r--source4/lib/tdr/config.mk5
-rw-r--r--source4/libcli/config.mk27
-rw-r--r--source4/libcli/swig/libcli_nbt.i1
-rw-r--r--source4/libcli/swig/libcli_nbt.py117
-rw-r--r--source4/libcli/swig/libcli_nbt_wrap.c375
-rw-r--r--source4/libcli/swig/libcli_smb.i3
-rw-r--r--source4/libcli/swig/libcli_smb.py11
-rw-r--r--source4/libcli/swig/libcli_smb_wrap.c229
-rw-r--r--source4/libnet/config.mk5
-rw-r--r--source4/librpc/config.mk15
-rw-r--r--source4/librpc/idl/lsa.idl22
-rw-r--r--source4/librpc/ndr/ndr_compression.c4
-rw-r--r--source4/nsswitch/config.mk5
-rw-r--r--source4/ntptr/config.mk2
-rw-r--r--source4/ntvfs/config.mk5
-rw-r--r--source4/param/config.mk5
-rw-r--r--source4/pidl/lib/Parse/Pidl.pm2
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm6
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4.pm1
-rwxr-xr-xsource4/pidl/pidl25
-rw-r--r--source4/pidl/tests/samba3-srv.pl18
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c3
-rw-r--r--source4/scripting/ejs/config.mk12
-rw-r--r--source4/scripting/libjs/provision.js44
-rw-r--r--source4/scripting/python/config.mk10
-rw-r--r--source4/scripting/python/modules.c2
-rw-r--r--source4/scripting/python/samba/provision.py32
-rw-r--r--source4/selftest/README17
-rwxr-xr-xsource4/selftest/selftest.pl9
-rw-r--r--source4/selftest/target/Samba3.pm (renamed from source4/selftest/env/Samba3.pm)0
-rw-r--r--source4/selftest/target/Samba4.pm (renamed from source4/selftest/env/Samba4.pm)0
-rw-r--r--source4/selftest/target/Windows.pm (renamed from source4/selftest/env/Windows.pm)0
-rw-r--r--source4/setup/display_specifiers.ldif11
-rwxr-xr-xsource4/setup/provision6
-rwxr-xr-xsource4/setup/provision-backend10
-rw-r--r--source4/setup/provision.ldif19
-rwxr-xr-xsource4/setup/provision.py10
-rw-r--r--source4/setup/provision_basedn.ldif1
-rw-r--r--source4/setup/provision_computers_modify.ldif3
-rw-r--r--source4/setup/provision_configuration.ldif24
-rw-r--r--source4/setup/provision_configuration_basedn.ldif1
-rw-r--r--source4/setup/provision_configuration_basedn_modify.ldif9
-rw-r--r--source4/setup/provision_schema_basedn.ldif1
-rw-r--r--source4/setup/provision_schema_basedn_modify.ldif6
-rw-r--r--source4/setup/provision_self_join.ldif6
-rw-r--r--source4/setup/provision_templates.ldif2
-rw-r--r--source4/setup/provision_users.ldif28
-rw-r--r--source4/setup/provision_users_modify.ldif3
-rw-r--r--source4/setup/slapd.conf12
-rw-r--r--source4/smbd/config.mk6
-rw-r--r--source4/smbd/process_model.mk9
-rw-r--r--source4/torture/raw/streams.c13
-rw-r--r--source4/torture/rpc/samba3rpc.c2
87 files changed, 965 insertions, 964 deletions
diff --git a/.gitignore b/.gitignore
index ccc12650c1..9ed0334ea1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/howto.txt b/howto.txt
index 7b10b5960a..654ad658c8 100644
--- 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
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4
index 9e82e6aaf1..6d693eaeee 100644
--- a/source4/build/m4/public.m4
+++ b/source4/build/m4/public.m4
@@ -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
###################################
"
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 7ad6600a8c..d07660ba1d 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -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",
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 0e7771c3f2..7e715b47eb 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -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");
diff --git a/source4/dsdb/samdb/ldb_modules/config.mk b/source4/dsdb/samdb/ldb_modules/config.mk
index a41a29b5dd..dc407fbd8a 100644
--- a/source4/dsdb/samdb/ldb_modules/config.mk
+++ b/source4/dsdb/samdb/ldb_modules/config.mk
@@ -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
index 0000000000..064c28ec65
--- /dev/null
+++ b/source4/dsdb/samdb/ldb_modules/instancetype.c
@@ -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);
+}
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index 803d24e34e..b3fdffe566 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -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++) {
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index d3beedc689..737475ca78 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -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);
diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
index 6e66d0783a..acf2fd622c 100644
--- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
+++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
@@ -448,6 +448,7 @@ static const char * const entryuuid_wildcard_attributes[] = {
"whenChanged",
"usnCreated",
"usnChanged",
+ "memberOf",
NULL
};
diff --git a/source4/heimdal_build/config.mk b/source4/heimdal_build/config.mk
index b534c9bc9f..604516ccf6 100644
--- a/source4/heimdal_build/config.mk
+++ b/source4/heimdal_build/config.mk
@@ -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 = \
diff --git a/source4/lib/ldb/python.mk b/source4/lib/ldb/python.mk
index f81c2e3e16..bbd4c1c5eb 100644
--- a/source4/lib/ldb/python.mk
+++ b/source4/lib/ldb/python.mk
@@ -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
-#######################
diff --git a/source4/lib/nss_wrapper/config.mk b/source4/lib/nss_wrapper/config.mk
index 9751d2bf73..b46f7c3ee7 100644
--- a/source4/lib/nss_wrapper/config.mk
+++ b/source4/lib/nss_wrapper/config.mk
@@ -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
diff --git a/source4/lib/policy/config.mk b/source4/lib/policy/config.mk
index f404d58377..aae98b86b2 100644
--- a/source4/lib/policy/config.mk
+++ b/source4/lib/policy/config.mk
@@ -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
diff --git a/source4/lib/registry/dir.c b/source4/lib/registry/dir.c
index a13e3753b7..27cae8c490 100644
--- a/source4/lib/registry/dir.c
+++ b/source4/lib/registry/dir.c
@@ -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);
diff --git a/source4/lib/registry/hive.c b/source4/lib/registry/hive.c
index bbe510772c..5d56a30b3e 100644
--- a/source4/lib/registry/hive.c
+++ b/source4/lib/registry/hive.c
@@ -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;
}
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 259315cc39..262859f64b 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -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;
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c
index fa59f25596..3e463100c9 100644
--- a/source4/lib/registry/local.c
+++ b/source4/lib/registry/local.c
@@ -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,
diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c
index b6ad7dfb10..fa1367bbd2 100644
--- a/source4/lib/registry/patchfile.c
+++ b/source4/lib/registry/patchfile.c
@@ -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;
}
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c
index 9b126cc808..15b60745f0 100644
--- a/source4/lib/registry/regf.c
+++ b/source4/lib/registry/regf.c
@@ -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 ||
diff --git a/source4/lib/registry/samba.c b/source4/lib/registry/samba.c
index 02f3363bab..599385e73c 100644
--- a/source4/lib/registry/samba.c
+++ b/source4/lib/registry/samba.c
@@ -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);
diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c
index 22b4785222..4d27e83a74 100644
--- a/source4/lib/registry/tests/hive.c
+++ b/source4/lib/registry/tests/hive.c
@@ -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;
diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c
index 75fbe1cbea..7d14b3a412 100644
--- a/source4/lib/registry/tests/registry.c
+++ b/source4/lib/registry/tests/registry.c
@@ -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;
diff --git a/source4/lib/samba3/config.mk b/source4/lib/samba3/config.mk
index 76f1ce5096..705bdd4002 100644
--- a/source4/lib/samba3/config.mk
+++ b/source4/lib/samba3/config.mk
@@ -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 \
diff --git a/source4/lib/socket_wrapper/config.mk b/source4/lib/socket_wrapper/config.mk
index 9e194230dc..4c5cf94348 100644
--- a/source4/lib/socket_wrapper/config.mk
+++ b/source4/lib/socket_wrapper/config.mk
@@ -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
diff --git a/source4/lib/tdb/common/freelist.c b/source4/lib/tdb/common/freelist.c
index c086c151fa..2f2a4c379b 100644
--- a/source4/lib/tdb/common/freelist.c
+++ b/source4/lib/tdb/common/freelist.c
@@ -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;
}
diff --git a/source4/lib/tdb/common/open.c b/source4/lib/tdb/common/open.c
index 6bd8fda2bf..b19e4cea29 100644
--- a/source4/lib/tdb/common/open.c
+++ b/source4/lib/tdb/common/open.c
@@ -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) {
diff --git a/source4/lib/tdb/common/tdb.c b/source4/lib/tdb/common/tdb.c
index fd4e1cc8af..ea5d9ccc60 100644
--- a/source4/lib/tdb/common/tdb.c
+++ b/source4/lib/tdb/common/tdb.c
@@ -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;
-}
-
-
diff --git a/source4/lib/tdb/common/tdb_private.h b/source4/lib/tdb/common/tdb_private.h
index 63a6d04e72..ffac89ff0e 100644
--- a/source4/lib/tdb/common/tdb_private.h
+++ b/source4/lib/tdb/common/tdb_private.h
@@ -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);
diff --git a/source4/lib/tdb/common/transaction.c b/source4/lib/tdb/common/transaction.c
index 0ecfb9b7ff..c3e7a4e2c0 100644
--- a/source4/lib/tdb/common/transaction.c
+++ b/source4/lib/tdb/common/transaction.c
@@ -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;
}
diff --git a/source4/lib/tdb/common/traverse.c b/source4/lib/tdb/common/traverse.c
index 2bde1270a0..07b0c23858 100644
--- a/source4/lib/tdb/common/traverse.c
+++ b/source4/lib/tdb/common/traverse.c
@@ -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)
diff --git a/source4/lib/tdb/docs/README b/source4/lib/tdb/docs/README
index b31ce36ab1..63fcf5e049 100644
--- a/source4/lib/tdb/docs/README
+++ b/source4/lib/tdb/docs/README
@@ -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);
diff --git a/source4/lib/tdb/include/tdb.h b/source4/lib/tdb/include/tdb.h
index 0058d55793..0008085de5 100644
--- a/source4/lib/tdb/include/tdb.h
+++ b/source4/lib/tdb/include/tdb.h
@@ -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;
diff --git a/source4/lib/tdb/tools/tdbtool.c b/source4/lib/tdb/tools/tdbtool.c
index 79435a3571..d104ccd7c4 100644
--- a/source4/lib/tdb/tools/tdbtool.c
+++ b/source4/lib/tdb/tools/tdbtool.c
@@ -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) {
diff --git a/source4/lib/tdr/config.mk b/source4/lib/tdr/config.mk
index f0e24c54b4..b8473e5ba8 100644
--- a/source4/lib/tdr/config.mk
+++ b/source4/lib/tdr/config.mk
@@ -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
diff --git a/source4/libcli/config.mk b/source4/libcli/config.mk
index eb3c56cf7f..a538d607bb 100644
--- a/source4/libcli/config.mk
+++ b/source4/libcli/config.mk
@@ -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 \
diff --git a/source4/libcli/swig/libcli_nbt.i b/source4/libcli/swig/libcli_nbt.i
index 6fd85c2b8c..827230b113 100644
--- a/source4/libcli/swig/libcli_nbt.i
+++ b/source4/libcli/swig/libcli_nbt.i
@@ -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 )-: */
diff --git a/source4/libcli/swig/libcli_nbt.py b/source4/libcli/swig/libcli_nbt.py
index 938ab382f6..b49e240bc2 100644
--- a/source4/libcli/swig/libcli_nbt.py
+++ b/source4/libcli/swig/libcli_nbt.py
@@ -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)
diff --git a/source4/libcli/swig/libcli_nbt_wrap.c b/source4/libcli/swig/libcli_nbt_wrap.c
index 149e63884a..6c1b501359 100644
--- a/source4/libcli/swig/libcli_nbt_wrap.c
+++ b/source4/libcli/swig/libcli_nbt_wrap.c
@@ -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};
diff --git a/source4/libcli/swig/libcli_smb.i b/source4/libcli/swig/libcli_smb.i
index 32e043b2c6..4125bcf5a9 100644
--- a/source4/libcli/swig/libcli_smb.i
+++ b/source4/libcli/swig/libcli_smb.i
@@ -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);
diff --git a/source4/libcli/swig/libcli_smb.py b/source4/libcli/swig/libcli_smb.py
index 466a04b9eb..80c4040237 100644
--- a/source4/libcli/swig/libcli_smb.py
+++ b/source4/libcli/swig/libcli_smb.py
@@ -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
diff --git a/source4/libcli/swig/libcli_smb_wrap.c b/source4/libcli/swig/libcli_smb_wrap.c
index 313bcfeed3..8b71f2c3be 100644
--- a/source4/libcli/swig/libcli_smb_wrap.c
+++ b/source4/libcli/swig/libcli_smb_wrap.c
@@ -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,
};
diff --git a/source4/libnet/config.mk b/source4/libnet/config.mk
index aadd3b88d0..9041ff5a23 100644
--- a/source4/libnet/config.mk
+++ b/source4/libnet/config.mk
@@ -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 \
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 8774f2fd17..4d4167ba04 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -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
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index 705c86e39b..8d26ec0aad 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -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;
diff --git a/source4/librpc/ndr/ndr_compression.c b/source4/librpc/ndr/ndr_compression.c
index 310f8c4ce4..86a5a2560e 100644
--- a/source4/librpc/ndr/ndr_compression.c
+++ b/source4/librpc/ndr/ndr_compression.c
@@ -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;
}
diff --git a/source4/nsswitch/config.mk b/source4/nsswitch/config.mk
index 8982024516..621939256c 100644
--- a/source4/nsswitch/config.mk
+++ b/source4/nsswitch/config.mk
@@ -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
diff --git a/source4/ntptr/config.mk b/source4/ntptr/config.mk
index 38a582291f..4c1f46ff17 100644
--- a/source4/ntptr/config.mk
+++ b/source4/ntptr/config.mk
@@ -14,7 +14,7 @@ PRIVATE_DEPENDENCIES = \
################################################
# Start SUBSYSTEM ntptr
-[LIBRARY::ntptr]
+[SUBSYSTEM::ntptr]
PRIVATE_PROTO_HEADER = ntptr_proto.h
OBJ_FILES = \
ntptr_base.o \
diff --git a/source4/ntvfs/config.mk b/source4/ntvfs/config.mk
index ae8d5d9b4a..017614b7be 100644
--- a/source4/ntvfs/config.mk
+++ b/source4/ntvfs/config.mk
@@ -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 \
diff --git a/source4/param/config.mk b/source4/param/config.mk
index b28f6639c0..f7d5d03d43 100644
--- a/source4/param/config.mk
+++ b/source4/param/config.mk
@@ -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
diff --git a/source4/pidl/lib/Parse/Pidl.pm b/source4/pidl/lib/Parse/Pidl.pm
index 0c6e0e5727..c2c9463d03 100644
--- a/source4/pidl/lib/Parse/Pidl.pm
+++ b/source4/pidl/lib/Parse/Pidl.pm
@@ -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;
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
index 47312bc83d..ca9e7d15db 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
@@ -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';
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4.pm b/source4/pidl/lib/Parse/Pidl/Samba4.pm
index 5848543a60..d42e01cdb0 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4.pm
@@ -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);
diff --git a/source4/pidl/pidl b/source4/pidl/pidl
index 4dfd57dc20..220d62cd71 100755
--- a/source4/pidl/pidl
+++ b/source4/pidl/pidl
@@ -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
index 0000000000..d1e2bc9545
--- /dev/null
+++ b/source4/pidl/tests/samba3-srv.pl
@@ -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));
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 03f3601257..760d774f2e 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -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;
}
diff --git a/source4/scripting/ejs/config.mk b/source4/scripting/ejs/config.mk
index 8b680ba973..656ecdae16 100644
--- a/source4/scripting/ejs/config.mk
+++ b/source4/scripting/ejs/config.mk
@@ -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
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index 266bac1a75..0cca49dec9 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -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;
diff --git a/source4/scripting/python/config.mk b/source4/scripting/python/config.mk
index f00b477919..450da0e90a 100644
--- a/source4/scripting/python/config.mk
+++ b/source4/scripting/python/config.mk
@@ -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/*
diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c
index b2dd50b507..fff981e941 100644
--- a/source4/scripting/python/modules.c
+++ b/source4/scripting/python/modules.c
@@ -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 };
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 1607cb343b..d59cea121e 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -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.
diff --git a/source4/selftest/README b/source4/selftest/README
index a0afda3d19..3250f32ec7 100644
--- a/source4/selftest/README
+++ b/source4/selftest/README
@@ -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.
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl
index 96409558b1..004332a1fc 100755
--- a/source4/selftest/selftest.pl
+++ b/source4/selftest/selftest.pl
@@ -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);
}
diff --git a/source4/selftest/env/Samba3.pm b/source4/selftest/target/Samba3.pm
index b0c4eb22bd..b0c4eb22bd 100644
--- a/source4/selftest/env/Samba3.pm
+++ b/source4/selftest/target/Samba3.pm
diff --git a/source4/selftest/env/Samba4.pm b/source4/selftest/target/Samba4.pm
index 87a86ef06f..87a86ef06f 100644
--- a/source4/selftest/env/Samba4.pm
+++ b/source4/selftest/target/Samba4.pm
diff --git a/source4/selftest/env/Windows.pm b/source4/selftest/target/Windows.pm
index d0c90d7f7b..d0c90d7f7b 100644
--- a/source4/selftest/env/Windows.pm
+++ b/source4/selftest/target/Windows.pm
diff --git a/source4/setup/display_specifiers.ldif b/source4/setup/display_specifiers.ldif
index b76955a0cb..7d6633244d 100644
--- a/source4/setup/display_specifiers.ldif
+++ b/source4/setup/display_specifiers.ldif
@@ -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}
diff --git a/source4/setup/provision b/source4/setup/provision
index ce1e8a6b4f..8b24c51040 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -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);
diff --git a/source4/setup/provision-backend b/source4/setup/provision-backend
index ba9e67f229..abd1b9a875 100755
--- a/source4/setup/provision-backend
+++ b/source4/setup/provision-backend
@@ -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) {
diff --git a/source4/setup/provision.ldif b/source4/setup/provision.ldif
index c6b07c5751..3fb9361d0b 100644
--- a/source4/setup/provision.ldif
+++ b/source4/setup/provision.ldif
@@ -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
diff --git a/source4/setup/provision.py b/source4/setup/provision.py
index e166d5f3dd..88015ce0a3 100755
--- a/source4/setup/provision.py
+++ b/source4/setup/provision.py
@@ -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:
diff --git a/source4/setup/provision_basedn.ldif b/source4/setup/provision_basedn.ldif
index 234c1f9e8f..3c7537f013 100644
--- a/source4/setup/provision_basedn.ldif
+++ b/source4/setup/provision_basedn.ldif
@@ -5,7 +5,6 @@ dn: ${DOMAINDN}
objectClass: top
objectClass: domain
objectClass: domainDNS
-${EXTENSIBLEOBJECT}
${ACI}
dc: ${RDN_DC}
diff --git a/source4/setup/provision_computers_modify.ldif b/source4/setup/provision_computers_modify.ldif
index b7502e5107..3bb4074d42 100644
--- a/source4/setup/provision_computers_modify.ldif
+++ b/source4/setup/provision_computers_modify.ldif
@@ -3,9 +3,6 @@ changetype: modify
replace: description
description: Default container for upgraded computer accounts
-
-replace: instanceType
-instanceType: 4
--
replace: showInAdvancedViewOnly
showInAdvancedViewOnly: FALSE
-
diff --git a/source4/setup/provision_configuration.ldif b/source4/setup/provision_configuration.ldif
index 050f110d9a..0fe90b0739 100644
--- a/source4/setup/provision_configuration.ldif
+++ b/source4/setup/provision_configuration.ldif
@@ -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
diff --git a/source4/setup/provision_configuration_basedn.ldif b/source4/setup/provision_configuration_basedn.ldif
index df1e1b19ba..575f8faa0a 100644
--- a/source4/setup/provision_configuration_basedn.ldif
+++ b/source4/setup/provision_configuration_basedn.ldif
@@ -4,6 +4,5 @@
dn: ${CONFIGDN}
objectClass: top
objectClass: configuration
-${EXTENSIBLEOBJECT}
${ACI}
cn: Configuration
diff --git a/source4/setup/provision_configuration_basedn_modify.ldif b/source4/setup/provision_configuration_basedn_modify.ldif
index 46ba4e9649..9b87e1cead 100644
--- a/source4/setup/provision_configuration_basedn_modify.ldif
+++ b/source4/setup/provision_configuration_basedn_modify.ldif
@@ -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}
diff --git a/source4/setup/provision_schema_basedn.ldif b/source4/setup/provision_schema_basedn.ldif
index 7b4f599072..fbfd4c09d6 100644
--- a/source4/setup/provision_schema_basedn.ldif
+++ b/source4/setup/provision_schema_basedn.ldif
@@ -4,6 +4,5 @@
dn: ${SCHEMADN}
objectClass: top
objectClass: dMD
-${EXTENSIBLEOBJECT}
${ACI}
cn: Schema
diff --git a/source4/setup/provision_schema_basedn_modify.ldif b/source4/setup/provision_schema_basedn_modify.ldif
index 92c5cf1ace..4e690376d7 100644
--- a/source4/setup/provision_schema_basedn_modify.ldif
+++ b/source4/setup/provision_schema_basedn_modify.ldif
@@ -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}
-
diff --git a/source4/setup/provision_self_join.ldif b/source4/setup/provision_self_join.ldif
index 06230e8d00..58669660f4 100644
--- a/source4/setup/provision_self_join.ldif
+++ b/source4/setup/provision_self_join.ldif
@@ -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}
diff --git a/source4/setup/provision_templates.ldif b/source4/setup/provision_templates.ldif
index 8797efaf98..fafedc6966 100644
--- a/source4/setup/provision_templates.ldif
+++ b/source4/setup/provision_templates.ldif
@@ -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
diff --git a/source4/setup/provision_users.ldif b/source4/setup/provision_users.ldif
index 7c1a438d8e..05fde15974 100644
--- a/source4/setup/provision_users.ldif
+++ b/source4/setup/provision_users.ldif
@@ -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
diff --git a/source4/setup/provision_users_modify.ldif b/source4/setup/provision_users_modify.ldif
index 42dff07080..06954c44f0 100644
--- a/source4/setup/provision_users_modify.ldif
+++ b/source4/setup/provision_users_modify.ldif
@@ -3,9 +3,6 @@ changetype: modify
replace: description
description: Default container for upgraded user accounts
-
-replace: instanceType
-instanceType: 4
--
replace: showInAdvancedViewOnly
showInAdvancedViewOnly: FALSE
-
diff --git a/source4/setup/slapd.conf b/source4/setup/slapd.conf
index e4e86eece9..83f4da3359 100644
--- a/source4/setup/slapd.conf
+++ b/source4/setup/slapd.conf
@@ -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}
diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk
index ea0df63f32..c4d1070992 100644
--- a/source4/smbd/config.mk
+++ b/source4/smbd/config.mk
@@ -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
diff --git a/source4/smbd/process_model.mk b/source4/smbd/process_model.mk
index 4d927a640c..d6b7698e74 100644
--- a/source4/smbd/process_model.mk
+++ b/source4/smbd/process_model.mk
@@ -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
-################################################
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index bbc0bcae82..ca6b488af5 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -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
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 3b96140fb2..b08cd05bdb 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -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;
}