metze/samba/wip.git
7 years agotevent_tutorial: Fix tevent_thread referencing master3-nmbd
Volker Lendecke [Sun, 11 Sep 2016 07:28:35 +0000 (09:28 +0200)]
tevent_tutorial: Fix tevent_thread referencing

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): Fri Sep 16 05:16:02 CEST 2016 on sn-devel-144

7 years agotevent_tutorial: Fix typos
Volker Lendecke [Sun, 11 Sep 2016 07:28:35 +0000 (09:28 +0200)]
tevent_tutorial: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3/smbd: set FILE_ATTRIBUTE_DIRECTORY as necessary
Ralph Boehme [Wed, 14 Sep 2016 10:52:48 +0000 (12:52 +0200)]
s3/smbd: set FILE_ATTRIBUTE_DIRECTORY as necessary

Some VFS modules like GPFS will always return success from
SMB_VFS_GET_DOS_ATTRIBUTES() but only set a subset of the attributes. It
neither sets FILE_ATTRIBUTE_NORMAL nor FILE_ATTRIBUTE_DIRECTORY.

We already handle the case that the VFS stack returns with result==0 and
then add the FILE_ATTRIBUTE_NORMAL, regardless of the type of the
filesystem object. If we want to handle result==0 situation in the
SMB_VFS_GET_DOS_ATTRIBUTES() caller, then do it right by either setting
FILE_ATTRIBUTE_NORMAL or FILE_ATTRIBUTE_DIRECTORY.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 16 00:34:43 CEST 2016 on sn-devel-144

7 years agonfs4acl: Fix owner mapping with ID_TYPE_BOTH
Christof Schmitt [Mon, 12 Sep 2016 23:22:16 +0000 (16:22 -0700)]
nfs4acl: Fix owner mapping with ID_TYPE_BOTH

This fixes a corner case when using NFS4 ACLs with ID_TYPE_BOTH.  Before
this patch, the owner entry in the ACL would be mapped to a gid entry in
the NFSv4 ACL, and not the expected special owner entry. This is caused
by the id mapping returning a valid gid and the nfs4 mapping assumed
that this was actually a group.

Fix this by asking for the uid first, and explicitly checking if the
mapped uid matches the owner. That creates a uid entry in the NFSv4 ACL
that can be changed later in smbacl4_substitute_{simple,special} to the
expected special owner entry.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-spoolss: fix winreg_printer_ver_to_qword
Günther Deschner [Mon, 12 Sep 2016 15:55:37 +0000 (17:55 +0200)]
s3-spoolss: fix winreg_printer_ver_to_qword

We were reporting the OS minor number as the driver version number in all
GetDriver/EnumDriver calls.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbd: Reset O_NONBLOCK on open files
Volker Lendecke [Mon, 29 Aug 2016 07:58:45 +0000 (09:58 +0200)]
smbd: Reset O_NONBLOCK on open files

See the comment inline :-)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12268
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo <simo@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 15 20:21:41 CEST 2016 on sn-devel-144

7 years agos4:samba_spnupdate: do not attempt to parse log level, use parsed value
Christian Ambach [Tue, 13 Sep 2016 08:49:47 +0000 (10:49 +0200)]
s4:samba_spnupdate: do not attempt to parse log level, use parsed value

The log level parameter can contain debug class specific entries.
Do not attempt to parse this as int, but use the values that the
debugging system already parsed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Sep 14 23:15:18 CEST 2016 on sn-devel-144

7 years agopython/join: do not attempt to parse log level, use parsed value
Christian Ambach [Tue, 13 Sep 2016 08:49:47 +0000 (10:49 +0200)]
python/join: do not attempt to parse log level, use parsed value

The log level parameter can contain debug class specific entries.
Do not attempt to parse this as int, but use the values that the
debugging system already parsed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agopython/drs_utils: do not attempt to parse log level, use parsed value
Christian Ambach [Tue, 13 Sep 2016 08:49:47 +0000 (10:49 +0200)]
python/drs_utils: do not attempt to parse log level, use parsed value

