From 5b70daad7a91af311fbbc5abbaf2c49500e5c628 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 9 Sep 2008 11:27:03 +0200 Subject: drsblobs.idl: add parser for ExtendedErrorInfo see [MS-EERR]: ExtendedError Remote Data Structure metze (This used to be commit 3edbbb12bda8e19a9f5a72849bc79e0fad7976f8) --- source4/librpc/idl/drsblobs.idl | 76 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/librpc/idl/drsblobs.idl b/source4/librpc/idl/drsblobs.idl index 196423c7dd..6b1f649ff5 100644 --- a/source4/librpc/idl/drsblobs.idl +++ b/source4/librpc/idl/drsblobs.idl @@ -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 ); } -- cgit From d6130413965b53baa07b7b93c9b0d5199cff4437 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 9 Sep 2008 13:01:34 +0200 Subject: UNIX-WHOAMI: fix compiler warnings metze (This used to be commit ec5d8ddadb76ff0d2cb72872e4d145a7527f0ec6) --- source4/torture/unix/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index d4f19bb57a..39d0a12ab1 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -18,11 +18,11 @@ */ #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" -- cgit From faf83916ee62638e3eff60e68b4b7b36be2ddc05 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 9 Sep 2008 15:55:10 +0200 Subject: Add option for generating coverage data from python tests. (This used to be commit 43c0fdfff02021caef2d8f73d6bfdc4b051a65ef) --- source4/scripting/bin/subunitrun | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4') diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun index 6f1086ad37..ee2d1e11da 100755 --- a/source4/scripting/bin/subunitrun +++ b/source4/scripting/bin/subunitrun @@ -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() -- cgit From 37a63fb039a48e5283cdd7504b9385068508c9bd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 9 Sep 2008 16:01:37 +0200 Subject: Remove calls to unused uninstallbin.sh (This used to be commit 69956a5597b0339b7c0ee3f394d649421f037f03) --- source4/Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4') diff --git a/source4/Makefile b/source4/Makefile index d91d08a252..f96a07a113 100644 --- a/source4/Makefile +++ b/source4/Makefile @@ -262,8 +262,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:: -- cgit From 8b6b8513909fb0c5acabea060921ed2034b3284d Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 9 Sep 2008 18:01:20 +0200 Subject: Two useful "regshell" improvements This patch corrects the "change key" command (Follow up isn't supported yet) and adds a newline in a error message. (This used to be commit d1052dc42ef591208cfbf7059b28a078f6d4f0bf) --- source4/lib/registry/tools/regshell.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source4') diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 4e859df3f6..ee8f366e6e 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -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 "); + fprintf(stderr, "Usage: print \n"); return WERR_INVALID_PARAM; } -- cgit From 3911808323c964c36c2639f68d59d7aca1a2a96b Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 9 Sep 2008 18:03:54 +0200 Subject: Fix up the "reg_common_open_remote" call This fixes up the "reg_common_open_remote" call because it didn't work anymore without the event context. (This used to be commit 42ab865fc937a625d1eece45abe96bf354ddff8b) --- source4/lib/registry/tools/common.c | 3 ++- source4/lib/registry/tools/regpatch.c | 8 ++++---- source4/lib/registry/tools/regshell.c | 4 ++-- source4/lib/registry/tools/regtree.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'source4') diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c index 3ea780de60..f770f6a3ca 100644 --- a/source4/lib/registry/tools/common.c +++ b/source4/lib/registry/tools/common.c @@ -24,13 +24,14 @@ #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", diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 1170fbadb4..add59a5e64 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -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) diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index ee8f366e6e..98f7f02c38 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -518,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) diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index daca6957a1..19e4a010b4 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -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 { -- cgit From d7dbb530b57e4bce56a02df93474a3b893190b2d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 9 Sep 2008 21:56:57 +0200 Subject: Remove unused scripts for installing binaries. (This used to be commit 677179234ecaa6980dedc2bb6f77c525b56b532f) --- source4/Makefile | 7 +------ source4/script/installtorture.sh | 18 ------------------ source4/script/uninstalltorture.sh | 15 --------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100755 source4/script/installtorture.sh delete mode 100755 source4/script/uninstalltorture.sh (limited to 'source4') diff --git a/source4/Makefile b/source4/Makefile index f96a07a113..66b092192e 100644 --- a/source4/Makefile +++ b/source4/Makefile @@ -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,7 +258,6 @@ $(DESTDIR)$(sbindir)/%: bin/% installdirs @chmod $(INSTALLPERMS) $@ uninstallbin:: - @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS) uninstalllib:: @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS) diff --git a/source4/script/installtorture.sh b/source4/script/installtorture.sh deleted file mode 100755 index db7ad9110c..0000000000 --- a/source4/script/installtorture.sh +++ /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 index 0c6e4ec991..0000000000 --- a/source4/script/uninstalltorture.sh +++ /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 -- cgit From 1d8973a82eda362d19dbfe79529d10baf6f97d9d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 9 Sep 2008 23:35:17 +0200 Subject: Attempt to correctly find python on host sunx (This used to be commit 59b62280d27a9e0a72241e4b60022be07e4cbce2) --- source4/scripting/python/config.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4 index b599aaefb0..5607accb7c 100644 --- a/source4/scripting/python/config.m4 +++ b/source4/scripting/python/config.m4 @@ -48,8 +48,9 @@ fi if test -z "$PYTHON_CONFIG"; then AC_MSG_WARN([No python-config found]) else - TRY_LINK_PYTHON([`$PYTHON_CONFIG --ldflags`], [`$PYTHON_CONFIG --includes`]) - TRY_LINK_PYTHON([`$PYTHON_CONFIG --ldflags`], [`$PYTHON_CONFIG --cflags`]) + 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 if test x$PYTHON != x -- cgit From 4f266dff13d2937b1800954a9ddb536df4d14a5f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 9 Sep 2008 23:49:07 +0200 Subject: Only try with -LPYTHONDIR/lib when python-config output didn't work. (This used to be commit 62d76356c10b4223236425c4db32c2fc5105d155) --- source4/scripting/python/config.m4 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4 index 5607accb7c..af13b6ae69 100644 --- a/source4/scripting/python/config.m4 +++ b/source4/scripting/python/config.m4 @@ -48,9 +48,14 @@ fi if test -z "$PYTHON_CONFIG"; then AC_MSG_WARN([No python-config found]) else - 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`]) + 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 -- cgit From ce288824bb4a095c5020449a79eb83fad81e8480 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Wed, 10 Sep 2008 00:09:28 +0200 Subject: Fix uninstalling of binaries. (This used to be commit 6ad94d10f79f206fcdeb23cf71595e38c7a77855) --- source4/build/make/templates.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/build/make/templates.mk b/source4/build/make/templates.mk index c0ee017a65..f7eab6ce01 100644 --- a/source4/build/make/templates.mk +++ b/source4/build/make/templates.mk @@ -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 -- cgit