ira/third_party.git
5 years agolib/param: change set_variable_helper formatting
Garming Sam [Thu, 8 May 2014 00:10:04 +0000 (12:10 +1200)]
lib/param: change set_variable_helper formatting

Attempting to make the code match exactly before moving it over.

Change-Id: Id5571b00a8afd7dffc6197f2c7e020dd4fd59f85
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
5 years agoparam: use str_list_make_v3 instead of str_list_make in s3
Garming Sam [Tue, 6 May 2014 04:10:53 +0000 (16:10 +1200)]
param: use str_list_make_v3 instead of str_list_make in s3

Change-Id: Iea5aa39b9848bb19b0df3c70f249fd63bb61455e
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
5 years agoparam: Add null checks for upcoming str_list_make changes
Garming Sam [Thu, 13 Mar 2014 20:30:52 +0000 (09:30 +1300)]
param: Add null checks for upcoming str_list_make changes

In changing str_list_make to str_list_make_v3, the list can be NULL.
These are some additional checks to try to avoid any problems.

Where lists are dealt with, they typically check both if the list is
empty or the list is NULL.

Change-Id: I9012c31dbd9832ce877728bcb3346616ba64c4c5
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
5 years agoparam: pre-emptively correct use of str_list_make_v3 in lib/param
Garming Sam [Thu, 13 Mar 2014 00:27:24 +0000 (13:27 +1300)]
param: pre-emptively correct use of str_list_make_v3 in lib/param

lib/param uses str_list_make, while, s3 uses str_list_make_v3. These
differ slightly and should be made the same.

Notably it returns NULL when given a null or empty string

Also, includes the null check in s3 code to be consistent for merging
this section of code later on.

Change-Id: Ib543a5a5307e06989621ea16bfe87e315d66a7ef
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
5 years agolib/param: factor out a common portion of set_variable
Garming Sam [Tue, 25 Feb 2014 23:28:49 +0000 (12:28 +1300)]
lib/param: factor out a common portion of set_variable

Change-Id: Id8eeb480a377b4df8c3f51daf0d253f032fd0e83
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
5 years agoparam: change a number of parameters from P_LIST to P_CMDLIST
Garming Sam [Tue, 6 May 2014 02:56:46 +0000 (14:56 +1200)]
param: change a number of parameters from P_LIST to P_CMDLIST

These parameters are being changed to use their original syntax to match source3.

netbios aliases, interfaces, auth methods, invalid users, valid users,
admin users, read list, write list, hosts allow, hosts deny, preload
modules, smb ports, name resolve order, svcctl list, cluster addresses,
init logon delayed hosts, wins server, eventlog list, usershare prefix
allow list, usershare prefix deny list, vfs objects, winbind nss info

The documentation has also been changed to be consistent with the
change.

Change-Id: I536481098a508e0366c910b180f2db6a6f0634a9
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
5 years agos4-winbind: Use winbindd in the AD DC by default
Andrew Bartlett [Mon, 19 May 2014 22:15:31 +0000 (10:15 +1200)]
s4-winbind: Use winbindd in the AD DC by default

(Including changes to knownfail to match the new winbindd in use in each environment)

Change-Id: I9e08086eba98e95e05a99afef28315e2857aae56
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul  4 05:19:54 CEST 2014 on sn-devel-104

5 years agolib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_time
Volker Lendecke [Wed, 18 Jun 2014 12:21:06 +0000 (12:21 +0000)]
lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_time

Both take and return values now

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespec
Volker Lendecke [Wed, 18 Jun 2014 12:21:06 +0000 (12:21 +0000)]
lib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespec

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotdb: defragment the freelist in tdb_allocate_from_freelist()
Michael Adam [Wed, 11 Jun 2014 10:05:57 +0000 (12:05 +0200)]
tdb: defragment the freelist in tdb_allocate_from_freelist()

While we are traversing the freelist anyways, merge a record
with the left if it is also a free list record.

That partially makes up for the fragmentation introduced by
the lack of merging with right records in tdb_free().

Note there is a potential slight downside:
If the left record we merge the current record into was earlier
in the chain and has hence already been met in traverse,
then we can not use the enlarged record even if it might be
a new best fit.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jun 26 12:16:03 CEST 2014 on sn-devel-104

5 years agotdb: add "freelist_size" sub-command to tdbtool
Michael Adam [Mon, 10 Feb 2014 06:39:31 +0000 (07:39 +0100)]
tdb: add "freelist_size" sub-command to tdbtool