The log level parameter can contain debug class specific entries.
Do not attempt to parse this as int, but use the values that the
debugging system already parsed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests/param add a test for LoadParm.log_level
Christian Ambach [Tue, 13 Sep 2016 09:22:38 +0000 (11:22 +0200)]
tests/param add a test for LoadParm.log_level

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agos4:param add log_level function to retrieve log level in Python code
Christian Ambach [Tue, 13 Sep 2016 08:48:03 +0000 (10:48 +0200)]
s4:param add log_level function to retrieve log level in Python code

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agounix_msg: Fix unix_dgram_send_queue_init
Volker Lendecke [Wed, 14 Sep 2016 05:16:26 +0000 (07:16 +0200)]
unix_msg: Fix unix_dgram_send_queue_init

We should not free a DLIST element

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 14 19:30:28 CEST 2016 on sn-devel-144

7 years agounix_msg: Fix CID 1372875 Double close
Volker Lendecke [Wed, 14 Sep 2016 05:13:38 +0000 (07:13 +0200)]
unix_msg: Fix CID 1372875 Double close

The two error callers of unix_dgram_sendq_schedule_free already run down the
sendq in the error case.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
7 years agoctdb-tests: Add new public IP takeover no-op test
Martin Schwenke [Tue, 13 Sep 2016 03:48:19 +0000 (13:48 +1000)]
ctdb-tests: Add new public IP takeover no-op test

Test with DisableIPFailover=1 and with no public IP addresses
configured.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 14 12:30:30 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Factor out new local daemons functions ps_ctdbd
Martin Schwenke [Tue, 13 Sep 2016 03:44:04 +0000 (13:44 +1000)]
ctdb-tests: Factor out new local daemons functions ps_ctdbd

Useful for being able to ensure that tests are doing what is expected.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: ipalloc_set_public_ips() can't fail
Martin Schwenke [Mon, 12 Sep 2016 06:04:18 +0000 (16:04 +1000)]
ctdb-ipalloc: ipalloc_set_public_ips() can't fail

So make it a void function.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Move merged IP list creation to ipalloc()
Martin Schwenke [Mon, 12 Sep 2016 05:59:09 +0000 (15:59 +1000)]
ctdb-ipalloc: Move merged IP list creation to ipalloc()

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Drop known_ips argument from merged IP list creation
Martin Schwenke [Mon, 12 Sep 2016 05:57:23 +0000 (15:57 +1000)]
ctdb-ipalloc: Drop known_ips argument from merged IP list creation

This is available in the IP allocation state.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Optimise check to see if IPs can be hosted
Martin Schwenke [Mon, 12 Sep 2016 05:51:58 +0000 (15:51 +1000)]
ctdb-ipalloc: Optimise check to see if IPs can be hosted

Add an early return if there are no known IP addresses.

Also add an extra comment for clarification.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Whether IPs can be hosted need not depend on merged IP list
Martin Schwenke [Mon, 12 Sep 2016 05:49:03 +0000 (15:49 +1000)]
ctdb-ipalloc: Whether IPs can be hosted need not depend on merged IP list

Merged IP list won't be available here...

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-ipalloc: Store known public IPs in IP allocation state
Martin Schwenke [Mon, 12 Sep 2016 05:41:06 +0000 (15:41 +1000)]
ctdb-ipalloc: Store known public IPs in IP allocation state

This was dropped because it wasn't used, but it will be needed again.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-packaging: Fix systemd network dependency
Martin Schwenke [Thu, 8 Sep 2016 02:28:00 +0000 (12:28 +1000)]
ctdb-packaging: Fix systemd network dependency

https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ says:

  network.target has very little meaning during start-up. [...]
  Whether any network interfaces are already configured when it is
  reached is undefined. [...]

  network-online.target is a target that actively waits until the
  ne[t]work is "up",

