1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

94841 Commits

Author SHA1 Message Date
Stefan Metzmacher
dfee057447 s4:librpc/rpc: avoid using dcerpc_unix_socket_path()
We use information stored in the dcerpc_binding in order
to open a secondary connection.

The goals are:
- dcerpc_secondary_connection_* should just use the dcerpc_binding
  information for the first connection and just call dcerpc_pipe_connect_*
- Get rid of dcerpc_pipe->transport.* and just use a tstream_context.
  All other details should be maintained only by the higher levels.
- Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle.
- Have just one entry point to create a new connection. For source4/librpc
  this will be dcerpc_pipe_connect_*. For source3/rpc_client we need
  a similar function.
- We'll have a new dcerpc_connection layer, with also just one
  entry point to create a new connection.
- Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer.
- Replace rpc_pipe_client with the new dcerpc_connection layer.
- When the client side is unified we can change the server
  as it needs to act as a client in order to register the endpoint mappings.
- Then the core of the server will be changed to use the new dcerpc_connection
  layer.

As dcerpc_unix_socket_path() uses p->transport.private_data
as 'struct sock_private', we should avoid it.
We can then remove dcerpc_unix_socket_path() and 'struct sock_private'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Volker Lendecke
a448699b7d torture3: Add a little gencache_parse load test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat May 24 16:16:43 CEST 2014 on sn-devel-104
2014-05-24 16:16:43 +02:00
Volker Lendecke
8f3be3dcff Exit with ctdb_fatal if serverids_exist fails
The only reason why this could fail is a severe ctdb communications
problem. The normal way to deal with this is ctdb_fatal. This avoids a
confusing panic in get_share_mode_lock when ctdb is shutdown while this
call happens.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-05-24 13:48:14 +02:00
Volker Lendecke
aaaff84b44 dbwrap_ctdb: open locally with TDB_VOLATILE if requested
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-05-24 13:48:14 +02:00
Jeremy Allison
b8ae6f8f57 s3:smbd: let default_sys_recvfile() and sys_recvfile() cope with non-blocking sockets.
default_sys_recvfile() and splice() recvfile were not
written to cope with non-blocking sockets.

When either the socket read() or splice() return
-1 with errno EWOULDBLOCK or EAGAIN, if no bytes have been
processed yet, return -1 and let the caller set
blocking and retry. If bytes have been processed,
just return them as a short read and let the
caller retry with the remaining needed reads.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-05-24 13:48:14 +02:00
Volker Lendecke
ec4496b823 unix_msg: Simplify unix_msg_send a bit
Now that we settled on variable arrays, remove a fixed one

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat May 24 02:56:31 CEST 2014 on sn-devel-104
2014-05-24 02:56:31 +02:00
David Disseldorp
04cddfc739 torture/smb2/dir: check create time match find
This adds a check to ensure that the create time returned in the SMB2
create response matches the value found in the find response.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 23 22:42:24 CEST 2014 on sn-devel-104
2014-05-23 22:42:24 +02:00
Jeremy Allison
f739480862 s3: smb2: Move from using SBVAL to put NTTIMEs on the wire to put_long_date_timespec.
put_long_date_timespec() correctly calls round_timespec()
on the time parameters, and is the correct function to
use when writing *any* file-based NTTIME on the wire.

Move from using NTTIME variables internally
in the server to struct timespec variables, which is
what all the other server code uses. Only map to
NTTIME as the last step of marshalling the output
data.

The previous SMB2 create code missed the round_timespec()
call before marshalling.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-05-23 20:16:12 +02:00
Jeremy Allison
ce010d0027 s3: smb2: Move from using SBVAL to put NTTIMEs on the wire to put_long_date_timespec.
put_long_date_timespec() correctly calls round_timespec()
on the time parameters, and is the correct function to
use when writing *any* file-based NTTIME on the wire.

