dmulder/samba-autobuild/.git
9 years agoVERSION: Disable git snapshots for the 4.1.13 release. samba-4.1.13
Karolin Seeger [Sun, 19 Oct 2014 19:41:57 +0000 (21:41 +0200)]
VERSION: Disable git snapshots for the 4.1.13 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.1.13.
Karolin Seeger [Sun, 19 Oct 2014 19:40:14 +0000 (21:40 +0200)]
WHATSNEW: Add release notes for Samba 4.1.13.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agos3: nmbd: Ensure the main nmbd process doesn't create zombies.
Jeremy Allison [Tue, 23 Sep 2014 20:32:37 +0000 (13:32 -0700)]
s3: nmbd: Ensure the main nmbd process doesn't create zombies.

Use the same mechanism as setup for smbd and winbindd.

Fixes bug #10830 - nmbd can leave unreaped zombies.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Sun Oct 19 23:19:38 CEST 2014 on sn-devel-104

9 years agopthreadpool: Slightly serialize jobs
Jeremy Allison [Mon, 25 Aug 2014 19:27:54 +0000 (12:27 -0700)]
pthreadpool: Slightly serialize jobs

Using the new msg_source program with 1.500 instances against a single
msg_sink I found the msg_source process to spawn two worker threads for
synchronously sending the data towards the receiving socket. This should
not happen: Per destination node we only create one queue. We strictly
only add pthreadpool jobs one after the other, so a single helper thread
should be perfectly sufficient.

It turned out that under heavy overload the main sending thread was
scheduled before the thread that just had finished its send() job. So
the helper thread was not able to increment the pool->num_idle variable
indicating that we don't have to create a new thread when the new job
is added.

This patch moves the signalling write under the mutex. This means that
indicating readiness via the pipe and the pool->num_idle variable happen both
under the same mutex lock and thus are atomic. No superfluous threads anymore.

Back port of commit 1c4284c7395f23cefa61a407db74cf5067aee2aa
that went into master.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3: lib: Signal handling - ensure smbrun and change password code save and restore...
Jeremy Allison [Tue, 23 Sep 2014 21:51:18 +0000 (14:51 -0700)]
s3: lib: Signal handling - ensure smbrun and change password code save and restore existing SIGCHLD handlers.

Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agolib: util: Signal handling - change CatchChild() and CatchChildLeaveStatus() to retur...
Jeremy Allison [Thu, 9 Oct 2014 20:41:05 +0000 (13:41 -0700)]
lib: util: Signal handling - change CatchChild() and CatchChildLeaveStatus() to return the previous handler.

Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agos3: smb2cli: query info return length check was reversed.
Jeremy Allison [Wed, 1 Oct 2014 21:20:10 +0000 (14:20 -0700)]
s3: smb2cli: query info return length check was reversed.

Make it identical to the check in libcli/smb/smb2cli_ioctl.c

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct  2 04:42:26 CEST 2014 on sn-devel-104

(cherry picked from commit 6c05cd3e895831be7d9a68a51de2048d04c188a0)

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Thu Oct  9 23:43:36 CEST 2014 on sn-devel-104

9 years agos3-libads: Add all machine account principals to the keytab.
Andreas Schneider [Wed, 24 Sep 2014 08:51:33 +0000 (10:51 +0200)]
s3-libads: Add all machine account principals to the keytab.

This adds all SPNs defined in the DC for the computer account to the
keytab using 'net ads keytab create -P'.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 5d58b92f8fcbc509f4fe2bd3617bcaeada1806b6)

9 years agoregistry: Don't leave dangling transactions
Volker Lendecke [Wed, 8 Oct 2014 13:39:28 +0000 (15:39 +0200)]
registry: Don't leave dangling transactions

When a createkey fails due to access denied, we need to do a
transaction_cancel. Otherwise the lock on the db will stay around.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10860

9 years agos3-winbindd: Do not use domain SID from LookupSids for Sids2UnixIDs call
Christof Schmitt [Thu, 11 Sep 2014 23:39:21 +0000 (16:39 -0700)]
s3-winbindd: Do not use domain SID from LookupSids for Sids2UnixIDs call

Create a new lsa_RefDomainList and populate it with the domain SID from
the original query. That avoids the problem that for migrated objects,
LookupSids returns the SID of the new domain, and combining that with
the RID from the input results in an invalid SID.

A better fix would be querying the RID of the user in the new domain,
but the approach here at least avoids id mappings entries for invalid
SIDs.

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): Mon Sep 29 13:15:18 CEST 2014 on sn-devel-104

(cherry picked from commit 9c9216410faf707edc4ba05f2b715d45f7f51ca4)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10838
Invalid id mappings for users/groups migrated from another domain

9 years agos3: Move init_lsa_ref_domain_list to lib
Christof Schmitt [Thu, 11 Sep 2014 23:11:06 +0000 (16:11 -0700)]
s3: Move init_lsa_ref_domain_list to lib

This will be used in the next patch in winbind.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 16594e7fc0a46249a48d0d0635de0c1050ecd340)

9 years agoidmap_rfc2307: Fix a crash after connection problem to DC
Christof Schmitt [Wed, 17 Sep 2014 20:23:11 +0000 (13:23 -0700)]
idmap_rfc2307: Fix a crash after connection problem to DC

When the connection to the DC has a problem, the code behind
ads_do_search_retry closes the current connection and opens a new one.
The new connection has a new struct LDAP to represent the connection. In
this case, the LDAP pointer in the idmap_rfc2307_context becomes
invalid.

Fix this problem by updating the local pointer after calling
ads_do_search_retry.

Signed-off-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10837
winbind crash in idmap_rfc2307 module