CTDB expects to be able to bind a socket to a node address and expects
interfaces for public IP addresses to exist.  CTDB also doesn't expect
time to jump, so also wait until time is synchronised.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Steve French <sfrench@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Tested-by: Steve French <sfrench@samba.org>
7 years agoctdb-daemon: Remove NUM_DB_PRIORITIES
Amitay Isaacs [Tue, 13 Sep 2016 03:08:58 +0000 (13:08 +1000)]
ctdb-daemon: Remove NUM_DB_PRIORITIES

It's not used anymore.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-recoverd: Drop code to freeze databases from set_recovery_mode()
Amitay Isaacs [Tue, 13 Sep 2016 05:45:54 +0000 (15:45 +1000)]
ctdb-recoverd: Drop code to freeze databases from set_recovery_mode()

This function is called only once from force_election() and does not
require freezing of databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos3-ctdb: Use correct db_id size in marshalling record buffer
Amitay Isaacs [Tue, 28 Jun 2016 04:35:43 +0000 (14:35 +1000)]
s3-ctdb: Use correct db_id size in marshalling record buffer

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-common: Use correct db_id size in marshalling record buffer
Amitay Isaacs [Tue, 28 Jun 2016 04:35:11 +0000 (14:35 +1000)]
ctdb-common: Use correct db_id size in marshalling record buffer

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-protocol: Fix marshalling for GET_DB_SEQNUM control request
Amitay Isaacs [Tue, 13 Sep 2016 06:05:14 +0000 (16:05 +1000)]
ctdb-protocol: Fix marshalling for GET_DB_SEQNUM control request

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

Even though database id is 32-bit, it's sent on wire as 64-bits.
The database id is the first 32-bits on the wire.  This needs fixing
eventually, but for now keep the same wire format.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos3:libsmb fix a typo
Christian Ambach [Tue, 13 Sep 2016 12:59:25 +0000 (14:59 +0200)]
s3:libsmb fix a typo

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 14 02:06:18 CEST 2016 on sn-devel-144

7 years agos4-kdc: Do not leak memory on error in kpasswd_make_error_reply()
Andreas Schneider [Tue, 13 Sep 2016 08:25:07 +0000 (10:25 +0200)]
s4-kdc: Do not leak memory on error in kpasswd_make_error_reply()

CID 1372874

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 13 22:13:31 CEST 2016 on sn-devel-144

7 years agounix_msg: add a test for dgram socket caching
Ralph Boehme [Fri, 19 Aug 2016 10:02:12 +0000 (12:02 +0200)]
unix_msg: add a test for dgram socket caching

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 13 04:11:30 CEST 2016 on sn-devel-144

7 years agounix_msg: always create a send queue for a peer
Ralph Boehme [Fri, 19 Aug 2016 07:22:54 +0000 (09:22 +0200)]
unix_msg: always create a send queue for a peer

Previously, we only created a send queue for a peer if the initial send
to the non-blocking non-connected socket reported EWOULDBOCK (because
the channel was full).

With this change, we now always create a send queue and use a connected,
non-blocking datagram socket from the beginning.

Initially, the socket of the send queue is set to non-blocking mode and
we attempt a direct send via sendmsg(). If that returns EWOULDBOCK, we
set the send queue to blocking mode and let the threadpool handle the
IO.

When a send queue becomes empty, we set the send queue socket back to
non-blocking.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: introduce send queue caching
Ralph Boehme [Fri, 19 Aug 2016 14:25:11 +0000 (16:25 +0200)]
unix_msg: introduce send queue caching

This introduces caching of unix datagram send queues. Right now send
queues are only created for peers if the channel to the peer is full and
a send reported EWOULDBLOCK.

At this stage, performance will actually be slightly worse, because now
if there's a cached queue for a peer without queued messages, we don't
attempt direct send anymore until the send queue is removed from the
cache.

