diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | source4/build/smb_build/header.pm | 1 | ||||
-rw-r--r-- | source4/build/smb_build/main.pl | 16 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 68 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 7 | ||||
-rw-r--r-- | source4/configure.ac | 21 | ||||
-rw-r--r-- | source4/lib/talloc/Makefile.in | 4 | ||||
-rw-r--r-- | source4/lib/talloc/config.mk | 4 | ||||
-rw-r--r-- | source4/lib/talloc/talloc.mk | 8 | ||||
-rw-r--r-- | source4/lib/tdb/Makefile.in | 6 | ||||
-rw-r--r-- | source4/lib/tdb/config.mk | 4 | ||||
-rw-r--r-- | source4/lib/tdb/tdb.mk | 14 | ||||
-rw-r--r-- | source4/librpc/idl/idl_types.h | 5 | ||||
-rw-r--r-- | source4/librpc/idl/spoolss.idl | 11 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 4 | ||||
-rwxr-xr-x | source4/pidl/tests/wireshark-conf.pl | 5 | ||||
-rw-r--r-- | source4/torture/rpc/eventlog.c | 10 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss.c | 22 |
18 files changed, 115 insertions, 96 deletions
diff --git a/.gitignore b/.gitignore index e51be509ed..a8c1f9a4cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +source/pidl/Makefile source/mkconfig.mk source/test-results source/lib/gencache/gencache.h diff --git a/source4/build/smb_build/header.pm b/source4/build/smb_build/header.pm index b52464922b..93240f1d17 100644 --- a/source4/build/smb_build/header.pm +++ b/source4/build/smb_build/header.pm @@ -82,4 +82,5 @@ sub create_smb_build_h($$) print __FILE__.": creating $file\n"; } + 1; diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl index ff540215f7..a85eab32de 100644 --- a/source4/build/smb_build/main.pl +++ b/source4/build/smb_build/main.pl @@ -63,16 +63,15 @@ foreach my $key (values %$OUTPUT) { if (defined($key->{PC_FILE})) { push(@{$mkenv->{pc_files}}, "$key->{BASEDIR}/$key->{PC_FILE}"); } - $mkenv->SharedLibrary($key) if ($key->{TYPE} eq "LIBRARY") and + $mkenv->SharedLibraryPrimitives($key) if ($key->{TYPE} eq "LIBRARY") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); if ($key->{TYPE} eq "LIBRARY" and ${$key->{OUTPUT_TYPE}}[0] eq "SHARED_LIBRARY") { $shared_libs_used = 1; } - $mkenv->SharedModule($key) if ($key->{TYPE} eq "MODULE" or + $mkenv->SharedModulePrimitives($key) if ($key->{TYPE} eq "MODULE" or $key->{TYPE} eq "PYTHON") and grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}}); $mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES}); $mkenv->Manpage($key) if defined($key->{MANPAGE}); $mkenv->Header($key) if defined($key->{PUBLIC_HEADERS}); @@ -80,6 +79,17 @@ foreach my $key (values %$OUTPUT) { defined($key->{PUBLIC_PROTO_HEADER}); } +foreach my $key (values %$OUTPUT) { + next unless defined $key->{OUTPUT_TYPE}; + + $mkenv->SharedLibrary($key) if ($key->{TYPE} eq "LIBRARY") and + grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->SharedModule($key) if ($key->{TYPE} eq "MODULE" or + $key->{TYPE} eq "PYTHON") and + grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); + $mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}}); +} + $mkenv->write("data.mk"); header::create_smb_build_h($OUTPUT, "include/build.h"); diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 50a16c543f..9c5ae9ea1d 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -45,8 +45,6 @@ sub new($$$) $self->output("################################################\n"); $self->output("\n"); - $self->_prepare_compiler_linker(); - if (!$self->{automatic_deps}) { $self->output("ALL_PREDEP = proto\n"); $self->output(".NOTPARALLEL:\n"); @@ -62,36 +60,6 @@ sub output($$) $self->{output} .= $text; } -sub _prepare_compiler_linker($) -{ - my ($self) = @_; - - my $builddir_headers = ""; - my $libdir; - my $extra_link_flags = ""; - - if ($self->{config}->{USESHARED} eq "true") { - $libdir = "\$(builddir)/bin/shared"; - $extra_link_flags = "-Wl,-rpath-link,\$(builddir)/bin/shared"; - } else { - $libdir = "\$(builddir)/bin/static"; - } - - if (!(abs_path($self->{config}->{srcdir}) eq abs_path($self->{config}->{builddir}))) { - $builddir_headers= "-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib "; - } - - $self->output(<< "__EOD__" - -CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS} - -INSTALL_LINK_FLAGS=$extra_link_flags - -INTERN_LDFLAGS = -L$libdir -__EOD__ -); -} - sub _prepare_mk_files($) { my $self = shift; @@ -166,6 +134,13 @@ sub Integrated($$) $self->_prepare_list($ctx, "LINK_FLAGS"); } +sub SharedModulePrimitives($$) +{ + my ($self,$ctx) = @_; + + #FIXME +} + sub SharedModule($$) { my ($self,$ctx) = @_; @@ -245,22 +220,27 @@ __EOD__ $self->output("\n"); } -sub SharedLibrary($$) +sub SharedLibraryPrimitives($$) { my ($self,$ctx) = @_; - my $has_static_lib = 0; - - push (@{$self->{shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION})); - push (@{$self->{installable_shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION})); - - $has_static_lib = 1 if grep(/STATIC_LIBRARY/, @{$ctx->{OUTPUT_TYPE}}); + $self->output("$ctx->{NAME}_SOVERSION = $ctx->{SO_VERSION}\n") if (defined($ctx->{SO_VERSION})); + $self->output("$ctx->{NAME}_VERSION = $ctx->{VERSION}\n") if (defined($ctx->{VERSION})); - if (not $has_static_lib) { + if (not grep(/STATIC_LIBRARY/, @{$ctx->{OUTPUT_TYPE}})) { $self->output("$ctx->{TYPE}_$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "OBJ_LIST"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); } +} + +sub SharedLibrary($$) +{ + my ($self,$ctx) = @_; + + push (@{$self->{shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION})); + push (@{$self->{installable_shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION})); + $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); # $self->_prepare_list_ex($ctx, "LINK_FLAGS", "-Wl,--whole-archive", "-Wl,--no-whole-archive"); @@ -367,13 +347,13 @@ __EOD__ if (defined($ctx->{USE_HOSTCC}) && $ctx->{USE_HOSTCC} eq "YES") { $self->output(<< "__EOD__" - \@\$(HOSTLD) \$(HOSTLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ + \@\$(HOSTLD) \$(HOSTLD_FLAGS) -L\${builddir}/bin/static -o \$\@ \$(INSTALL_LINK_FLAGS) \\ \$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) __EOD__ ); } else { $self->output(<< "__EOD__" - \@\$(BNLD) \$(BNLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ + \@\$(BNLD) \$(BNLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ \$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) __EOD__ @@ -444,9 +424,9 @@ sub ProtoHeader($$) sub write($$) { - my ($self,$file) = @_; + my ($self, $file) = @_; - $self->output("MANPAGES = ".array2oneperline($self->{manpages})."\n"); + $self->output("MANPAGES = " . array2oneperline($self->{manpages})."\n"); $self->output("BIN_PROGS = " . array2oneperline($self->{bin_progs}) . "\n"); $self->output("SBIN_PROGS = " . array2oneperline($self->{sbin_progs}) . "\n"); $self->output("BINARIES = " . array2oneperline($self->{binaries}) . "\n"); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index fbf14f7e91..855d03ade2 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -81,8 +81,8 @@ sub generate_shared_library($) $lib->{LIBRARY_DEBUGNAME} = $lib->{LIBRARY_REALNAME}; if (defined($lib->{VERSION}) and $config::config{SONAMEFLAG} ne "#") { - $lib->{LIBRARY_SONAME} = "$lib->{LIBRARY_REALNAME}.$lib->{SO_VERSION}"; - $lib->{LIBRARY_REALNAME} = "$lib->{LIBRARY_REALNAME}.$lib->{VERSION}"; + $lib->{LIBRARY_SONAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_SOVERSION)"; + $lib->{LIBRARY_REALNAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION)"; } $lib->{TARGET_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_REALNAME}"; @@ -104,10 +104,11 @@ sub generate_static_library($) if (defined($lib->{OBJ_FILES})) { $lib->{TARGET_STATIC_LIBRARY} = "bin/static/$lib->{LIBRARY_NAME}"; $lib->{STATICDIR} = 'bin/static'; + $lib->{OUTPUT_STATIC_LIBRARY} = "-l".lc($link_name); } else { $lib->{TARGET_STATIC_LIBRARY} = ""; + $lib->{OUTPUT_STATIC_LIBRARY} = ""; } - $lib->{OUTPUT_STATIC_LIBRARY} = $lib->{TARGET_STATIC_LIBRARY}; } sub generate_binary($) diff --git a/source4/configure.ac b/source4/configure.ac index f7251f597b..17925dfa99 100644 --- a/source4/configure.ac +++ b/source4/configure.ac @@ -40,7 +40,6 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.1.0, [ m4_include(lib/talloc/libtalloc.m4) SMB_INCLUDE_MK(lib/talloc/config.mk) - AC_CONFIG_FILES(lib/talloc/talloc.pc) ] ) @@ -49,7 +48,6 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0, [ m4_include(lib/tdb/libtdb.m4) SMB_INCLUDE_MK(lib/tdb/config.mk) - AC_CONFIG_FILES(lib/tdb/tdb.pc) ] ) @@ -140,6 +138,25 @@ for d in build/smb_build bin include ; do test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d) done +AC_SUBST(INTERN_LDFLAGS) +AC_SUBST(INSTALL_LINK_FLAGS) +if test $USESHARED = "true"; +then + INTERN_LDFLAGS="-L\${builddir}/bin/shared" + INSTALL_LINK_FLAGS="-Wl,-rpath-link,\${builddir}/bin/shared"; +else + INTERN_LDFLAGS="-L\${builddir}/bin/static" +fi + +builddir_headers="" + +if test "x$ac_abs_srcdir" != "x$ac_abs_builddir" +then + builddir_headers="-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib "; +fi + +CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS" + echo "configure: creating build/smb_build/config.pm" cat >build/smb_build/config.pm<<CEOF # config.pm - Autogenerate by configure. DO NOT EDIT! diff --git a/source4/lib/talloc/Makefile.in b/source4/lib/talloc/Makefile.in index f5d1cd109c..07b8fd4ff0 100644 --- a/source4/lib/talloc/Makefile.in +++ b/source4/lib/talloc/Makefile.in @@ -28,8 +28,8 @@ all:: showflags $(EXTRA_TARGETS) include $(tallocdir)/rules.mk include $(tallocdir)/talloc.mk -$(SOLIB): $(LIBOBJ) - $(SHLD) $(SHLD_FLAGS) -o $@ $(LIBOBJ) @SONAMEFLAG@$(SONAME) +$(TALLOC_SOLIB): $(LIBOBJ) + $(SHLD) $(SHLD_FLAGS) -o $@ $(LIBOBJ) @SONAMEFLAG@$(TALLOC_SONAME) check: test diff --git a/source4/lib/talloc/config.mk b/source4/lib/talloc/config.mk index 540a05d100..af1b590c98 100644 --- a/source4/lib/talloc/config.mk +++ b/source4/lib/talloc/config.mk @@ -1,8 +1,6 @@ [LIBRARY::LIBTALLOC] -VERSION = 1.2.0 -SO_VERSION = 1 +OUTPUT_TYPE = STATIC_LIBRARY OBJ_FILES = talloc.o -PC_FILE = talloc.pc MANPAGE = talloc.3 CFLAGS = -Ilib/talloc PUBLIC_HEADERS = talloc.h diff --git a/source4/lib/talloc/talloc.mk b/source4/lib/talloc/talloc.mk index 590adc74f2..d7a0e0d83e 100644 --- a/source4/lib/talloc/talloc.mk +++ b/source4/lib/talloc/talloc.mk @@ -1,9 +1,9 @@ TALLOC_OBJ = $(tallocdir)/talloc.o -SOLIB = libtalloc.$(SHLIBEXT).$(PACKAGE_VERSION) -SONAME = libtalloc.$(SHLIBEXT).1 +TALLOC_SOLIB = libtalloc.$(SHLIBEXT).$(PACKAGE_VERSION) +TALLOC_SONAME = libtalloc.$(SHLIBEXT).1 -all:: libtalloc.a $(SOLIB) testsuite +all:: libtalloc.a $(TALLOC_SOLIB) testsuite testsuite:: $(LIBOBJ) testsuite.o $(CC) $(CFLAGS) -o testsuite testsuite.o $(LIBOBJ) $(LIBS) @@ -28,7 +28,7 @@ install:: all doc:: talloc.3 talloc.3.html clean:: - rm -f *~ $(LIBOBJ) $(SOLIB) libtalloc.a testsuite testsuite.o *.gc?? talloc.3 talloc.3.html + rm -f *~ $(LIBOBJ) $(TALLOC_SOLIB) libtalloc.a testsuite testsuite.o *.gc?? talloc.3 talloc.3.html test:: testsuite ./testsuite diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in index 4a95fdb380..090bb6e2dc 100644 --- a/source4/lib/tdb/Makefile.in +++ b/source4/lib/tdb/Makefile.in @@ -37,11 +37,11 @@ default: all include $(tdbdir)/tdb.mk include $(tdbdir)/rules.mk -all:: showflags dirs $(PROGS) $(SOLIB) libtdb.a $(PYTHON_BUILD_TARGET) +all:: showflags dirs $(PROGS) $(TDB_SOLIB) libtdb.a $(PYTHON_BUILD_TARGET) install:: all -$(SOLIB): $(TDB_OBJ) - $(SHLD) $(SHLD_FLAGS) -o $@ $(TDB_OBJ) @SONAMEFLAG@$(SONAME) +$(TDB_SOLIB): $(TDB_OBJ) + $(SHLD) $(SHLD_FLAGS) -o $@ $(TDB_OBJ) @SONAMEFLAG@$(TDB_SONAME) check: test diff --git a/source4/lib/tdb/config.mk b/source4/lib/tdb/config.mk index 820c55e363..89d6af9043 100644 --- a/source4/lib/tdb/config.mk +++ b/source4/lib/tdb/config.mk @@ -1,9 +1,7 @@ ################################################ # Start SUBSYSTEM LIBTDB [LIBRARY::LIBTDB] -VERSION = 0.0.1 -SO_VERSION = 0 -PC_FILE = tdb.pc +OUTPUT_TYPE = STATIC_LIBRARY OBJ_FILES = \ common/tdb.o common/dump.o common/io.o common/lock.o \ common/open.o common/traverse.o common/freelist.o \ diff --git a/source4/lib/tdb/tdb.mk b/source4/lib/tdb/tdb.mk index d0f9815c13..0e53927366 100644 --- a/source4/lib/tdb/tdb.mk +++ b/source4/lib/tdb/tdb.mk @@ -5,8 +5,8 @@ PROGS = bin/tdbtool$(EXEEXT) bin/tdbdump$(EXEEXT) bin/tdbbackup$(EXEEXT) PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbtorture$(EXEEXT) ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL) -SONAME = libtdb.$(SHLIBEXT).1 -SOLIB = libtdb.$(SHLIBEXT).$(PACKAGE_VERSION) +TDB_SONAME = libtdb.$(SHLIBEXT).1 +TDB_SOLIB = libtdb.$(SHLIBEXT).$(PACKAGE_VERSION) TDB_LIB = libtdb.a @@ -25,12 +25,12 @@ bin/tdbdump$(EXEEXT): tools/tdbdump.o $(TDB_LIB) bin/tdbbackup$(EXEEXT): tools/tdbbackup.o $(TDB_LIB) $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb -test:: bin/tdbtorture$(EXEEXT) $(SONAME) +test:: bin/tdbtorture$(EXEEXT) $(TDB_SONAME) $(LIB_PATH_VAR)=. bin/tdbtorture$(EXEEXT) clean:: rm -f test.db test.tdb torture.tdb test.gdbm - rm -f $(SONAME) $(SOLIB) libtdb.a libtdb.$(SHLIBEXT) + rm -f $(TDB_SONAME) $(TDB_SOLIB) libtdb.a libtdb.$(SHLIBEXT) rm -f $(ALL_PROGS) tdb.pc build-python:: _tdb.$(SHLIBEXT) @@ -74,13 +74,13 @@ installheaders:: installdirs installlibs:: all installdirs cp tdb.pc $(DESTDIR)$(libdir)/pkgconfig - cp libtdb.a $(SOLIB) $(DESTDIR)$(libdir) + cp libtdb.a $(TDB_SOLIB) $(DESTDIR)$(libdir) libtdb.a: $(TDB_OBJ) ar -rv libtdb.a $(TDB_OBJ) -libtdb.$(SHLIBEXT): $(SOLIB) +libtdb.$(SHLIBEXT): $(TDB_SOLIB) ln -fs $< $@ -$(SONAME): $(SOLIB) +$(TDB_SONAME): $(TDB_SOLIB) ln -fs $< $@ diff --git a/source4/librpc/idl/idl_types.h b/source4/librpc/idl/idl_types.h index 01524c2984..9885ca5bf6 100644 --- a/source4/librpc/idl/idl_types.h +++ b/source4/librpc/idl/idl_types.h @@ -10,11 +10,6 @@ #define STR_UTF8 LIBNDR_FLAG_STR_UTF8 /* - a UCS2 string prefixed with [size], 32 bits -*/ -#define lstring [flag(STR_SIZE4)] string - -/* a null terminated UCS2 string */ #define nstring [flag(STR_NULLTERM)] string diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl index 33b4dba7b2..2144393ebd 100644 --- a/source4/librpc/idl/spoolss.idl +++ b/source4/librpc/idl/spoolss.idl @@ -1407,12 +1407,13 @@ import "security.idl", "winreg.idl"; WERROR spoolss_EnumPrinterData( [in,ref] policy_handle *handle, [in] uint32 enum_index, + [out,ref,size_is(value_offered/2),charset(UTF16)] uint16 *value_name, [in] uint32 value_offered, - [out] lstring value_name, - [out] uint32 value_needed, - [out] uint32 printerdata_type, - [out] DATA_BLOB buffer, - [in,out,ref] uint32 *data_size + [out,ref] uint32 *value_needed, + [out,ref] uint32 *printerdata_type, + [out,ref] DATA_BLOB *buffer, + [in] uint32 data_offered, + [out,ref] uint32 *data_needed ); /******************/ diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 60d5bf8781..ef3eb3dbcf 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -2149,9 +2149,9 @@ sub ParseFunctionPull($$) $self->pidl("NDR_PULL_ALLOC_N(ndr, r->out.$e->{NAME}, $size);"); if (grep(/in/, @{$e->{DIRECTION}})) { - $self->pidl("memcpy(r->out.$e->{NAME}, r->in.$e->{NAME}, $size * sizeof(*r->in.$e->{NAME}));"); + $self->pidl("memcpy(r->out.$e->{NAME}, r->in.$e->{NAME}, ($size) * sizeof(*r->in.$e->{NAME}));"); } else { - $self->pidl("memset(r->out.$e->{NAME}, 0, $size * sizeof(*r->out.$e->{NAME}));"); + $self->pidl("memset(r->out.$e->{NAME}, 0, ($size) * sizeof(*r->out.$e->{NAME}));"); } } else { $self->pidl("NDR_PULL_ALLOC(ndr, r->out.$e->{NAME});"); diff --git a/source4/pidl/tests/wireshark-conf.pl b/source4/pidl/tests/wireshark-conf.pl index d6fe3158aa..c06ac16de4 100755 --- a/source4/pidl/tests/wireshark-conf.pl +++ b/source4/pidl/tests/wireshark-conf.pl @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 47; +use Test::More tests => 48; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -164,6 +164,9 @@ test_errors("nofile:1: no dissectorname specified\n", test_errors("nofile:1: incomplete HF_FIELD command\n", sub { parse_conf("HF_FIELD hf_idx\n"); }); +test_errors("nofile:1: incomplete ETT_FIELD command\n", + sub { parse_conf("ETT_FIELD\n"); }); + is_deeply(parse_conf("TYPE winreg_String dissect_myminregstring(); FT_STRING BASE_DEC 0 0 0 2\n"), { types => { winreg_String => { diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 047146edaf..feeeb9330b 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -67,11 +67,14 @@ static bool test_GetNumRecords(struct torture_context *tctx, struct dcerpc_pipe struct eventlog_GetNumRecords r; struct eventlog_CloseEventLog cr; struct policy_handle handle; + uint32_t number = 0; if (!get_policy_handle(tctx, p, &handle)) return false; + ZERO_STRUCT(r); r.in.handle = &handle; + r.out.number = &number; torture_assert_ntstatus_ok(tctx, dcerpc_eventlog_GetNumRecords(p, tctx, &r), @@ -98,6 +101,7 @@ static bool test_ReadEventLog(struct torture_context *tctx, if (!get_policy_handle(tctx, p, &handle)) return false; + ZERO_STRUCT(r); r.in.offset = 0; r.in.handle = &handle; r.in.flags = EVENTLOG_BACKWARDS_READ|EVENTLOG_SEQUENTIAL_READ; @@ -107,11 +111,15 @@ static bool test_ReadEventLog(struct torture_context *tctx, struct eventlog_Record rec; struct ndr_pull *ndr; enum ndr_err_code ndr_err; + uint32_t sent_size = 0; + uint32_t real_size = 0; /* Read first for number of bytes in record */ r.in.number_of_bytes = 0; r.out.data = NULL; + r.out.sent_size = &sent_size; + r.out.real_size = &real_size; status = dcerpc_eventlog_ReadEventLogW(p, tctx, &r); @@ -119,8 +127,6 @@ static bool test_ReadEventLog(struct torture_context *tctx, break; } - torture_assert_ntstatus_ok(tctx, status, "ReadEventLog failed"); - torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_BUFFER_TOO_SMALL, "ReadEventLog failed"); diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 23b4aad30b..4a6ff480c4 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1178,16 +1178,23 @@ static bool test_EnumPrinterData(struct torture_context *tctx, struct dcerpc_pip NTSTATUS status; struct spoolss_EnumPrinterData r; + ZERO_STRUCT(r); r.in.handle = handle; r.in.enum_index = 0; do { - uint32_t data_size; - - r.in.value_offered = 0; - data_size = 0; - r.in.data_size = &data_size; - r.out.data_size = &data_size; + uint32_t value_size = 0; + uint32_t data_size = 0; + uint32_t printerdata_type = 0; + DATA_BLOB data = data_blob(NULL,0); + + r.in.value_offered = value_size; + r.out.value_needed = &value_size; + r.in.data_offered = data_size; + r.out.data_needed = &data_size; + + r.out.printerdata_type = &printerdata_type; + r.out.buffer = &data; torture_comment(tctx, "Testing EnumPrinterData\n"); @@ -1195,7 +1202,8 @@ static bool test_EnumPrinterData(struct torture_context *tctx, struct dcerpc_pip torture_assert_ntstatus_ok(tctx, status, "EnumPrinterData failed"); - r.in.value_offered = r.out.value_needed; + r.in.value_offered = value_size; + r.in.data_offered = data_size; status = dcerpc_spoolss_EnumPrinterData(p, tctx, &r); |