9 years agos3-libnet: Make sure we do not overwrite precreated SPNs.
Günther Deschner [Fri, 26 Sep 2014 01:35:43 +0000 (03:35 +0200)]
s3-libnet: Make sure we do not overwrite precreated SPNs.

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

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 Sep 26 08:22:45 CEST 2014 on sn-devel-104

(cherry picked from commit 0aacbe78bb40d76b65087c2a197c92b0101e625e)

9 years agos3-libnet: Add libnet_join_get_machine_spns().
Andreas Schneider [Fri, 26 Sep 2014 01:09:08 +0000 (03:09 +0200)]
s3-libnet: Add libnet_join_get_machine_spns().

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 7e0b8fcce5572c88d50993a1dbd90f65638ba90f)

9 years agos3-libads: Add function to search for an element in an array.
Andreas Schneider [Wed, 24 Sep 2014 07:23:58 +0000 (09:23 +0200)]
s3-libads: Add function to search for an element in an array.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit e1ee4c8bc7018db7787dd9a0be6d3aa40a477ee2)

9 years agos3-libads: Add a function to retrieve the SPNs of a computer account.
Andreas Schneider [Wed, 24 Sep 2014 07:22:03 +0000 (09:22 +0200)]
s3-libads: Add a function to retrieve the SPNs of a computer account.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 4eaa4ccbdf279f1ff6d8218b36d92aeea0114cd8)

9 years agos3-libads: Improve service principle guessing.
Andreas Schneider [Tue, 23 Sep 2014 12:09:41 +0000 (14:09 +0200)]
s3-libads: Improve service principle guessing.

If the name passed to the net command with the -S options is the long
hostname of the domaincontroller and not the 15 char NetBIOS name we
should construct a FQDN with the realm to get a Kerberos ticket.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 83c62bd3f5945bbe295cbfbd153736d4c709b3a6)

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Tue Sep 30 22:52:34 CEST 2014 on sn-devel-104

9 years agosmbd: We now survive smb2.oplock.stream1
Volker Lendecke [Mon, 29 Sep 2014 08:14:57 +0000 (08:14 +0000)]
smbd: We now survive smb2.oplock.stream1

Signed-off-by: Volker Lendecke <vl@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10797

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Mon Sep 29 23:16:34 CEST 2014 on sn-devel-104

9 years agos3: smbd: streams - Ensure share mode validation ignores internal opens (op_mid ...
Volker Lendecke [Tue, 9 Sep 2014 10:53:52 +0000 (10:53 +0000)]
s3: smbd: streams - Ensure share mode validation ignores internal opens (op_mid == 0).

Fixes bug 10797 - smbd panic at find_oplock_types

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonsswitch: Skip groups we were not able to map.
Andreas Schneider [Fri, 19 Sep 2014 11:33:10 +0000 (13:33 +0200)]
nsswitch: Skip groups we were not able to map.

If we have configured the idmap_ad backend it is possible that the user
is in a group without a gid set. This will result in (uid_t)-1 as the
gid. We return this invalid gid to NSS which is wrong.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Sep 19 17:57:14 CEST 2014 on sn-devel-104

(cherry picked from commit 7f59711f076e98ece099f6b38ff6da8c80fa6d5e)
Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Sat Sep 27 23:12:49 CEST 2014 on sn-devel-104

9 years agos3: smbd - open logic fix.
Jeremy Allison [Thu, 11 Sep 2014 17:03:01 +0000 (10:03 -0700)]
s3: smbd - open logic fix.

As we atomically create using O_CREAT|O_EXCL,
then if new_file_created is true, then
file_existed *MUST* have been false (even
if the file was previously detected as being
there.

We use the variable file_existed again in logic
below this statement, so we must set file_existed = false,
if new_file_created returns are true from open_file().

Based on a fix from Michael Adam.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Sep 11 22:29:22 CEST 2014 on sn-devel-104

(cherry picked from commit 518247bf80372eb003cb67036b9d9e7fe8aac303)

9 years agos3:smbd:open_file: use a more natural check.
Michael Adam [Wed, 10 Sep 2014 19:58:04 +0000 (21:58 +0200)]
s3:smbd:open_file: use a more natural check.

As suggested by Jeremy Allison <jra@samba.org>.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9da09b52e8cc0453e694d85fc2bd82994138e20b)

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

9 years agos3:smbd: fix a race in open code
Michael Adam [Tue, 9 Sep 2014 22:31:25 +0000 (00:31 +0200)]
s3:smbd: fix a race in open code

The race is when a file vanishes between
existence check and acl check.

In this case, open_file_ncreate() returns
OBJECT_NAME_NOT_FOUND even if the create
was called with disposition OPEN_IF.
But in this case, the file should be created.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8ae8c63da19459fd4f1166e11406da2c919b7ed0)

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

9 years agos3: winbindd: Old NT Domain code sets struct winbind_domain->alt_name to be NULL...
Jeremy Allison [Wed, 16 Jul 2014 19:41:55 +0000 (12:41 -0700)]
s3: winbindd: Old NT Domain code sets struct winbind_domain->alt_name to be NULL. Ensure this is safe with modern AD-DCs.

There are places in the code where we're not checking that alt_name is NULL
and then calling into the DC lookup code with a NULL name request. This can
happen in offline mode.

Fixes bug #10717 - Winbind crash on losing VPN connection

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Sep 15 23:29:00 CEST 2014 on sn-devel-104

(cherry picked from commit 92da0b243c18546275c4736507188eba425a0732)

9 years agos3-winbindd: Use correct realm for trusted domains in idmap child
Christof Schmitt [Fri, 22 Aug 2014 16:15:59 +0000 (09:15 -0700)]
s3-winbindd: Use correct realm for trusted domains in idmap child