The next commit will modify unix_msg to always create a send queue with
the datagram socket in connected mode and again attempt an non-blocking
send on the connected socket first. Then only if that returns
EWOULDBLOCK, the send has to go through the threadpool.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: add flag to prepare_socket_nonblock()
Ralph Boehme [Mon, 22 Aug 2016 12:02:43 +0000 (14:02 +0200)]
unix_msg: add flag to prepare_socket_nonblock()

This allows prepare_socket_nonblock() to be called to set a socket to
non-blocking (as before) as well as blocking. This will be used in a
subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agomessaging: Call messaging_dgm_send under become_root only if necessary
Ralph Boehme [Thu, 1 Sep 2016 12:08:55 +0000 (14:08 +0200)]
messaging: Call messaging_dgm_send under become_root only if necessary

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: Return errno from find_send_queue
Ralph Boehme [Thu, 1 Sep 2016 12:04:30 +0000 (14:04 +0200)]
unix_msg: Return errno from find_send_queue

Signed-off-by: : Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agounix_msg: modify find_send_queue() to take a struct sockaddr_un
Ralph Boehme [Fri, 19 Aug 2016 14:14:52 +0000 (16:14 +0200)]
unix_msg: modify find_send_queue() to take a struct sockaddr_un

In one of the next commits unix_dgram_send_queue_init() will be moved
into find_send_queue and that takes a struct sockaddr_un.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4/messaging: messaging_dgm_ref talloc hierarchy fix
Ralph Boehme [Fri, 9 Sep 2016 05:12:11 +0000 (07:12 +0200)]
s4/messaging: messaging_dgm_ref talloc hierarchy fix

Ensure the messaging dgm context goes away *before* the tevent
context. The messaging dgm context will likely have active fd or timer
events, their rundown will touch the associated tevent context.

Otoh, I deliberately don't free the imessaging context here, that's going
to happen as part of freeing the talloc_autofree_context() as before. I
think it suffers the same problem, eg imessaging_deregister() works on
an imessaging_context that might already be freed. But as it works,
don't change it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-kdc: Remove obsolete kpasswdd heimdal implementation
Jeremy Allison [Mon, 12 Sep 2016 19:11:55 +0000 (12:11 -0700)]
s4-kdc: Remove obsolete kpasswdd heimdal implementation

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4-kdc: Switch to the new kpasswd service implementation
Andreas Schneider [Wed, 7 Sep 2016 14:38:06 +0000 (16:38 +0200)]
s4-kdc: Switch to the new kpasswd service implementation

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-kdc: Add new kpasswd service Heimdal backend
Andreas Schneider [Wed, 7 Sep 2016 14:03:15 +0000 (16:03 +0200)]
s4-kdc: Add new kpasswd service Heimdal backend

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-kdc: Add a new kpasswd service implementation
Andreas Schneider [Wed, 7 Sep 2016 10:32:14 +0000 (12:32 +0200)]
s4-kdc: Add a new kpasswd service implementation

This function is intended to be be passed to kdc_add_socket(). The
function kpasswd_handle_request() which is called by kpasswd_process()
is Kerberos implementation specific and should be implemented in a
kpasswd-service-<kerberos flavour>.c file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-kdc: Allow to set the keytab_name in the kdc_server structure
Andreas Schneider [Wed, 7 Sep 2016 10:30:21 +0000 (12:30 +0200)]
s4-kdc: Allow to set the keytab_name in the kdc_server structure

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-kdc: Add a kpasswd_samdb_set_password() helper function
Andreas Schneider [Wed, 7 Sep 2016 13:07:49 +0000 (15:07 +0200)]
s4-kdc: Add a kpasswd_samdb_set_password() helper function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3/smbd: use stat from smb_fname if valid in refuse_symlink()
Ralph Boehme [Sat, 10 Sep 2016 12:43:07 +0000 (14:43 +0200)]
s3/smbd: use stat from smb_fname if valid in refuse_symlink()

Now that refuse_symlink() gets passed in a smb_fname and not just a char
buffer, we can try to reuse its stat info and save one stat call here.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Sep 11 23:52:17 CEST 2016 on sn-devel-144