With the new code, this has the side effect of
merging adjacent records in the freelist if the
database is not read-only.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: use tdb_freelist_merge_adjacent in tdb_freelist_size()
Michael Adam [Wed, 11 Jun 2014 15:26:51 +0000 (17:26 +0200)]
tdb: use tdb_freelist_merge_adjacent in tdb_freelist_size()

So that we automatically defragment the free list when freelist_size is called
(unless the database is read only).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: add tdb_freelist_merge_adjacent()
Michael Adam [Mon, 10 Feb 2014 01:39:09 +0000 (02:39 +0100)]
tdb: add tdb_freelist_merge_adjacent()

This is intended to be called to reduce the fragmentation in the
freelist. This is to make up the deficiency of the freelist
to be not doubly linked. If the freelist were doubly linked,
we could easily avoid the creation of adjacent freelist entries.
But with the current singly linked list, it is only possible
to cheaply merge a new free record into a freelist entry on the left,
not on the right...

This can be called periodically, e.g. in the vacuuming process
of a ctdb cluster.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: add utility function check_merge_ptr_with_left_record()
Michael Adam [Wed, 11 Jun 2014 10:04:01 +0000 (12:04 +0200)]
tdb: add utility function check_merge_ptr_with_left_record()

Variant of check_merge_with_left_record() that reads the record
itself if necessary.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: simplify tdb_free() using check_merge_with_left_record()
Michael Adam [Wed, 11 Jun 2014 10:03:01 +0000 (12:03 +0200)]
tdb: simplify tdb_free() using check_merge_with_left_record()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: add utility function check_merge_with_left_record()
Michael Adam [Wed, 11 Jun 2014 10:00:48 +0000 (12:00 +0200)]
tdb: add utility function check_merge_with_left_record()

Check whether the record left of a given freelist record is
also a freelist record, and if so, merge the two records.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: improve comments for tdb_free().
Michael Adam [Fri, 18 Apr 2014 23:49:44 +0000 (01:49 +0200)]
tdb: improve comments for tdb_free().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: factor merge_with_left_record() out of tdb_free()
Michael Adam [Mon, 10 Feb 2014 01:01:38 +0000 (02:01 +0100)]
tdb: factor merge_with_left_record() out of tdb_free()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: fix debug message in tdb_free()
Michael Adam [Mon, 10 Feb 2014 00:51:39 +0000 (01:51 +0100)]
tdb: fix debug message in tdb_free()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: reduce indentation in tdb_free() for merging left
Michael Adam [Mon, 10 Feb 2014 00:46:42 +0000 (01:46 +0100)]
tdb: reduce indentation in tdb_free() for merging left

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: increase readability of read_record_on_left()
Michael Adam [Mon, 10 Feb 2014 00:39:15 +0000 (01:39 +0100)]
tdb: increase readability of read_record_on_left()

by using early returns and better variable names,
and reducing indentation.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: factor read_record_on_left() out of tdb_free()
Michael Adam [Mon, 10 Feb 2014 00:31:50 +0000 (01:31 +0100)]
tdb: factor read_record_on_left() out of tdb_free()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agonss_wrapper: Fix some "discarding const" warnings
Volker Lendecke [Sat, 21 Jun 2014 08:48:56 +0000 (10:48 +0200)]
nss_wrapper: Fix some "discarding const" warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agonss_wrapper: Align indentation with the rest of Samba
Volker Lendecke [Sat, 21 Jun 2014 08:47:28 +0000 (10:47 +0200)]
nss_wrapper: Align indentation with the rest of Samba

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoldb:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:08:53 +0000 (18:08 +0200)]
ldb:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoreplace:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:08:18 +0000 (18:08 +0200)]
replace:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agontdb:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:05:44 +0000 (18:05 +0200)]
ntdb:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agotalloc:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:04:44 +0000 (18:04 +0200)]
talloc:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agotevent:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:04:13 +0000 (18:04 +0200)]
tevent:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agotdb:build: improve detection of srcdir.
Michael Adam [Fri, 20 Jun 2014 16:03:31 +0000 (18:03 +0200)]
tdb:build: improve detection of srcdir.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agolib: Apply const to nt_time_to_unix_timespec
Volker Lendecke [Wed, 18 Jun 2014 10:55:10 +0000 (10:55 +0000)]
lib: Apply const to nt_time_to_unix_timespec

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jun 18 16:35:26 CEST 2014 on sn-devel-104

5 years agolib: Use server_id_str_buf in server_id_str
Volker Lendecke [Tue, 3 Jun 2014 13:04:56 +0000 (13:04 +0000)]
lib: Use server_id_str_buf in server_id_str

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Add server_id_str_buf
Volker Lendecke [Fri, 30 May 2014 15:24:34 +0000 (15:24 +0000)]
lib: Add server_id_str_buf