When authenticating users in a trusted domain, the idmap_ad module
always connects to a local DC instead of one in the trusted domain.

Fix this by passing the correct realm to connect to.

Also Comment parameters passed to ads_cached_connection_connect

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c203c722e7e22f9146f2ecf6f42452c0e82042e4)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10826
Using SFU id mapping fails for users from a trusted domain

9 years agolibcli: Fix a segfault calling smbXcli_req_set_pending() on NULL.
Andreas Schneider [Wed, 17 Sep 2014 13:17:50 +0000 (15:17 +0200)]
libcli: Fix a segfault calling smbXcli_req_set_pending() on NULL.

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

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 23 04:23:05 CEST 2014 on sn-devel-104

(cherry picked from commit f92086f4a347dcc8fa948aa2614a2c12f1115e5a)
Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agomedia_harmony: Fix a crash bug
Volker Lendecke [Thu, 11 Sep 2014 11:33:42 +0000 (11:33 +0000)]
media_harmony: Fix a crash bug

Now that the dust has settled, fix a crash bug that was hidden behind
the warnings...

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep 12 02:45:40 CEST 2014 on sn-devel-104

9 years agodocs: mention incompatibility between kernel oplocks and streams_xattr
Björn Jacke [Tue, 9 Sep 2014 20:35:08 +0000 (22:35 +0200)]
docs: mention incompatibility between kernel oplocks and streams_xattr

See BUG https://bugzilla.samba.org/show_bug.cgi?id=7537 for details.

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Sep 12 18:29:37 CEST 2014 on sn-devel-104

(cherry picked from commit 27b2ddcddea5c32a84016b5c6843eb37d2798adf)

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

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Fri Sep 26 23:11:03 CEST 2014 on sn-devel-104

9 years agonmbd: Send waiting status to systemd.
Andreas Schneider [Tue, 16 Sep 2014 16:03:51 +0000 (18:03 +0200)]
nmbd: Send waiting status to systemd.

This tells the Administrator what's going on and we should log that IPv6
is not supported.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Sep 17 13:16:43 CEST 2014 on sn-devel-104

(cherry picked from commit 2df601bff0d949e66c79366b8248b9d950c0b430)

9 years agolib: Add daemon_status() to util library.
Andreas Schneider [Tue, 16 Sep 2014 16:02:30 +0000 (18:02 +0200)]
lib: Add daemon_status() to util library.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 9f5f5fa8ebf845c53b7a92557d7aec56ed820320)

9 years agoselftest: Fix selftest where pid is used uninitialized.
Andreas Schneider [Thu, 4 Sep 2014 10:55:53 +0000 (12:55 +0200)]
selftest: Fix selftest where pid is used uninitialized.

On my system this gets evaluated to 0 so in the end we detect samba to
be running cause $childpid is set to 0.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep  4 17:09:17 CEST 2014 on sn-devel-104

(cherry picked from commit 6d2f56dbaf84203b351f33179cc3feaf557e0683)
Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Mon Sep  8 23:19:29 CEST 2014 on sn-devel-104

9 years agoMerge tag 'samba-4.1.12' into v4-1-test
Stefan Metzmacher [Mon, 8 Sep 2014 10:17:04 +0000 (12:17 +0200)]
Merge tag 'samba-4.1.12' into v4-1-test

samba: tag release samba-4.1.12

9 years agoMerge tag 'samba-4.1.11' into v4-1-test samba-4.1.12
Karolin Seeger [Mon, 8 Sep 2014 09:08:02 +0000 (11:08 +0200)]
Merge tag 'samba-4.1.11' into v4-1-test

samba: tag release samba-4.1.11

This commit is actually the samba-4.1.12 release!

It was just forgotten to merge the samba-4.1.11 tag (security release)
into v4-1-test. This commit is required to bring the git history
between v4-1-test and v4-1-stable in sync again.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agoVERSION: Bump version up to 4.1.13...
Karolin Seeger [Mon, 8 Sep 2014 08:19:16 +0000 (10:19 +0200)]
VERSION: Bump version up to 4.1.13...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.1.12.
Karolin Seeger [Mon, 8 Sep 2014 08:14:43 +0000 (10:14 +0200)]
WHATSNEW: Add release notes for Samba 4.1.12.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agos3: smbd: vfs_dirsort module.
Jeremy Allison [Wed, 3 Sep 2014 14:54:51 +0000 (07:54 -0700)]
s3: smbd: vfs_dirsort module.

Fix an off-by-one check that would cause seekdir to
seek off the end of the cached array.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg.gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep  3 19:59:54 CEST 2014 on sn-devel-104

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10794
vfs_dirsort has an off-by-one error that can cause uninitialized memory read

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Mon Sep  8 10:00:32 CEST 2014 on sn-devel-104

9 years agos4-rpc: dnsserver: handle updates of tombstoned dnsNode objects
Stefan Metzmacher [Thu, 4 Sep 2014 05:19:46 +0000 (07:19 +0200)]
s4-rpc: dnsserver: handle updates of tombstoned dnsNode objects

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 2c342e488dcd3cef465a1b376bb22bf495f6832b)