7 years agos3/smbd: in call_trans2qfilepathinfo call lstat when dealing with posix pathnames
Ralph Boehme [Sun, 11 Sep 2016 13:35:37 +0000 (15:35 +0200)]
s3/smbd: in call_trans2qfilepathinfo call lstat when dealing with posix pathnames

This might be an info level SMB_INFO_QUERY_ALL_EAS which is not covered
by INFO_LEVEL_IS_UNIX(). If smb_fname is a symlink we would then stat it
in POSIX context.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-registry: create winprint print processor entry for x64 as well.
Günther Deschner [Sat, 10 Sep 2016 09:07:54 +0000 (11:07 +0200)]
s3-registry: create winprint print processor entry for x64 as well.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibgpo: accept more boolean matches in gp_inifile_getbool().
Günther Deschner [Thu, 8 Sep 2016 19:28:22 +0000 (21:28 +0200)]
libgpo: accept more boolean matches in gp_inifile_getbool().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-rpc_client: make it more clear printer driver version is a QWORD not a DWORD.
Günther Deschner [Thu, 8 Sep 2016 19:22:17 +0000 (21:22 +0200)]
s3-rpc_client: make it more clear printer driver version is a QWORD not a DWORD.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: also test NULL servername in spoolss_GetPrinterDriverPackagePath
Günther Deschner [Thu, 8 Sep 2016 19:09:42 +0000 (21:09 +0200)]
s4-torture: also test NULL servername in spoolss_GetPrinterDriverPackagePath

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-spoolss: avoid referencing p->opnum in _spoolss_AddPrinterDriverEx
Günther Deschner [Thu, 8 Sep 2016 19:06:41 +0000 (21:06 +0200)]
s3-spoolss: avoid referencing p->opnum in _spoolss_AddPrinterDriverEx

When called by another protocol, this call would fail when called with an
unexpected opnum... This change is in preparation for supporting MS-PAR.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-rpcclient: add getdriverpackagepath command.
Günther Deschner [Thu, 8 Sep 2016 18:57:05 +0000 (20:57 +0200)]
s3-rpcclient: add getdriverpackagepath command.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-waf: give rpcclient its own wscript_build.
Günther Deschner [Thu, 10 Jan 2013 12:53:56 +0000 (13:53 +0100)]
s3-waf: give rpcclient its own wscript_build.

Guenther
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: use torture_comment in torture_rpc_connection()
Günther Deschner [Fri, 2 Sep 2016 10:44:34 +0000 (12:44 +0200)]
s4-torture: use torture_comment in torture_rpc_connection()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-spoolss: add missing newline in debug message of _spoolss_OpenPrinterEx.
Günther Deschner [Thu, 25 Aug 2016 15:10:09 +0000 (17:10 +0200)]
s3-spoolss: add missing newline in debug message of _spoolss_OpenPrinterEx.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for spoolss_LogJobInfoForBranchOffice
Günther Deschner [Tue, 6 Sep 2016 10:11:26 +0000 (12:11 +0200)]
s4-torture: add test for spoolss_LogJobInfoForBranchOffice

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agospoolss: add IDL for spoolss_LogJobInfoForBranchOffice.
Günther Deschner [Tue, 23 Aug 2016 10:28:53 +0000 (12:28 +0200)]
spoolss: add IDL for spoolss_LogJobInfoForBranchOffice.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agopidl: in s3 server templates, support default HRESULT error returns.
Günther Deschner [Mon, 7 Apr 2014 13:47:43 +0000 (15:47 +0200)]
pidl: in s3 server templates, support default HRESULT error returns.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-kdc: Move kpasswd_make_pwchange_reply() to a helper file
Andreas Schneider [Wed, 7 Sep 2016 12:57:59 +0000 (14:57 +0200)]
s4-kdc: Move kpasswd_make_pwchange_reply() to a helper file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Sep 11 06:45:00 CEST 2016 on sn-devel-144

