summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-09-10 14:09:07 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-09-10 14:09:07 +1000
commited26195d0eda6dd1ca14508cfd31a48dde79d44f (patch)
tree463337c801d8a3510d5d36f98b46bf3ae114e5d2
parent2209787812fd9224d104f332e25d8ce64ef9ee95 (diff)
parent6ad94d10f79f206fcdeb23cf71595e38c7a77855 (diff)
downloadsamba-ed26195d0eda6dd1ca14508cfd31a48dde79d44f.tar.gz
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
-rw-r--r--source/Makefile9
-rw-r--r--source/build/make/templates.mk6
-rw-r--r--source/lib/registry/tools/common.c3
-rw-r--r--source/lib/registry/tools/regpatch.c8
-rw-r--r--source/lib/registry/tools/regshell.c18
-rw-r--r--source/lib/registry/tools/regtree.c2
-rw-r--r--source/librpc/idl/drsblobs.idl76
-rwxr-xr-xsource/script/installtorture.sh18
-rwxr-xr-xsource/script/uninstalltorture.sh15
-rwxr-xr-xsource/scripting/bin/subunitrun8
-rw-r--r--source/scripting/python/config.m46
-rw-r--r--source/torture/unix/whoami.c4
12 files changed, 107 insertions, 66 deletions
diff --git a/source/Makefile b/source/Makefile
index d91d08a252b..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,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/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
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 4e859df3f60..98f7f02c38c 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 <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/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 {
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
);
}
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
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()
diff --git a/source/scripting/python/config.m4 b/source/scripting/python/config.m4
index b599aaefb03..af13b6ae694 100644
--- a/source/scripting/python/config.m4
+++ b/source/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/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"