Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
authorAndrew Bartlett <abartlet@samba.org>
Wed, 10 Sep 2008 04:09:07 +0000 (14:09 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Sep 2008 04:09:07 +0000 (14:09 +1000)
(This used to be commit ed26195d0eda6dd1ca14508cfd31a48dde79d44f)

12 files changed:
source4/Makefile
source4/build/make/templates.mk
source4/lib/registry/tools/common.c
source4/lib/registry/tools/regpatch.c
source4/lib/registry/tools/regshell.c
source4/lib/registry/tools/regtree.c
source4/librpc/idl/drsblobs.idl
source4/script/installtorture.sh [deleted file]
source4/script/uninstalltorture.sh [deleted file]
source4/scripting/bin/subunitrun
source4/scripting/python/config.m4
source4/torture/unix/whoami.c

index d91d08a252b04eb40e4d2ad91827a8ec326d4bd6..66b092192e45584bbe85577876114c2b17c31ba7 100644 (file)
@@ -210,11 +210,7 @@ installdirs::
                $(DESTDIR)$(PKGCONFIGDIR) \
                $(DESTDIR)$(sysconfdir)
 
-installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
-       @$(SHELL) $(srcdir)/script/installtorture.sh \
-               $(INSTALLPERMS) \
-               $(DESTDIR)$(TORTUREDIR) \
-               $(TORTURE_PROGS)
+installbin:: installdirs
 
 installplugins::
 
@@ -262,9 +258,6 @@ $(DESTDIR)$(sbindir)/%: bin/% installdirs
        @chmod $(INSTALLPERMS) $@
 
 uninstallbin::
-       @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
-       @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
-       @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
 
 uninstalllib::
        @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
index c0ee017a65a535947ca9c5a6d4da60aca0349b35..f7eab6ce015da54cbca1727732be8d795ac7268a 100644 (file)
@@ -125,11 +125,11 @@ abspath = $(shell cd $(dir $(1)); pwd)/$(notdir $(1))
 # Install a binary
 # Arguments: path to binary to install
 define binary_install_template
-installbin:: $$(DESTDIR)$$(bindir)/$(notdir $(1))
+installbin:: $$(DESTDIR)$$(bindir)/$(notdir $(1)) installdirs
 
 uninstallbin::
        @echo "Removing $(notdir $(1))"
-       @rm -f $$(DESTDIR)$$(bindir)/$(1)
+       @rm -f $$(DESTDIR)$$(bindir)/$(notdir $(1))
 endef
 
 define sbinary_install_template
@@ -137,5 +137,5 @@ installsbin:: $$(DESTDIR)$$(sbindir)/$(notdir $(1)) installdirs
 
 uninstallsbin::
        @echo "Removing $(notdir $(1))"
-       @rm -f $$(DESTDIR)$$(sbindir)/$(1)
+       @rm -f $$(DESTDIR)$$(sbindir)/$(notdir $(1))
 endef
index 3ea780de60ae22f15702de95d7e9838601461eb6..f770f6a3cafd06a2244b5e91a910a246cc2778bb 100644 (file)
 #include "lib/registry/tools/common.h"
 
 struct registry_context *reg_common_open_remote(const char *remote,
+                                               struct event_context *ev_ctx,
                                                struct loadparm_context *lp_ctx,
                                                struct cli_credentials *creds)
 {
        struct registry_context *h = NULL;
        WERROR error;
 
-       error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, NULL);
+       error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, ev_ctx);
 
        if (!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to open remote registry at %s:%s \n",
index 1170fbadb432e69d491ff3e753b4eab67edab359..add59a5e64fd0fbb4ef22b383e6bf29ea62ebadf 100644 (file)
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
        struct registry_context *h;
        const char *file = NULL;
        const char *remote = NULL;
-       struct event_context *ev;
+       struct event_context *ev_ctx;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
                {"remote", 'R', POPT_ARG_STRING, &remote, 0, "connect to specified remote server", NULL},
@@ -49,12 +49,12 @@ int main(int argc, char **argv)
        while((opt = poptGetNextOpt(pc)) != -1) {
        }
 
-       ev = s4_event_context_init(NULL);
+       ev_ctx = s4_event_context_init(NULL);
 
        if (remote) {
-               h = reg_common_open_remote (remote, cmdline_lp_ctx, cmdline_credentials);
+               h = reg_common_open_remote (remote, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
        } else {
-               h = reg_common_open_local (cmdline_credentials, ev, cmdline_lp_ctx);
+               h = reg_common_open_local (cmdline_credentials, ev_ctx, cmdline_lp_ctx);
        }
 
        if (h == NULL)
index 4e859df3f60c7f8effbe02700518983ed15f4dab..98f7f02c38cec5e3340ddc5bfcd956640c6df2d7 100644 (file)
@@ -162,9 +162,7 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv)
        struct registry_key *new = NULL;
        WERROR error;
 
-       if(argc < 2) {
-               new = ctx->current;
-       } else {
+       if(argc == 2) {
                error = reg_open_key(ctx->registry, ctx->current, argv[1],
                                     &new);
                if(!W_ERROR_IS_OK(error)) {
@@ -172,11 +170,11 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv)
                                win_errstr(error)));
                        return error;
                }