7 years agos4-kdc: Move kpasswd_make_error_reply() to a helper file
Andreas Schneider [Wed, 7 Sep 2016 12:47:31 +0000 (14:47 +0200)]
s4-kdc: Move kpasswd_make_error_reply() to a helper file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agokrb5_wrap: Fix smb_krb5_mk_error() with MIT Kerberos
Andreas Schneider [Fri, 2 Sep 2016 09:54:48 +0000 (11:54 +0200)]
krb5_wrap: Fix smb_krb5_mk_error() with MIT Kerberos

The server principal is required, so if not set create an obscure one.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotestprogs: Test only what the Heimdal kpasswd test should test
Andreas Schneider [Tue, 6 Sep 2016 07:31:41 +0000 (09:31 +0200)]
testprogs: Test only what the Heimdal kpasswd test should test

The test_password_settings.sh test does test using different password
settings and is not specific to the kpasswd implementation. This
test tests the kpasswd service.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotestprogs: Make test_passwords.sh a Heimdal kpasswd test
Andreas Schneider [Mon, 5 Sep 2016 13:18:07 +0000 (15:18 +0200)]
testprogs: Make test_passwords.sh a Heimdal kpasswd test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotestprogs: Add a new test_password_settings.sh script
Andreas Schneider [Tue, 6 Sep 2016 06:55:43 +0000 (08:55 +0200)]
testprogs: Add a new test_password_settings.sh script

This test is not Kerberos implementation specific.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotestprogs: Add a common test_smbclient_expect_failure() function
Andreas Schneider [Tue, 6 Sep 2016 06:56:47 +0000 (08:56 +0200)]
testprogs: Add a common test_smbclient_expect_failure() function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoheimdal: Fix reauthentication after password change
Andreas Schneider [Wed, 7 Sep 2016 15:17:08 +0000 (17:17 +0200)]
heimdal: Fix reauthentication after password change

If the KDC requires a password change kinit will ask after the initial
authentication for a new password. After the password has been changed
it does reauthentication and for that it needs to use the new password
we just set.

It is needed for the a new kpasswd service test.

This is already fixed upstream with:
    911c99375741281adae305f6ec3a3317023eba3e

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agowinbindd: Remove unused enum ent_type
Christof Schmitt [Thu, 8 Sep 2016 18:00:46 +0000 (11:00 -0700)]
winbindd: Remove unused enum ent_type

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Sep 10 18:41:26 CEST 2016 on sn-devel-144

7 years agosmbd: Adjust debug level of "No protocol supported" message
Christof Schmitt [Thu, 8 Sep 2016 21:16:18 +0000 (14:16 -0700)]
smbd: Adjust debug level of "No protocol supported" message

SMB clients only supporting SMB1 connecting to a Samba server that only
accepts SMB protocol versions 2 and 3 can spam the logs with the "No
protocol supported" message. This is useful information for debugging
failed connection attempts, but it should not be in the default log.
Adjust it to NOTICE/3.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agoauth: One const is enough...
Volker Lendecke [Fri, 9 Sep 2016 14:31:55 +0000 (16:31 +0200)]
auth: One const is enough...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Sep  9 20:33:10 CEST 2016 on sn-devel-144

7 years agolib: Avoid a few casts
Volker Lendecke [Mon, 25 Jul 2016 15:05:37 +0000 (17:05 +0200)]
lib: Avoid a few casts

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep  9 15:55:50 CEST 2016 on sn-devel-144

7 years agonotifyd: Don't trust remote pointers
Volker Lendecke [Thu, 8 Sep 2016 13:18:39 +0000 (15:18 +0200)]
notifyd: Don't trust remote pointers

Not a security hole IMO: Only root can send us messages, that's at least our
assumption.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agonotifyd: Trim down the noncluster case
Volker Lendecke [Thu, 8 Sep 2016 13:23:59 +0000 (15:23 +0200)]
notifyd: Trim down the noncluster case