The smb2_close() code being modified already did this by
hand, and so this doesn't change any of the functionality, only
makes the SMB2 code match all of the other server
code in Samba. Move from using NTTIME variables internally
in the server to struct timespec variables, which is
what all the other server code uses. Only map to
NTTIME as the last step of marshalling the output
data.

Not following the put_long_date_timespec()
convention in the SMB2 create code caused the
round_timespec() step to have been missed in
that code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-05-23 20:16:12 +02:00
Andreas Schneider
be07b8bc90 tests: Add doc exception for spoolss: OSVERSION.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 23 20:10:49 CEST 2014 on sn-devel-104
2014-05-23 20:10:49 +02:00
Andreas Schneider
416958ca62 doc-xml: Add documentation for 'spoolss: os_[major|minor|build]' options.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-05-23 17:44:28 +02:00
Michael Adam
55c279f0c4 smbd: add missing newline to debug message in daemon_ready()
Wrap overly long line while touching it anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May 23 04:03:43 CEST 2014 on sn-devel-104
2014-05-23 04:03:43 +02:00
Stefan Metzmacher
dcb8bfea61 lib/util: s/daemon/name
daemon() is a public function...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2014-05-23 01:37:10 +02:00
Stefan Metzmacher
26b91558df selftest: use dbwrap_tdb_mutexes:* = yes for "plugin_s4_dc" and "member"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 22 23:33:41 CEST 2014 on sn-devel-104
2014-05-22 23:33:41 +02:00
Volker Lendecke
41cf51b774 dbwrap_tdb: Use mutexes on demand
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
85fe2e8e3b tdb/tools: Allow tdbtool to r/o open mutexed tdbs
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
bd54feab46 tdb/tools: add -m option to tdbtorture
This allows tdbtorture to run with mutexes.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
b39e8eac20 tdb/test: add marklock deadlock test
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
fbaf94bb85 tdb/test: add mutex related tests
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
db5bda56bf tdb: add TDB_MUTEX_LOCKING support
This adds optional support for locking based on
shared robust mutexes.

The caller can use the TDB_MUTEX_LOCKING flag
together with TDB_CLEAR_IF_FIRST after verifying
with tdb_runtime_check_for_robust_mutexes() that
it's supported by the current system.

The caller should be aware that using TDB_MUTEX_LOCKING
implies some limitations, e.g. it's not possible to
have multiple read chainlocks on a given hash chain
from multiple processes.

Note: that this doesn't make tdb thread safe!

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
cbd73ba163 tdb: introduce tdb->hdr_ofs
This makes it possible to have some extra headers before
the real tdb content starts in the file.