9 years agos4-rpc: dnsserver: Do not search for deleted DNS entries
Amitay Isaacs [Thu, 31 Jul 2014 07:24:52 +0000 (17:24 +1000)]
s4-rpc: dnsserver: Do not search for deleted DNS entries

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 6f2862e76608862bb4142a86f36c8506114bf6c7)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before add/modify
Stefan Metzmacher [Thu, 31 Jul 2014 07:30:16 +0000 (09:30 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before add/modify

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Aug 27 15:21:19 CEST 2014 on sn-devel-104

(cherry picked from commit d68a2ebecd244181b1238635ee54dadd05835525)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before removing records
Stefan Metzmacher [Wed, 30 Jul 2014 18:12:08 +0000 (20:12 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before removing records

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 11bbfd932c113b3222bc93d59702271a3777b6f3)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_replace()
Stefan Metzmacher [Wed, 30 Jul 2014 16:51:39 +0000 (18:51 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_replace()

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

Change-Id: I2fd2503230cbf89445594e49f39ac321769ff06e
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fd952bf814835c4860ab10794225fbd583ee3ad5)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_extract()
Stefan Metzmacher [Wed, 30 Jul 2014 15:59:08 +0000 (17:59 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_extract()

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

Change-Id: I7c661964a3da1a1981f022a06b9bef25bbd33479
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit dedcf30fd12821c272002e3b4cbfda4ca38650fd)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_lookup() for name lookup
Stefan Metzmacher [Wed, 30 Jul 2014 06:40:32 +0000 (08:40 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() for name lookup

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

Change-Id: I2632fa0ce120a978f6f400fa5cbf18a7fbbd64a3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 96dcebe8c20b9aa954a96a4deabe16957576be2c)

9 years agotorture-dns: Add test for dlz_bind9 updates
Stefan Metzmacher [Tue, 26 Aug 2014 10:04:59 +0000 (12:04 +0200)]
torture-dns: Add test for dlz_bind9 updates

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 914a3667471ced3199f51db8bc1d4a6d3fbc4e8f)

9 years agotorture-dns: Add test for dlz_bind9 zonedumps
Stefan Metzmacher [Tue, 26 Aug 2014 08:34:17 +0000 (10:34 +0200)]
torture-dns: Add test for dlz_bind9 zonedumps

Change-Id: I074b3e4cdad1a0b69c085dcaa44d6f48e68e863b
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e23621e9dab67c8997d24b2ac7e4fd181fc5907c)

9 years agotorture-dns: Add test for dlz_bind9 lookups
Andrew Bartlett [Mon, 25 Aug 2014 22:24:27 +0000 (10:24 +1200)]
torture-dns: Add test for dlz_bind9 lookups

Change-Id: I3b9d1b56e3aa873fb8540b98e196b713b82332ca
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2189470c2f55afe29e9e8dad1d2659a7eb2d06f9)

9 years agos4:torture:dlz_bind9: fix spnego tests
Stefan Metzmacher [Tue, 26 Aug 2014 11:48:21 +0000 (13:48 +0200)]
s4:torture:dlz_bind9: fix spnego tests

The dlz_bind9 module uses the special dns-${NETBIOSNAME} account,
and this is only available under the dns/hostname.domain SPN, not
host/hostname.

Also the dlz_ssumatch() function returns isc_boolean_t instead
of isc_result_t. As ISC_R_SUCCESS and ISC_FALSE have the same value
we didn't notice this problem.

Change-Id: I48539c3f48f5dde9eaa2fff6da0f3be2f9f66311
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 76943bf0ac259fb8855bd123fe4bc85a103ba418)

9 years agos4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()
Stefan Metzmacher [Wed, 30 Jul 2014 15:57:13 +0000 (17:57 +0200)]
s4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()

We don't have to keep everything arround while walking the whole zone.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5d397c8198bcd2cdccc3deda57377d4696e6abd1)

9 years agos4:dlz_bind9: avoid some compiler warnings
Stefan Metzmacher [Thu, 27 Feb 2014 08:59:51 +0000 (09:59 +0100)]
s4:dlz_bind9: avoid some compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fbebe7e756e4ccd0684e94e9b1e787f98f399ccc)

9 years agos4:dns_server: handle tombstones in handle_one_update()
Stefan Metzmacher [Thu, 31 Jul 2014 07:35:26 +0000 (09:35 +0200)]
s4:dns_server: handle tombstones in handle_one_update()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 491715399ff7e1ab788fec5e254581dc312e2cef)

9 years agos4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()
Stefan Metzmacher [Thu, 31 Jul 2014 08:44:41 +0000 (10:44 +0200)]
s4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()

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

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit bb3ca930cc57964487bd23a74f4caabd1616a8bf)

9 years agos4:dns_server: make sure dns_common_lookup() doesn't return tombstones
Stefan Metzmacher [Thu, 31 Jul 2014 06:54:17 +0000 (08:54 +0200)]
s4:dns_server: make sure dns_common_lookup() doesn't return tombstones

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a0a81ab01cb1d509b04f9af25177c8e0941b43aa)

9 years agos4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()
Stefan Metzmacher [Thu, 31 Jul 2014 07:32:00 +0000 (09:32 +0200)]
s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()

The result is the same, but it is clearer.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3ff025a02cca3ff209668edd419d0e440e9865c6)

9 years agos4:dns_server: split out dns_common_replace()
Stefan Metzmacher [Wed, 30 Jul 2014 16:27:56 +0000 (18:27 +0200)]
s4:dns_server: split out dns_common_replace()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 0689e795e073008d2ad539c0ef5ddbdc6d9efdac)

9 years agos4:dns_server: remove const from dns_replace_records()
Stefan Metzmacher [Thu, 31 Jul 2014 09:32:02 +0000 (11:32 +0200)]
s4:dns_server: remove const from dns_replace_records()

All callers are find we the record array gets modified.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7e7df78bd7ae5575da7443b45c0e2e4167eebde2)

9 years agos4:dns_server: split out dns_common_extract() and dns_common_lookup()
Stefan Metzmacher [Wed, 30 Jul 2014 06:24:10 +0000 (08:24 +0200)]
s4:dns_server: split out dns_common_extract() and dns_common_lookup()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 342a087349f8a10833338a3fa49fbd4d4d29f3e5)