This is usable in a DEBUG statement without talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: tevent: make TEVENT_SIG_INCREMENT atomic.
Jeremy Allison [Tue, 3 Jun 2014 17:44:19 +0000 (10:44 -0700)]
lib: tevent: make TEVENT_SIG_INCREMENT atomic.

On arm platforms incrementing a variable is not
an atomic operation, so may be interrupted by
signal processing (if a signal interrupts another
signal handler).

Use compiler built-ins to make this atomic.
__sync_fetch_and_add() works on gcc, llvm,
IBM xlC on AIX, and Intel icc (10.1 and
above).

atomic_add_32() works on Oracle Solaris.

Based on an inital patch from kamei@osstech.co.jp.

Bug #10640 - smbd is not responding - tevent_common_signal_handler() increments non-atomic variables

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
5 years agolib: Bump socket_wrapper version to 1.1.1.
Michael Adam [Thu, 5 Jun 2014 21:50:30 +0000 (23:50 +0200)]
lib: Bump socket_wrapper version to 1.1.1.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: Disable incomplete bind checks (and tests) for EADDRINUSE.
Andreas Schneider [Thu, 5 Jun 2014 21:38:59 +0000 (23:38 +0200)]
swrap: Disable incomplete bind checks (and tests) for EADDRINUSE.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolib: Bump socket_wrapper version to 1.1.0.
Andreas Schneider [Tue, 3 Jun 2014 13:15:34 +0000 (15:15 +0200)]
lib: Bump socket_wrapper version to 1.1.0.

5 years agoswrap: check whether an address:port is already in use in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 13:14:44 +0000 (15:14 +0200)]
swrap: check whether an address:port is already in use in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: implement check_addr_port_in_use()
Michael Adam [Tue, 3 Jun 2014 13:13:59 +0000 (15:13 +0200)]
swrap: implement check_addr_port_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: fix AF_UNSPEC special case in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 13:13:02 +0000 (15:13 +0200)]
swrap: fix AF_UNSPEC special case in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: extend input checks in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 13:12:34 +0000 (15:12 +0200)]
swrap: extend input checks in swrap_bind()

Not only check family, but depending on family, also check the length.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: add check for rpc/rpc.h - needed on freebsd for bindresvport
Michael Adam [Tue, 3 Jun 2014 13:11:46 +0000 (15:11 +0200)]
swrap: add check for rpc/rpc.h - needed on freebsd for bindresvport

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: Add support for bindresvport().
Andreas Schneider [Tue, 3 Jun 2014 13:10:19 +0000 (15:10 +0200)]
swrap: Add support for bindresvport().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add missing family check in bind().
Andreas Schneider [Tue, 3 Jun 2014 13:08:57 +0000 (15:08 +0200)]
swrap: Add missing family check in bind().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Setup myname in swrap_socket() for getsockname().
Andreas Schneider [Tue, 3 Jun 2014 13:08:07 +0000 (15:08 +0200)]
swrap: Setup myname in swrap_socket() for getsockname().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Make sure cmbuf is not NULL.
Andreas Schneider [Tue, 3 Jun 2014 13:07:07 +0000 (15:07 +0200)]
swrap: Make sure cmbuf is not NULL.

CID 63532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: We need to pass a pointer-pointer to not leak memory.
Andreas Schneider [Tue, 3 Jun 2014 13:06:33 +0000 (15:06 +0200)]
swrap: We need to pass a pointer-pointer to not leak memory.

