diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/Makefile | 9 | ||||
-rw-r--r-- | source4/build/make/templates.mk | 6 | ||||
-rw-r--r-- | source4/lib/registry/tools/common.c | 3 | ||||
-rw-r--r-- | source4/lib/registry/tools/regpatch.c | 8 | ||||
-rw-r--r-- | source4/lib/registry/tools/regshell.c | 18 | ||||
-rw-r--r-- | source4/lib/registry/tools/regtree.c | 2 | ||||
-rw-r--r-- | source4/librpc/idl/drsblobs.idl | 76 | ||||
-rwxr-xr-x | source4/script/installtorture.sh | 18 | ||||
-rwxr-xr-x | source4/script/uninstalltorture.sh | 15 | ||||
-rwxr-xr-x | source4/scripting/bin/subunitrun | 8 | ||||
-rw-r--r-- | source4/scripting/python/config.m4 | 6 | ||||
-rw-r--r-- | source4/torture/unix/whoami.c | 4 |
12 files changed, 107 insertions, 66 deletions
diff --git a/source4/Makefile b/source4/Makefile index d91d08a252..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,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) 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 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 4e859df3f6..98f7f02c38 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 <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) 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 { 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 ); } 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 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() diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4 index b599aaefb0..af13b6ae69 100644 --- a/source4/scripting/python/config.m4 +++ b/source4/scripting/python/config.m4 @@ -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 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" |