9 years agos4:dns_server: split out a private 'dnsserver_common' library
Stefan Metzmacher [Wed, 30 Jul 2014 06:01:11 +0000 (08:01 +0200)]
s4:dns_server: split out a private 'dnsserver_common' library

This will contain common code for the internal dns server, the dlz_bind9 module
and the rpc dns management server.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 99d5a5ead4f33723c25e8716a79d34b53822521e)

9 years agos4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXIST
Stefan Metzmacher [Thu, 31 Jul 2014 06:19:50 +0000 (08:19 +0200)]
s4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXIST

This is the correct fix for commit 8b24c43b382740106474e26dec59e1419ba77306
and Bug: https://bugzilla.samba.org/show_bug.cgi?id=9559

With this change we have a consistent behavior between internal server
and the bind dlz module. We keep a dangling LDAP object without
dnsRecord attribute arround forever. This will be fixed in the following
commits.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d0f424a23dc915d9fce625438d2bd63519757cba)

9 years agos4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()
Stefan Metzmacher [Wed, 30 Jul 2014 15:55:57 +0000 (17:55 +0200)]
s4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit deb21a9afe77591743fda522355a5a9eb08fb27b)

9 years agoprovision: Correctly provision the SOA record minimum TTL
Kai Blin [Fri, 16 May 2014 16:33:42 +0000 (18:33 +0200)]
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

(cherry picked from commit 634f116fbb89d723a627f4501b4cd89342cecb8e)

9 years agos4-rpc: dnsserver: return DNS_RANK_NS_GLUE recors when explicitly asked for
Stefan Metzmacher [Thu, 4 Sep 2014 07:40:34 +0000 (09:40 +0200)]
s4-rpc: dnsserver: return DNS_RANK_NS_GLUE recors when explicitly asked for

NS records should be included in the query for sub-domains.  NS records
got dropped when the rank for NS records was correctly set to NS_GLUE
from ZONE in commit 2036cbd9249c84d9b46370f0e8cd6a0264c737ba.

  samba-tool dns query 172.31.9.161 s4xdom.base @ ALL
  =>
  Name=glue, Records=0, Children=0

  samba-tool dns query 172.31.9.161 s4xdom.base glue ALL
  =>
    Name=, Records=1, Children=0
      NS: glue.dns.private. (flags=40000082, serial=21, ttl=900)

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Sep  4 14:37:51 CEST 2014 on sn-devel-104

(cherry picked from commit 0b4a3b76111411e8969932a3da4ffab989e0da4c)

9 years agos4-rpc: dnsserver: Do not return NS_GLUE records with VIEW_GLUE_DATA filter
Amitay Isaacs [Wed, 30 Jul 2014 09:57:42 +0000 (19:57 +1000)]
s4-rpc: dnsserver: Do not return NS_GLUE records with VIEW_GLUE_DATA filter

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Aug 21 11:36:55 CEST 2014 on sn-devel-104

(cherry picked from commit c9169a5e987864473108d041513f1781740401ac)

9 years agos4-rpc: dnsserver: Correctly set rank for glue NS records
Amitay Isaacs [Wed, 30 Jul 2014 08:53:44 +0000 (18:53 +1000)]
s4-rpc: dnsserver: Correctly set rank for glue NS records

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2036cbd9249c84d9b46370f0e8cd6a0264c737ba)

9 years agos4:setup/dns_update_list: make use of the new substitution variables
Stefan Metzmacher [Mon, 28 Apr 2014 16:54:13 +0000 (18:54 +0200)]
s4:setup/dns_update_list: make use of the new substitution variables

This let us register the same names as Windows Servers.

We only exception are the NS records. In future we could add them
by using something like this:

  samba-tool dns add ${HOSTNAME} ${DNSDOMAIN} @ NS ${HOSTNAME}
  samba-tool dns add ${HOSTNAME} _msdcs.${DNSFOREST} @ NS ${HOSTNAME}
  samba-tool dns add ${HOSTNAME} ${DNSFOREST} _msdcs NS ${HOSTNAME}

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 26 11:38:54 CEST 2014 on sn-devel-104

(cherry picked from commit 4383ec5b83d12bd19749582217f082cbaa31a128)

9 years agos4:samba_dnsupdate: provide more substitution variables e.g. IF_RODC
Stefan Metzmacher [Mon, 28 Apr 2014 15:33:50 +0000 (17:33 +0200)]
s4:samba_dnsupdate: provide more substitution variables e.g. IF_RODC

This will make the dns_update_list more flexible.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f1544e8d1de995aa304d63352d313ace8fea6ca5)

9 years agos4:samba_dnsupdate: don't try to be smart when verifying NS records
Stefan Metzmacher [Mon, 7 Jul 2014 22:05:03 +0000 (00:05 +0200)]
s4:samba_dnsupdate: don't try to be smart when verifying NS records

We can't rely on the DNS delegation to be correct in the parent domain.
What we really want is to check if we already have registered ourself
as a NS record in our own domain.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit b13974048b74c60028d8387eb7fe4fc7734f0a91)

9 years agos4:samba_dnsupdate: cache the already registered records
Stefan Metzmacher [Mon, 28 Apr 2014 06:29:40 +0000 (08:29 +0200)]
s4:samba_dnsupdate: cache the already registered records

This way we can delete records which are not used anymore.

E.g. if the ip address changed.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 25ec8e8656f66fe51a0d48718cdcfd8b209f6ca0)