-       }
 
-       ctx->path = talloc_asprintf(ctx, "%s\\%s", ctx->path, argv[1]);
-       printf("Current path is: %s\n", ctx->path);
-       ctx->current = new;
+               ctx->path = talloc_asprintf(ctx, "%s\\%s", ctx->path, argv[1]);
+               ctx->current = new;
+       }
+       printf("New path is: %s\n", ctx->path);
 
        return WERR_OK;
 }
@@ -188,7 +186,7 @@ static WERROR cmd_print(struct regshell_context *ctx, int argc, char **argv)
        WERROR error;
 
        if (argc != 2) {
-               fprintf(stderr, "Usage: print <valuename>");
+               fprintf(stderr, "Usage: print <valuename>\n");
                return WERR_INVALID_PARAM;
        }
 
@@ -520,8 +518,8 @@ int main(int argc, char **argv)
        ev_ctx = s4_event_context_init(ctx);
 
        if (remote != NULL) {
-               ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx, 
-                                                      cmdline_credentials);
+               ctx->registry = reg_common_open_remote(remote, ev_ctx,
+                                        cmdline_lp_ctx, cmdline_credentials);
        } else if (file != NULL) {
                ctx->current = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
                if (ctx->current == NULL)
index daca6957a1aa47ed56152776cabff4e0250c866a..19e4a010b4319a3ed5a0655d53633c0b50e9c393 100644 (file)
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
        ev_ctx = s4_event_context_init(NULL);
 
        if (remote != NULL) {
-               h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials);
+               h = reg_common_open_remote(remote, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
        } else if (file != NULL) {
                start_key = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
        } else {
index 196423c7dd7f702034b435128d2764c26ae2728d..6b1f649ff53ad311257c95e75a5fc26e74ea9cc5 100644 (file)
@@ -432,11 +432,79 @@ interface drsblobs {
                DATA_BLOB data;
        } DsCompressedChunk;
 
+       typedef struct {
+               uint16 __size;
+               [size_is(__size),charset(DOS)] uint8 *string;
+       } ExtendedErrorAString;
+
+       typedef struct {
+               uint16 __size;
+               [size_is(__size),charset(UTF16)] uint16 *string;
+       } ExtendedErrorUString;
+
+       typedef struct {
+               uint16 length;
+               [size_is(length)] uint8 *data;
+       } ExtendedErrorBlob;
+
+       typedef enum {
+               EXTENDED_ERROR_COMPUTER_NAME_PRESENT    = 1,
+               EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT= 2
+       } ExtendedErrorComputerNamePresent;
+
+       typedef [switch_type(ExtendedErrorComputerNamePresent)] union {
+       [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT)] ExtendedErrorUString name;
+       [case(EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT)];
+       } ExtendedErrorComputerNameU;
+
+       typedef struct {
+               ExtendedErrorComputerNamePresent present;
+               [switch_is(present)] ExtendedErrorComputerNameU n;
+       } ExtendedErrorComputerName;
+
+       typedef enum {
+               EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING          = 1,
+               EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING        = 2,
+               EXTENDED_ERROR_PARAM_TYPE_UINT32                = 3,
+               EXTENDED_ERROR_PARAM_TYPE_UINT16                = 4,
+               EXTENDED_ERROR_PARAM_TYPE_UINT64                = 5,
+               EXTENDED_ERROR_PARAM_TYPE_NONE                  = 6,
+               EXTENDED_ERROR_PARAM_TYPE_BLOB                  = 7
+       } ExtendedErrorParamType;
+
+       typedef [switch_type(ExtendedErrorParamType)] union {
+       [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING)] ExtendedErrorAString a_string;
+       [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING)] ExtendedErrorUString u_string;
+       [case(EXTENDED_ERROR_PARAM_TYPE_UINT32)] uint32 uint32;
+       [case(EXTENDED_ERROR_PARAM_TYPE_UINT16)] uint16 uint16;
+       [case(EXTENDED_ERROR_PARAM_TYPE_UINT64)] hyper uint64;
+       [case(EXTENDED_ERROR_PARAM_TYPE_NONE)];
+       [case(EXTENDED_ERROR_PARAM_TYPE_BLOB)] ExtendedErrorBlob blob;
+       } ExtendedErrorParamU;
+
+       typedef struct {
+               ExtendedErrorParamType type;
+               [switch_is(type)] ExtendedErrorParamU p;
+       } ExtendedErrorParam;
+
        typedef [public] struct {
-               DsCompressedChunk chunks[5];
-       } DsCompressedBlob;
+               ExtendedErrorInfo *next;
+               ExtendedErrorComputerName computer_name;
+               hyper pid;
+               NTTIME time;
+               uint32 generating_component;
+               WERROR status;
+               uint16 detection_location;
+               uint16 flags;
+               uint16 num_params;
+               [size_is(num_params)] ExtendedErrorParam params[];
+       } ExtendedErrorInfo;
+
+       typedef struct {
+               [unique] ExtendedErrorInfo *info;
+       } ExtendedErrorInfoPtr;
 