Without a cluster, notifyd does not have to receive databases

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agonotifyd: Avoid "includes.h"
Volker Lendecke [Thu, 8 Sep 2016 09:44:36 +0000 (11:44 +0200)]
notifyd: Avoid "includes.h"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agonotifyd: Fix bad comment wording
Volker Lendecke [Thu, 8 Sep 2016 09:44:23 +0000 (11:44 +0200)]
notifyd: Fix bad comment wording

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agogensec_krb5: Do not leak memory of target_principal
Andreas Schneider [Tue, 6 Sep 2016 10:09:47 +0000 (12:09 +0200)]
gensec_krb5: Do not leak memory of target_principal

CID 1372504

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep  9 04:20:04 CEST 2016 on sn-devel-144

7 years agoRevert "krb5_wrap: Add MIT implmentation of smb_krb5_keyblock_init_contents()"
Andreas Schneider [Fri, 2 Sep 2016 08:53:41 +0000 (10:53 +0200)]
Revert "krb5_wrap: Add MIT implmentation of smb_krb5_keyblock_init_contents()"

This reverts commit c0e861666911d84f2d78cdab370077d9ac192005.

The krb5_init_keyblock function from MIT allocates the key but we
operate only on the contents.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agodsdb: Do not use free'd memory.
Andreas Schneider [Tue, 6 Sep 2016 09:08:04 +0000 (11:08 +0200)]
dsdb: Do not use free'd memory.

The msg has already been free'd at this point so we need to print the
user_dn which gets assigned to msg->dn.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoutil: Fix the documentation of push_utf8_talloc()
Andreas Schneider [Wed, 7 Sep 2016 13:15:00 +0000 (15:15 +0200)]
util: Fix the documentation of push_utf8_talloc()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agodbcheck: assert uSNChanged values in release-4-5-0-pre1
Garming Sam [Thu, 8 Sep 2016 04:34:51 +0000 (16:34 +1200)]
dbcheck: assert uSNChanged values in release-4-5-0-pre1

This shows that dbcheck doesn't change the replPropertyMetadata when
fixing the links on these objects.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Sep  8 14:39:19 CEST 2016 on sn-devel-144

7 years agotests: Skip a test for reveal internals for passing Windows
Garming Sam [Thu, 8 Sep 2016 03:45:56 +0000 (15:45 +1200)]
tests: Skip a test for reveal internals for passing Windows

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests: Check that USN bumps when modifying a linked attr
Garming Sam [Thu, 8 Sep 2016 05:04:29 +0000 (17:04 +1200)]
tests: Check that USN bumps when modifying a linked attr

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agodbcheck: Make it clearer about temporary output
Garming Sam [Thu, 8 Sep 2016 03:29:35 +0000 (15:29 +1200)]
dbcheck: Make it clearer about temporary output

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotombstone-expunge: Assert than an expunge does not bump the USN
Garming Sam [Thu, 8 Sep 2016 03:27:42 +0000 (15:27 +1200)]
tombstone-expunge: Assert than an expunge does not bump the USN

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests: Assert vanishing links doesn't bump USN
Garming Sam [Thu, 8 Sep 2016 02:40:08 +0000 (14:40 +1200)]
tests: Assert vanishing links doesn't bump USN

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Skip bump of USN when vanishing forward links
Garming Sam [Thu, 8 Sep 2016 02:40:40 +0000 (14:40 +1200)]
rpmd: Skip bump of USN when vanishing forward links

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Add a TODO regarding the additional work performed
Garming Sam [Thu, 8 Sep 2016 02:46:06 +0000 (14:46 +1200)]
rpmd: Add a TODO regarding the additional work performed

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Remove the seq_num check for skipping additional work
Garming Sam [Thu, 8 Sep 2016 02:42:01 +0000 (14:42 +1200)]
rpmd: Remove the seq_num check for skipping additional work