9 years agos4:samba_dnsupdate: fix dnsobj.__str__()
Stefan Metzmacher [Mon, 28 Apr 2014 06:27:26 +0000 (08:27 +0200)]
s4:samba_dnsupdate: fix dnsobj.__str__()

We should not implicitly use the global variable 'd'.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 6e853708def98545eeb6913b8a2dd59d439323e6)

9 years agos4:samba_dnsupdate: don't lower case the registered names
Stefan Metzmacher [Mon, 28 Apr 2014 15:26:51 +0000 (17:26 +0200)]
s4:samba_dnsupdate: don't lower case the registered names

This matches Windows...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c5088f338a38850674399ec8fec9f8f146b5880f)

9 years agopython/join: use lowercase for the dnshostname.
Stefan Metzmacher [Tue, 19 Aug 2014 08:33:11 +0000 (10:33 +0200)]
python/join: use lowercase for the dnshostname.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5533d9c3db31ac86769288527ec20ad4e57f703c)

9 years agoselftest/Samba3: also bind to ipv6
Stefan Metzmacher [Thu, 19 Jun 2014 15:21:16 +0000 (17:21 +0200)]
selftest/Samba3: also bind to ipv6

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit a9545f3de7aaa0346735191953f78242017bd346)

9 years agoselftest/Samba4: also bind to ipv6
Stefan Metzmacher [Thu, 19 Jun 2014 15:21:16 +0000 (17:21 +0200)]
selftest/Samba4: also bind to ipv6

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 5d4b36d1fec981e850d869edd2c98a6541b37114)

9 years agoselftest: export _IPV6 environment variables
Stefan Metzmacher [Thu, 19 Jun 2014 15:21:16 +0000 (17:21 +0200)]
selftest: export _IPV6 environment variables

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 0e7abb398dd826c082bbddb333b9faac361be064)

9 years agolibcli/dns: ignore NS entries in dns_hosts_file.c at a higher log level for now
Stefan Metzmacher [Thu, 10 Jul 2014 05:25:08 +0000 (07:25 +0200)]
libcli/dns: ignore NS entries in dns_hosts_file.c at a higher log level for now

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3fcc4a545e936c2c0cf3f9f9a19646e1512f74d2)

9 years agolibcli/dns: add AAAA support to dns_hosts_file.c
Stefan Metzmacher [Thu, 10 Jul 2014 05:25:08 +0000 (07:25 +0200)]
libcli/dns: add AAAA support to dns_hosts_file.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7f18a3b58e7146e421653b85f509bb8503bd7402)

9 years agos3: winbindd: On new client connect, prune idle or hung connections older than "winbi...
Jeremy Allison [Fri, 25 Jul 2014 19:46:46 +0000 (12:46 -0700)]
s3: winbindd: On new client connect, prune idle or hung connections older than "winbind request timeout"

Bug 3204 winbindd: Exceeding 200 client connections, no idle connection found

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 29 23:31:14 CEST 2014 on sn-devel-104

(cherry picked from commit f9588675ea3cb2f1fabd07a4ea8b2138d65aee83)

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Mon Sep  1 23:46:50 CEST 2014 on sn-devel-104

9 years agos3: winbindd: Add new parameter "winbind request timeout" set to 60 seconds with...
Jeremy Allison [Tue, 29 Jul 2014 21:53:11 +0000 (14:53 -0700)]
s3: winbindd: Add new parameter "winbind request timeout" set to 60 seconds with man page.

"This parameter specifies the number of seconds the winbindd
daemon will wait before disconnecting either a client connection
with no outstanding requests (idle) or a client connection with a
request that has remained outstanding (hung) for longer than this
number of seconds."

Bug 3204 winbindd: Exceeding 200 client connections, no idle connection found

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agodosmode: fix FSCTL_SET_SPARSE request validation
David Disseldorp [Wed, 27 Aug 2014 13:42:00 +0000 (15:42 +0200)]
dosmode: fix FSCTL_SET_SPARSE request validation

Check that FSCTL_SET_SPARSE requests does not refer to directories. Also
reject such requests when issued over IPC or printer share connections.

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

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 Aug 28 04:22:37 CEST 2014 on sn-devel-104

(cherry picked from commit 0751495b1327d002b79482632b7c590cae6e3f9d)

9 years agosmbd: Properly initialize mangle_hash
Volker Lendecke [Tue, 19 Aug 2014 14:32:15 +0000 (14:32 +0000)]
smbd: Properly initialize mangle_hash

[Bug 10782] mangle_hash() can fail to initialize charset (smbd crash).

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

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): Tue Aug 26 01:30:38 CEST 2014 on sn-devel-104

9 years agoDon't discard result of checking grouptype
Roel van Meer [Fri, 22 Aug 2014 13:11:04 +0000 (15:11 +0200)]
Don't discard result of checking grouptype

The pdb_samba_dsdb_getgrfilter() function first determines the security type
of a group and sets map->sid_name_use accordingly. A little later, this
variable is set again, undoing the previous work.

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

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 23 02:48:52 CEST 2014 on sn-devel-104

9 years agodocs: Fix typos in smb.conf (inherit acls)
Marc Muehlfeld [Wed, 6 Aug 2014 19:36:26 +0000 (21:36 +0200)]
docs: Fix typos in smb.conf (inherit acls)

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

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Aug  7 00:52:42 CEST 2014 on sn-devel-104

(cherry picked from commit 4639f6d7bab9d8d6ee46bf5c65ff73a17a56cb17)

9 years agosamba: Retain case sensitivity of cifs client
Shirish Pargaonkar [Sat, 26 Jul 2014 15:41:25 +0000 (10:41 -0500)]
samba: Retain case sensitivity of cifs client

When a client supports extended security but server does not,
and that client, in Flags2 field of smb header indicates that