This will be used used e.g. to implement locking based on robust mutexes.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Stefan Metzmacher
c29e64d97e tdb: introduce TDB_SUPPORTED_FEATURE_FLAGS
This will allow to store a feature mask in the tdb header on disk,
so that openers can check if they can handle the features
other openers are using.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Stefan Metzmacher
c0b0648555 tdb: use asprintf() to simplify tdb_summary()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
549338ff38 libreplace: Define PTHREAD_MUTEX_ROBUST along with pthread_mutexattr_setrobust
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
4baa2d021c libreplace-waf: Only check for _np functions if standard functions are not available
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
4ea036c26d libreplace: Add support for pthread_mutex_consistent
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
1993f605a4 libreplace: Add support for pthread_mutexattr_setrobust
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Stefan Metzmacher
730745d560 libreplace: only add PTHREAD CFLAGS and LDFLAGS globally if asked for
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
a8a9183400 libreplace: Move thread checks from source3/wscript
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Stefan Metzmacher
469e2fc36c wscript: set conf.env.replace_add_global_pthread = True
In Samba we currently add PTHREAD CFLAGS/LDFLAGS globally.
The following changes will move the configure checks to
lib/replace and the the default of adding the flags globally will change there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
1672643e44 tdb/test: add UNMAP command to external-agent.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
1e74ba47da tdb/test: add PING command to external-agent.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
1cb1b13cc9 tdb/test: add shutdown_agent() helper function
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Stefan Metzmacher
417489a214 tdb/test: add a "skip()" macro.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Stefan Metzmacher
19fb729188 tdb/test: correctly use stderr, not stdout, in fail()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Volker Lendecke
9bf4f10b4b tdb/tools: explicitly use TDB_NOLOCK in tdbdump
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Volker Lendecke
b4b8e393e5 tdb/tools: add -l option to tdbtool
This opens the tdb with TDB_NOLOCK.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Volker Lendecke
781563061d tdb/tools: add -l option to tdbbackup
This opens the tdb with TDB_NOLOCK.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Mathias Dietz
8935242489 Add protocol version to smbstatus output
Signed-off-by: Mathias Dietz <mdietz@de.ibm.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 22 18:37:27 CEST 2014 on sn-devel-104
2014-05-22 18:37:27 +02:00
David Disseldorp
b328bb07ff s4-torture: add print_test_purge
This change adds a regression test for print job purging via
SetPrinter(SPOOLSS_PRINTER_CONTROL_PURGE).

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 22 01:55:39 CEST 2014 on sn-devel-104
2014-05-22 01:55:39 +02:00
David Disseldorp
efb4684a3f printing: fix purge of all print jobs
The incorrect (system) jobid is currently passed to the job deletion
function.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10612

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-21 23:31:13 +02:00
Kai Blin
634f116fbb provision: Correctly provision the SOA record minimum TTL
This fixes bug #10466

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Guenter Kukkukk <kukks@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Wed May 21 10:55:00 CEST 2014 on sn-devel-104
2014-05-21 10:55:00 +02:00
Kai Blin
392ec4d241 bug #10609: CVE-2014-0239 Don't reply to replies
Due to insufficient input checking, the DNS server will reply to a packet that
has the "reply" bit set. Over UDP, this allows to send a packet with a spoofed
sender address and have two servers DOS each other with circular replies.

This patch fixes bug #10609 and adds a test to make sure we don't regress.
CVE-2014-2039 has been assigned to this issue.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10609

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Tue May 20 04:15:44 CEST 2014 on sn-devel-104
2014-05-20 04:15:44 +02:00
Michael Adam
e5649ef6ee smbd: fix creation of BUILTIN\{Administrators,Users} when "tdbsam:map builtin = false"
In this case, passdb/group mapping is not responsible for the id mapping
of the builtins, so the check whether the SID maps to a unix ID is not
valid for checking whether the builtin has been created as a proper group.
So this patch changes the check to whether we find the builtin in the group
mapping database.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon May 19 16:41:41 CEST 2014 on sn-devel-104
2014-05-19 16:41:41 +02:00
Günther Deschner
93093fa08d s4-torture: fix some build warnings in rpc samr test.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri May 16 23:48:35 CEST 2014 on sn-devel-104
2014-05-16 23:48:35 +02:00
Günther Deschner
efff779c72 s4-torture: fix test_openprinter_wrap fake test result.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-16 21:24:26 +02:00
Stefan Metzmacher
b8e5b68de3 talloc: version 2.1.1
Changes:
- documentation updates
- a fix for pytalloc-util.pc
- performance improvements here and there
- fixed compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri May 16 19:51:26 CEST 2014 on sn-devel-104
2014-05-16 19:51:26 +02:00
Stefan Metzmacher
8fbb81923d talloc/tests: avoid some unused variable warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-16 17:21:04 +02:00
Stefan Metzmacher
de822b5847 talloc: fix compiler warning
This avoids the following warning when using:

CFLAGS="-O3 -g -fstrict-overflow -Wstrict-overflow=5"

../talloc.c: In Funktion »talloc_is_parent«:
../talloc.c:2658:21: Warnung: assuming signed overflow does not occur when
changing X +- C1 cmp C2 to X cmp C1 +- C2 [-Wstrict-overflow]

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-16 17:21:04 +02:00
Stefan Metzmacher
eb95fc8866 talloc: check for TALLOC_GET_TYPE_ABORT_NOOP
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-16 17:21:04 +02:00