We will need this in a later patch.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Add the ldb error string to a debug
Garming Sam [Thu, 8 Sep 2016 02:46:38 +0000 (14:46 +1200)]
rpmd: Add the ldb error string to a debug

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotorture: Remove unnecessary whitespace
Garming Sam [Thu, 8 Sep 2016 01:33:11 +0000 (13:33 +1200)]
torture: Remove unnecessary whitespace

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agoctdb-scripts: Optimise tickle_tcp_connections()
Martin Schwenke [Tue, 8 Sep 2015 01:29:25 +0000 (11:29 +1000)]
ctdb-scripts: Optimise tickle_tcp_connections()

Pipe the connections to "ctdb tickle" on stdin to avoid having to fork
so many "ctdb tickle" processes.  This maintains the current level of
verbosity at the price of some extra memory usage.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Sep  8 10:45:42 CEST 2016 on sn-devel-144

7 years agoctdb-scripts: Optimise update_tickles()
Martin Schwenke [Mon, 23 Mar 2015 08:37:35 +0000 (19:37 +1100)]
ctdb-scripts: Optimise update_tickles()

Use addtickle and deltickle with stdin.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Allow "addtickle" and "deltickle" stubs to read from stdin
Martin Schwenke [Mon, 7 Sep 2015 07:24:26 +0000 (17:24 +1000)]
ctdb-tests: Allow "addtickle" and "deltickle" stubs to read from stdin

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: CID 1125635 Dereference null return value (NULL_RETURNS)
Martin Schwenke [Fri, 2 Sep 2016 03:23:36 +0000 (13:23 +1000)]
ctdb-tests: CID 1125635 Dereference null return value (NULL_RETURNS)

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: CID 1125617 String not null terminated (STRING_NULL)
Martin Schwenke [Fri, 2 Sep 2016 01:56:02 +0000 (11:56 +1000)]
ctdb-tools: CID 1125617 String not null terminated (STRING_NULL)

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Compare interface pointers instead of using strcmp(3)
Martin Schwenke [Thu, 25 Aug 2016 01:48:36 +0000 (11:48 +1000)]
ctdb-daemon: Compare interface pointers instead of using strcmp(3)

If the interfaces have different names then they are different
interfaces.

Also, move assignment of new_name just above where is is first used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Use ctdb_find_iface() instead of duplicating logic
Martin Schwenke [Thu, 25 Aug 2016 01:41:11 +0000 (11:41 +1000)]
ctdb-daemon: Use ctdb_find_iface() instead of duplicating logic

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-deamon: Rename vnn_has_interface_with_name() to vnn_has_interface()
Martin Schwenke [Wed, 24 Aug 2016 10:41:49 +0000 (20:41 +1000)]
ctdb-deamon: Rename vnn_has_interface_with_name() to vnn_has_interface()

Now takes a pointer to an interface structure and does direct pointer
comparisons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Drop redundant uses of ctdb_find_iface()
Martin Schwenke [Wed, 24 Aug 2016 10:38:03 +0000 (20:38 +1000)]
ctdb-daemon: Drop redundant uses of ctdb_find_iface()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Make vnn->iface a list of new struct vnn_interface
Martin Schwenke [Wed, 24 Aug 2016 08:21:51 +0000 (18:21 +1000)]
ctdb-daemon: Make vnn->iface a list of new struct vnn_interface

To keep this change small, this leaves behind some redundant calls to
ctdb_find_iface() and similar.  They will be cleaned up later.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Change ctdb_add_local_iface() to return struct ctdb_interface
Martin Schwenke [Wed, 24 Aug 2016 06:59:46 +0000 (16:59 +1000)]
ctdb-daemon: Change ctdb_add_local_iface() to return struct ctdb_interface

This will allow a change to the way interfaces are handled in a VNN.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Move interface addition into interface parsing
Martin Schwenke [Wed, 24 Aug 2016 06:55:15 +0000 (16:55 +1000)]
ctdb-daemon: Move interface addition into interface parsing

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>