- it supports extended security negotiation
- it does not support security signatures
- it does not require security signatures

Samba server treats a client as a Vista client.

That turns off case sensitivity and that is a problem for cifs vfs client.

So include remote cifs client along with remote samba client
to not do so otherwise.

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

Signed-off-by: Shirish Pargaonkar <spargaonkar@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Aug  1 16:11:43 CEST 2014 on sn-devel-104

(cherry picked from commit a0583976da2ba09da0fd94f739ed4f5851e2a858)

9 years agolib: strings: Simplify strcasecmp
Volker Lendecke [Tue, 5 Aug 2014 09:21:07 +0000 (09:21 +0000)]
lib: strings: Simplify strcasecmp

This makes us fallback to strcasecmp early if any INVALID_CODEPOINT
appears. Without this patch we just continue to compare if both strings
happen to have an INVALID_CODEPOINT in the same spot.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10716
smbd constantly crashes when filename contains non-ascii character

9 years agos4: tests: Added local.charset test for Bug 10716 - smbd constantly crashes when...
Jeremy Allison [Mon, 4 Aug 2014 20:36:42 +0000 (13:36 -0700)]
s4: tests: Added local.charset test for Bug 10716 - smbd constantly crashes when filename contains non-ascii character

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

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agolib: strings: Fix the behavior of strncasecmp_m_handle() in the face of bad conversions.
Jeremy Allison [Sat, 2 Aug 2014 04:38:59 +0000 (21:38 -0700)]
lib: strings: Fix the behavior of strncasecmp_m_handle() in the face of bad conversions.

When either string has a bad conversion, we fall back to
doing raw ascii byte comparisons using strcasecmp(). This
is wrong - we should fall back to strncasecmp.

The problem is we've already stepped past the character
that failed the conversion, so we're not re-testing those
characters for comparison. This can have the effect of
causing strncasecmp_m_handle() to report that two strings
are identical when they are not, if the failed conversion
takes place at the end of the string.

The correct behavior is to step back to the point of
the string(s) that failed the conversion, and continue
the test from there.

This is a litle trickier than the previous fix, as
it requires converting the incoming n variable from
remaining characters to compare to remaining bytes to
compare.

As bytes are always the smallest character size
(1 byte) then it's safe to convert the remaining
characters to check by decrementing the source string
by the last character length (in bytes) and incrementing
the remaining bytes to scan by the same value, then
calling strncasecmp() with the stepped back strings
remaining.

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agolib: strings: Fix the behavior of strcasecmp_m_handle() in the face of bad conversions.
Jeremy Allison [Sat, 2 Aug 2014 04:29:21 +0000 (21:29 -0700)]
lib: strings: Fix the behavior of strcasecmp_m_handle() in the face of bad conversions.

When either string has a bad conversion, we fall back to
doing raw ascii byte comparisons using strcasecmp().

The problem is we've already stepped past the character
that failed the conversion, so we're not re-testing those
characters for comparison. This can have the effect of
causing strcasecmp_m_handle() to report that two strings
are identical when they are not, if the failed conversion
takes place at the end of the string.

The correct behavior is to step back to the point of
the string(s) that failed the conversion, and continue
the test from there.

Found by <lev@zadarastorage.com> when investigating bug
10716 - smbd constantly crashes when filename contains non-ascii character.

Given the normal character set of utf-8, and an on
disk filename of ISO-8859-1 of file-é on disk hex
value: 66 69 6c 65 2d e9, an incoming open given the
correct utf8 name of file-é will collide when it
should not.

Fixes:

Bug 10716 - smbd constantly crashes when filename contains non-ascii character

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

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agoprinting: reload printer shares on OpenPrinter
David Disseldorp [Tue, 5 Aug 2014 15:33:33 +0000 (17:33 +0200)]
printing: reload printer shares on OpenPrinter

The printer share inventory should be reloaded on open _and_
enumeration, as there are some clients, such as cupsaddsmb, that do not
perform an enumeration prior to access.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Aug  8 16:33:50 CEST 2014 on sn-devel-104

(cherry picked from commit 1ad71f79eb473822d36d9629cf52c2fca4c53752)

9 years agosmbd: split printer reload processing
David Disseldorp [Fri, 1 Aug 2014 14:25:59 +0000 (16:25 +0200)]
smbd: split printer reload processing

All printer inventory updates are currently done via
delete_and_reload_printers(), which handles registry.tdb updates for
added or removed printers, AD printer unpublishing on removal, as well
as share service creation and deletion.

This change splits this functionality into two functions such that
per-client smbd processes do not perform registry.tdb updates or printer
unpublishing. This is now only performed by the process that performs
the printcap cache update.

This change is similar to ac6604868d1325dd4c872dc0f6ab056d10ebaecf from
the 3.6 branch.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 2706af4d78fc9a47a4ac45b373edf276e3a9b354)

9 years agoserver: remove duplicate snum_is_shared_printer()
David Disseldorp [Tue, 5 Aug 2014 16:45:24 +0000 (18:45 +0200)]
server: remove duplicate snum_is_shared_printer()

Only keep a single definition in server_reload.c

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 2685df1177ffd39b1af34eb116bd7b24d4b12974)

9 years agosmbd: only reprocess printer_list.tdb if it changed
David Disseldorp [Wed, 23 Jul 2014 12:42:00 +0000 (14:42 +0200)]
smbd: only reprocess printer_list.tdb if it changed

The per-client smbd printer share inventory is currently updated from
printer_list.tdb when a client enumerates printers, via EnumPrinters or
NetShareEnum.
printer_list.tdb is populated by the background print process, based on
the latest printcap values retrieved from the printing backend (e.g.
CUPS) at regular intervals.
This change ensures that per-client smbd processes don't reparse
printer_list.tdb if it hasn't been updated since the last enumeration.

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