CID 63533

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Support more socket options in getsockopt().
Andreas Schneider [Tue, 3 Jun 2014 13:05:56 +0000 (15:05 +0200)]
swrap: Support more socket options in getsockopt().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().
Andreas Schneider [Tue, 3 Jun 2014 13:05:12 +0000 (15:05 +0200)]
swrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_msghdr_filter_cmsg_pktinfo().
Andreas Schneider [Tue, 3 Jun 2014 13:04:45 +0000 (15:04 +0200)]
swrap: Add swrap_msghdr_filter_cmsg_pktinfo().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_sendmsg_filter_cmsg_socket().
Andreas Schneider [Tue, 3 Jun 2014 13:04:18 +0000 (15:04 +0200)]
swrap: Add swrap_sendmsg_filter_cmsg_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_sendmsg_copy_cmsg().
Andreas Schneider [Tue, 3 Jun 2014 13:03:41 +0000 (15:03 +0200)]
swrap: Add swrap_sendmsg_copy_cmsg().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_sendmsg_filter_cmsghdr().
Andreas Schneider [Tue, 3 Jun 2014 13:03:03 +0000 (15:03 +0200)]
swrap: Add swrap_sendmsg_filter_cmsghdr().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Implement support for IP_RECVDSTADDR on BSD.
Andreas Schneider [Tue, 3 Jun 2014 13:02:17 +0000 (15:02 +0200)]
swrap: Implement support for IP_RECVDSTADDR on BSD.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Check if the in_pktinfo structure is available.
Andreas Schneider [Tue, 3 Jun 2014 13:01:34 +0000 (15:01 +0200)]
swrap: Check if the in_pktinfo structure is available.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Silence a warning on OpenIndiana.
Andreas Schneider [Tue, 3 Jun 2014 13:00:18 +0000 (15:00 +0200)]
swrap: Silence a warning on OpenIndiana.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Properly cache the handle also in LIBC_SO case.
Pino Toscano [Tue, 3 Jun 2014 12:59:21 +0000 (14:59 +0200)]
swrap: Properly cache the handle also in LIBC_SO case.

Small regression introduced by me in commit
0fa56909442c3cfea6a697681ea0e89ba5a0aa0f.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10572

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Truncate the address if the buffer is to small.
Andreas Schneider [Tue, 3 Jun 2014 12:58:24 +0000 (14:58 +0200)]
swrap: Truncate the address if the buffer is to small.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Process control messages in recvmsg().
Andreas Schneider [Tue, 3 Jun 2014 12:57:35 +0000 (14:57 +0200)]
swrap: Process control messages in recvmsg().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().
Andreas Schneider [Tue, 3 Jun 2014 12:57:08 +0000 (14:57 +0200)]
swrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_msghdr_socket_info().
Andreas Schneider [Tue, 3 Jun 2014 12:56:28 +0000 (14:56 +0200)]
swrap: Add swrap_msghdr_socket_info().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_msghdr_add_pktinfo().
Andreas Schneider [Tue, 3 Jun 2014 12:55:49 +0000 (14:55 +0200)]
swrap: Add swrap_msghdr_add_pktinfo().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add swrap_msghdr_add_cmsghdr().
Andreas Schneider [Tue, 3 Jun 2014 12:55:13 +0000 (14:55 +0200)]
swrap: Add swrap_msghdr_add_cmsghdr().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
5 years agoswrap: Add IP_PKTINFO support in setsockopt.
Andreas Schneider [Tue, 3 Jun 2014 12:54:28 +0000 (14:54 +0200)]
swrap: Add IP_PKTINFO support in setsockopt.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agowaf: Add check for HAVE_STRUCT_IN6_PKTINFO.
Andreas Schneider [Tue, 3 Jun 2014 12:53:19 +0000 (14:53 +0200)]
waf: Add check for HAVE_STRUCT_IN6_PKTINFO.

Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agoswrap: Correctly set the bind iface address on connect().
Andreas Schneider [Tue, 3 Jun 2014 12:50:53 +0000 (14:50 +0200)]
swrap: Correctly set the bind iface address on connect().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoswrap: use LIBC_SO from GNU libc, if available
Pino Toscano [Tue, 3 Jun 2014 12:50:05 +0000 (14:50 +0200)]
swrap: use LIBC_SO from GNU libc, if available

Look for gnu/lib-names.h and use the LIBC_SO define to dlopen libc, so
the right library is loaded without manually searching for libc.so.N.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agowaf: add --with-fake-kaserver option
Christian Ambach [Tue, 15 Apr 2014 22:36:25 +0000 (00:36 +0200)]
waf: add --with-fake-kaserver option

This option was not added during the transition from autoconf
to waf.
Bring it back so that the code can be used again.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9916
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:lib/afs move afs_settoken.c to common lib dir
Christian Ambach [Mon, 14 Apr 2014 20:35:21 +0000 (22:35 +0200)]
s3:lib/afs move afs_settoken.c to common lib dir

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:lib/afs move afs.c to common lib dir
Christian Ambach [Mon, 14 Apr 2014 20:11:12 +0000 (22:11 +0200)]
s3:lib/afs move afs.c to common lib dir

some of the code in afs.c is needed by wbinfo that lives in the toplevel
nsswitch directory, so move the afs.c file to a new top-level lib/afs
directory. Use the name afs_funcs to avoid collisions with the afs.h
header from OpenAFS

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowinbind: Fix template homedir to match source3
Andrew Bartlett [Fri, 28 Mar 2014 03:32:06 +0000 (16:32 +1300)]
winbind: Fix template homedir to match source3