-       void decode_DsCompressed(
-               [in] DsCompressedBlob blob
+       void decode_ExtendedErrorInfo (
+               [in,subcontext(0xFFFFFC01)] ExtendedErrorInfoPtr ptr
                );
 }
diff --git a/source4/script/installtorture.sh b/source4/script/installtorture.sh
deleted file mode 100755 (executable)
index db7ad91..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-INSTALLPERMS=$1
-TORTUREDIR=$2
-shift
-shift
-
-for p in $*; do
- p2=`dirname $p`
- base=`basename $p`
- DESTDIR=$TORTUREDIR/`basename $p2`
- mkdir -p $DESTDIR
- echo Installing $p as $DESTDIR/$base
- cp -f $p $DESTDIR/
- chmod $INSTALLPERMS $DESTDIR/$base
-done
-
-exit 0
diff --git a/source4/script/uninstalltorture.sh b/source4/script/uninstalltorture.sh
deleted file mode 100755 (executable)
index 0c6e4ec..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-TORTUREDIR=$1
-shift
-shift
-
-for p in $*; do
- p2=`dirname $p`
- base=`basename $p`
- DESTDIR=$TORTUREDIR/`basename $p2`
- echo Removing $DESTDIR/$base
- rm -f $p $DESTDIR/
-done
-
-exit 0
index 6f1086ad376c653087cb703a78dd61dd2e351c35..ee2d1e11da6a109db6012ce1d8b8ac838ff5271b 100755 (executable)
@@ -36,6 +36,8 @@ parser.add_option_group(credopts)
 sambaopts = options.SambaOptions(parser)
 parser.add_option_group(sambaopts)
 parser.add_option_group(options.VersionOptions(parser))
+parser.add_option("--coverage", metavar="CACHE", type=str, 
+                         help="Store coverage data in CACHE")
 
 args = parser.parse_args()[1]
 
@@ -45,4 +47,10 @@ samba.tests.cmdline_credentials = credopts.get_credentials(samba.tests.cmdline_l
 param.cvar.default_config = samba.tests.cmdline_loadparm
 
 runner = SubunitTestRunner()
+if opts.coverage is not None:
+       import coverage
+       coverage.use_cache(True, opts.coverage)
+       coverage.start()
 program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner)
+if opts.coverage:
+       coverage.stop()
index b599aaefb03ccec9dc5ec2c659b0d014b0fd2c6e..af13b6ae6947f7fae103c477316ce54c6157b011 100644 (file)
@@ -50,6 +50,12 @@ if test -z "$PYTHON_CONFIG"; then
 else
        TRY_LINK_PYTHON([`$PYTHON_CONFIG --ldflags`], [`$PYTHON_CONFIG --includes`])
        TRY_LINK_PYTHON([`$PYTHON_CONFIG --ldflags`], [`$PYTHON_CONFIG --cflags`])
+       if x$working_python = xno; then
+               # It seems the library path isn't included on some systems
+               base=`$PYTHON_CONFIG --prefix`
+               TRY_LINK_PYTHON([`echo -n -L${base}/lib " "; $PYTHON_CONFIG --ldflags`], [`$PYTHON_CONFIG --includes`])
+               TRY_LINK_PYTHON([`echo -n -L${base}/lib " "; $PYTHON_CONFIG --ldflags`], [`$PYTHON_CONFIG --cflags`])
+       fi
 fi
 
 if test x$PYTHON != x
index d4f19bb57a1ced02656c7a0283ee0294fc49f591..39d0a12ab1f640cfc9ab5d7919c9d722bc3789b0 100644 (file)
 */
 
 #include "includes.h"
-#include "torture/torture.h"
-#include "torture/basic/proto.h"
 #include "libcli/libcli.h"
 #include "libcli/raw/interfaces.h"
 #include "libcli/raw/raw_proto.h"
+#include "torture/torture.h"
+#include "torture/basic/proto.h"
 #include "lib/cmdline/popt_common.h"
 #include "auth/credentials/credentials.h"
 #include "param/param.h"