Suggested-by: Volker Lendecke <vl@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit a2182e03a061de6c1f111ce083cb5f668fe75e4e)

9 years agoprinting: return last change time with pcap_cache_loaded()
David Disseldorp [Wed, 23 Jul 2014 10:12:34 +0000 (12:12 +0200)]
printing: return last change time with pcap_cache_loaded()

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 30ce835670a6aeca6fb960ea7c4fe1b982bdd5b0)

9 years agoprinting: remove pcap_cache_add()
David Disseldorp [Fri, 25 Jul 2014 10:18:54 +0000 (12:18 +0200)]
printing: remove pcap_cache_add()

All print list updates are now done via pcap_cache_replace(), which can
call into the print_list code directly.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 6d75e20ca8acf1a55838694ac77940e21e9a1e6a)

9 years agoprinting: reload printer_list.tdb from in memory list
David Disseldorp [Tue, 22 Jul 2014 18:17:38 +0000 (20:17 +0200)]
printing: reload printer_list.tdb from in memory list

This will allow in future for a single atomic printer_list.tdb update.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit e5e6e2c796f026ee6b04f99b327941d57b9bd026)

9 years agoprinting: only reload printer shares on client enum
David Disseldorp [Fri, 11 Jul 2014 15:00:05 +0000 (17:00 +0200)]
printing: only reload printer shares on client enum

Currently, automatic printer share updates are handled in the following
way:
- Background printer process (BPP) forked on startup
- Parent smbd and per-client children await MSG_PRINTER_PCAP messages
- BPP periodically polls the printing backend for printcap data
- printcap data written to printer_list.tdb
- MSG_PRINTER_PCAP sent to all smbd processes following update
- smbd processes all read the latest printer_list.tdb data, and update
  their share listings

This procedure is not scalable, as all smbd processes hit
printer_list.tdb in parallel, resulting in a large spike in CPU usage.

This change sees smbd processes only update their printer share lists
only when a client asks for this information, e.g. via NetShareEnum or
EnumPrinters.

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

Suggested-by: Volker Lendecke <vl@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 4f4501ac1f35ab15f25d207c0d33e7c4d1abdf38)

9 years agoprinting: traverse_read the printer list for share updates
David Disseldorp [Wed, 9 Jul 2014 22:18:10 +0000 (00:18 +0200)]
printing: traverse_read the printer list for share updates

The printcap update procedure involves the background printer process
obtaining the printcap information from the printing backend, writing
this to printer_list.tdb, and then notifying all smbd processes of the
new list. The processes then all attempt to simultaneously traverse
printer_list.tdb, in order to update their local share lists.

With a large number of printers, and a large number of per-client smbd
processes, this traversal results in significant lock contention, mostly
due to the fact that the traversal is unnecessarily done with an
exclusive (write) lock on the printer_list.tdb database.

This commit changes the share update code path to perform a read-only
traversal.

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

Reported-by: Alex K <korobkin+samba@gmail.com>
Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 1e83435eac2cef03fccb4cf69ef5e0bfbd710410)

9 years agos3: smbd : SMB2 - fix SMB2_SEARCH when searching non wildcard string with a case...
Jeremy Allison [Tue, 10 Jun 2014 22:58:15 +0000 (15:58 -0700)]
s3: smbd : SMB2 - fix SMB2_SEARCH when searching non wildcard string with a case-canonicalized share.

We need to go through filename_convert() in order for the filename
canonicalization to be done on a non-wildcard search string (as is
done in the SMB1 findfirst code path).

Fixes Bug #10650 - "case sensitive = True" option doesn't work with "max protocol = SMB2" or higher in large directories.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agos3: smbd - SMB[2|3]. Ensure a \ or / can't be found anywhere in a search path, not...
Jeremy Allison [Tue, 10 Jun 2014 21:41:45 +0000 (14:41 -0700)]
s3: smbd - SMB[2|3]. Ensure a \ or / can't be found anywhere in a search path, not just at the start.

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agos3: enforce a positive allocation_file_size for non-empty files (bug #10543)
Björn Baumbach [Thu, 27 Mar 2014 10:17:30 +0000 (11:17 +0100)]
s3: enforce a positive allocation_file_size for non-empty files (bug #10543)

Some file systems do not allocate a block for very
small files. But for non-empty file should report a
positive size.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Apr  5 03:09:00 CEST 2014 on sn-devel-104

(cherry picked from commit c35b31f45244a8339684c3b83a7d86eefb80e0da)

9 years agopassdb: fix NT_STATUS_NO_SUCH_GROUP
Arvid Requate [Thu, 17 Jan 2013 15:44:28 +0000 (16:44 +0100)]
passdb: fix NT_STATUS_NO_SUCH_GROUP

Share options like "force group" and "valid users = @group1"
triggered a NT_STATUS_NO_SUCH_GROUP. While the group was found in
the SAM backend, its objectclass was not retrived.

This fix also revealed a talloc access after free in the group
branch of pdb_samba_dsdb_getgrfilter.

[Bug 9570] Access failure for shares with "force group" or "valid users = @group"

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

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:libsmb: Set a max charge for SMB2 connections
Ross Lagerwall [Thu, 21 Aug 2014 06:32:36 +0000 (07:32 +0100)]
s3:libsmb: Set a max charge for SMB2 connections

Set a max charge for SMB2 connections so that larger request sizes can
be used and more requests can be in flight.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Aug 21 17:31:11 CEST 2014 on sn-devel-104

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10778
libsmbclient with SMB2 doesn't pipeline or use large blocks