Fix provided by Andy Igoshin <ai@vsu.ru>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10324

Andrew Bartlett

Change-Id: Ie94d207fed91e9dfd85ee3c3339c376b25ac5fa4
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosmbd: add missing newline to debug message in daemon_ready()
Michael Adam [Thu, 22 May 2014 06:48:32 +0000 (08:48 +0200)]
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

5 years agolib/util: s/daemon/name
Stefan Metzmacher [Mon, 12 May 2014 12:36:57 +0000 (14:36 +0200)]
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>
5 years agotdb/tools: Allow tdbtool to r/o open mutexed tdbs
Volker Lendecke [Fri, 15 Nov 2013 11:57:06 +0000 (12:57 +0100)]
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>
5 years agotdb/tools: add -m option to tdbtorture
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb/test: add marklock deadlock test
Volker Lendecke [Wed, 22 Jan 2014 10:15:55 +0000 (11:15 +0100)]
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>
5 years agotdb/test: add mutex related tests
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb: add TDB_MUTEX_LOCKING support
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb: introduce tdb->hdr_ofs
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb: introduce TDB_SUPPORTED_FEATURE_FLAGS
Stefan Metzmacher [Tue, 4 Feb 2014 22:35:53 +0000 (23:35 +0100)]
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>
5 years agotdb: use asprintf() to simplify tdb_summary()
Stefan Metzmacher [Tue, 13 May 2014 01:15:41 +0000 (03:15 +0200)]
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>
5 years agolibreplace: Define PTHREAD_MUTEX_ROBUST along with pthread_mutexattr_setrobust
Volker Lendecke [Wed, 6 Feb 2013 11:16:02 +0000 (12:16 +0100)]
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>
5 years agolibreplace-waf: Only check for _np functions if standard functions are not available
Volker Lendecke [Wed, 6 Feb 2013 11:15:41 +0000 (12:15 +0100)]
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>
5 years agolibreplace: Add support for pthread_mutex_consistent
Volker Lendecke [Mon, 4 Feb 2013 11:26:47 +0000 (12:26 +0100)]
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>
5 years agolibreplace: Add support for pthread_mutexattr_setrobust
Volker Lendecke [Sat, 22 Dec 2012 07:42:48 +0000 (08:42 +0100)]
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>
5 years agolibreplace: only add PTHREAD CFLAGS and LDFLAGS globally if asked for
Stefan Metzmacher [Thu, 16 May 2013 09:50:38 +0000 (11:50 +0200)]
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>
5 years agolibreplace: Move thread checks from source3/wscript
Volker Lendecke [Mon, 14 Jan 2013 13:56:25 +0000 (14:56 +0100)]
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>
5 years agotdb/test: add UNMAP command to external-agent.c
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb/test: add PING command to external-agent.c
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb/test: add shutdown_agent() helper function
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb/test: add a "skip()" macro.
Stefan Metzmacher [Tue, 6 May 2014 09:11:38 +0000 (11:11 +0200)]
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>
5 years agotdb/test: correctly use stderr, not stdout, in fail()
Stefan Metzmacher [Tue, 6 May 2014 09:10:23 +0000 (11:10 +0200)]
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>
5 years agotdb/tools: explicitly use TDB_NOLOCK in tdbdump
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb/tools: add -l option to tdbtool
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotdb/tools: add -l option to tdbbackup
Volker Lendecke [Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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>
5 years agotalloc: version 2.1.1
Stefan Metzmacher [Thu, 15 May 2014 12:53:49 +0000 (14:53 +0200)]
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

5 years agotalloc/tests: avoid some unused variable warnings
Stefan Metzmacher [Thu, 27 Feb 2014 08:28:02 +0000 (09:28 +0100)]
talloc/tests: avoid some unused variable warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotalloc: fix compiler warning
Stefan Metzmacher [Wed, 20 Nov 2013 08:58:09 +0000 (09:58 +0100)]
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>
5 years agotalloc: check for TALLOC_GET_TYPE_ABORT_NOOP
Stefan Metzmacher [Thu, 5 Dec 2013 07:36:13 +0000 (08:36 +0100)]
talloc: check for TALLOC_GET_TYPE_ABORT_NOOP

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotalloc: avoid a function call in TALLOC_FREE() if possible.
Stefan Metzmacher [Wed, 4 Dec 2013 14:35:37 +0000 (15:35 +0100)]
talloc: avoid a function call in TALLOC_FREE() if possible.

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