From 3edbbb12bda8e19a9f5a72849bc79e0fad7976f8 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 --- source/librpc/idl/drsblobs.idl | 76 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/source/librpc/idl/drsblobs.idl b/source/librpc/idl/drsblobs.idl index 196423c7dd7..6b1f649ff53 100644 --- a/source/librpc/idl/drsblobs.idl +++ b/source/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 v1.2.1 From ec5d8ddadb76ff0d2cb72872e4d145a7527f0ec6 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 --- source/torture/unix/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/torture/unix/whoami.c b/source/torture/unix/whoami.c index d4f19bb57a1..39d0a12ab1f 100644 --- a/source/torture/unix/whoami.c +++ b/source/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 v1.2.1 From 43c0fdfff02021caef2d8f73d6bfdc4b051a65ef 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. --- source/scripting/bin/subunitrun | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/scripting/bin/subunitrun b/source/scripting/bin/subunitrun index 6f1086ad376..ee2d1e11da6 100755 --- a/source/scripting/bin/subunitrun +++ b/source/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 v1.2.1 From 69956a5597b0339b7c0ee3f394d649421f037f03 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 --- source/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/Makefile b/source/Makefile index d91d08a252b..f96a07a1133 100644 --- a/source/Makefile +++ b/source/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 v1.2.1 From d1052dc42ef591208cfbf7059b28a078f6d4f0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Dieter=20Walln=C3=B6fer?= 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. --- source/lib/registry/tools/regshell.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/source/lib/registry/tools/regshell.c b/source/lib/registry/tools/regshell.c index 4e859df3f60..ee8f366e6e2 100644 --- a/source/lib/registry/tools/regshell.c +++ b/source/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 v1.2.1 From 42ab865fc937a625d1eece45abe96bf354ddff8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Dieter=20Walln=C3=B6fer?= 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. --- source/lib/registry/tools/common.c | 3 ++- source/lib/registry/tools/regpatch.c | 8 ++++---- source/lib/registry/tools/regshell.c | 4 ++-- source/lib/registry/tools/regtree.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/lib/registry/tools/common.c b/source/lib/registry/tools/common.c index 3ea780de60a..f770f6a3caf 100644 --- a/source/lib/registry/tools/common.c +++ b/source/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/source/lib/registry/tools/regpatch.c b/source/lib/registry/tools/regpatch.c index 1170fbadb43..add59a5e64f 100644 --- a/source/lib/registry/tools/regpatch.c +++ b/source/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/source/lib/registry/tools/regshell.c b/source/lib/registry/tools/regshell.c index ee8f366e6e2..98f7f02c38c 100644 --- a/source/lib/registry/tools/regshell.c +++ b/source/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/source/lib/registry/tools/regtree.c b/source/lib/registry/tools/regtree.c index daca6957a1a..19e4a010b43 100644 --- a/source/lib/registry/tools/regtree.c +++ b/source/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 v1.2.1 From 677179234ecaa6980dedc2bb6f77c525b56b532f 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. --- source/Makefile | 7 +------ source/script/installtorture.sh | 18 ------------------ source/script/uninstalltorture.sh | 15 --------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100755 source/script/installtorture.sh delete mode 100755 source/script/uninstalltorture.sh diff --git a/source/Makefile b/source/Makefile index f96a07a1133..66b092192e4 100644 --- a/source/Makefile +++ b/source/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/source/script/installtorture.sh b/source/script/installtorture.sh deleted file mode 100755 index db7ad9110c1..00000000000 --- a/source/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/source/script/uninstalltorture.sh b/source/script/uninstalltorture.sh deleted file mode 100755 index 0c6e4ec9917..00000000000 --- a/source/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 v1.2.1 From 59b62280d27a9e0a72241e4b60022be07e4cbce2 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 --- source/scripting/python/config.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/scripting/python/config.m4 b/source/scripting/python/config.m4 index b599aaefb03..5607accb7c2 100644 --- a/source/scripting/python/config.m4 +++ b/source/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 v1.2.1 From 62d76356c10b4223236425c4db32c2fc5105d155 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. --- source/scripting/python/config.m4 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/scripting/python/config.m4 b/source/scripting/python/config.m4 index 5607accb7c2..af13b6ae694 100644 --- a/source/scripting/python/config.m4 +++ b/source/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 v1.2.1 From 6ad94d10f79f206fcdeb23cf71595e38c7a77855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Wed, 10 Sep 2008 00:09:28 +0200 Subject: Fix uninstalling of binaries. --- source/build/make/templates.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/build/make/templates.mk b/source/build/make/templates.mk index c0ee017a65a..f7eab6ce015 100644 --- a/source/build/make/templates.mk +++ b/source/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 v1.2.1