metze/samba/wip.git
9 years agolibsmb: provide authinfo domain for DFS referral auth
David Disseldorp [Fri, 16 Jan 2015 15:21:23 +0000 (16:21 +0100)]
libsmb: provide authinfo domain for DFS referral auth

libsmbclient uses the smbc_init->smbc_get_auth_data_fn() provided
workgroup/domain in initial connections, but then switches to the
default smb.conf workgroup/domain when handling DFS referrals.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6c9de0cd056afc0b478c02f1bdb0e06532388037)
[ddiss@samba.org: 4.0 rebase with cli_init_creds() call]

9 years agolibsmb: reuse connections derived from DFS referrals
David Disseldorp [Fri, 16 Jan 2015 15:21:22 +0000 (16:21 +0100)]
libsmb: reuse connections derived from DFS referrals

[MS-DFSC] 3.2.1.1 and 3.2.1.2 states that DFS targets with the same site
location or relative cost are placed in random order in a DFS referral
response.

libsmbclient currently resolves DFS referrals on every API call, always
using the first entry in the referral response. With random ordering,
libsmbclient may open a new server connection, rather than reuse an
existing (cached) connection established in a previous DFS referred API
call.

This change sees libsmbclient check the connection cache for any of the
DFS referral response entries before creating a new connection.

This change is based on a patch by Har Gagan Sahai
<SHarGagan@novell.com>.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7b7d4f740fe5017107d3100041cc8c7982f0eac7)
[ddiss@samba.org: 4.0 rebase without smbXcli_tcon context]

9 years agoVERSION: Bump version up to 4.0.25.
Karolin Seeger [Thu, 15 Jan 2015 11:12:10 +0000 (12:12 +0100)]
VERSION: Bump version up to 4.0.25.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoMerge tag 'samba-4.0.24' into v4-0-test
Karolin Seeger [Thu, 15 Jan 2015 11:11:57 +0000 (12:11 +0100)]
Merge tag 'samba-4.0.24' into v4-0-test

samba: tag release samba-4.0.24

9 years agosmbd: Fix CID 1063259 Uninitialized scalar variable
Volker Lendecke [Sun, 18 Aug 2013 20:35:32 +0000 (20:35 +0000)]
smbd: Fix CID 1063259 Uninitialized scalar variable

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

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit cc983c9a6a92f3d127ec6461b15aed3fa90e6d30)
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agonet: Fix sam addgroupmem
Volker Lendecke [Tue, 13 Jan 2015 11:51:13 +0000 (12:51 +0100)]
net: Fix sam addgroupmem

Domain local groups come across as SID_TYPE_ALIAS and are sent to us in the
PAC/Info3 struct. We should allow this in net sam addgroupmem.

Volker

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

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jan 13 15:28:16 CET 2015 on sn-devel-104

9 years agodsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable
Garming Sam [Wed, 3 Dec 2014 22:53:12 +0000 (11:53 +1300)]
dsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable

This includes additional tests based directly on the docs, rather than
simply testing our internal implementation in client and server contexts,
that create a user and groups.

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

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming-Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Dec 22 17:17:02 CET 2014 on sn-devel-104

(similar to commit e4213512d0a967e87a74a1ae816c903fb38dd8b9)

9 years agoVERSION: Disable git snapshots for the 4.0.24 release. samba-upstream/tags/samba-4.0.24
Karolin Seeger [Mon, 12 Jan 2015 20:05:40 +0000 (21:05 +0100)]
VERSION: Disable git snapshots for the 4.0.24 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.24.
Karolin Seeger [Mon, 12 Jan 2015 20:01:33 +0000 (21:01 +0100)]
WHATSNEW: Add release notes for Samba 4.0.24.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoCVE-2014-8143:dsdb-samldb: Check for extended access rights before we allow changes...
Andrew Bartlett [Thu, 4 Dec 2014 04:23:29 +0000 (17:23 +1300)]
CVE-2014-8143:dsdb-samldb: Check for extended access rights before we allow changes to userAccountControl

This requires an additional control to be used in the
LSA server to add domain trust account objects.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoCVE-2014-8143:dsdb: Allow use of dsdb_autotransaction_request outside util.c
Andrew Bartlett [Mon, 8 Dec 2014 01:20:21 +0000 (14:20 +1300)]
CVE-2014-8143:dsdb: Allow use of dsdb_autotransaction_request outside util.c

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

Change-Id: If6bc90305a1e9a5a92562a01ba7e44330de91cc1
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoCVE-2014-8143:pydsdb: Pull in UF_USE_AES_KEYS flag
Andrew Bartlett [Sun, 7 Dec 2014 23:19:19 +0000 (12:19 +1300)]
CVE-2014-8143:pydsdb: Pull in UF_USE_AES_KEYS flag

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

Change-Id: I36ad5ebc5d8a4811c41b59af90a3add4ae5fd857
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoCVE-2014-8143:auth: Force talloc type of session_info pointer to match
Andrew Bartlett [Tue, 11 Nov 2014 02:23:02 +0000 (15:23 +1300)]
CVE-2014-8143:auth: Force talloc type of session_info pointer to match

This helps us keep things safe in LDB where we put this in a opaque pointer.

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

Andrew Bartlett

Change-Id: I46fe53ba655ca0810c276b72fbca524884cdf22d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoVERSION: Bump version up to 4.0.24...
Karolin Seeger [Sun, 7 Dec 2014 20:47:37 +0000 (21:47 +0100)]
VERSION: Bump version up to 4.0.24...

...and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
(cherry picked from commit b1adeee4aed02f3066f9a96f20daeb3dce43b68c)

9 years agonsswitch: fix soname of linux nss_*.so.2 modules
Stefan Metzmacher [Thu, 18 Dec 2014 09:33:34 +0000 (10:33 +0100)]
nsswitch: fix soname of linux nss_*.so.2 modules

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(similar to commit 575b093dac3c509b1bfaab0b4ad29b9b4214e487)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Jan 11 16:10:35 CET 2015 on sn-devel-104

9 years agoselftest: use shared/libnss_wrapper_winbind.so.2
Stefan Metzmacher [Thu, 18 Dec 2014 19:13:44 +0000 (20:13 +0100)]
selftest: use shared/libnss_wrapper_winbind.so.2

This library is always available in make test.
nss-wrapper strictly requires the linux nss api.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 4eb24fa545234be506eb1330ccbbfd5c2b9e0d82)

9 years agowafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()
Stefan Metzmacher [Thu, 18 Dec 2014 09:21:30 +0000 (10:21 +0100)]
wafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 82e583b04b04e560c121163850d70c52d2fce78d)

9 years agowinbind: Retry after SESSION_EXPIRED error in ping-dc
Christof Schmitt [Fri, 19 Dec 2014 19:24:53 +0000 (12:24 -0700)]
winbind: Retry after SESSION_EXPIRED error in ping-dc

Trying to establish a netlogon connection when the service ticket
expires might fail with NT_STATUS_NETWORK_SESSION_EXPIRED. The
underlying client code already marks the session as invalid, so retry
the netlogon connect in this case.

Signed-off-by: Christof Schmit <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan  6 02:58:57 CET 2015 on sn-devel-104
(cherry picked from commit a2670f15dea27c10e3827216adf572f9c3894f85)

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

9 years agowinbind: Retry LogonControl RPC in ping-dc after session expiration
Christof Schmitt [Mon, 22 Dec 2014 23:19:47 +0000 (15:19 -0800)]
winbind: Retry LogonControl RPC in ping-dc after session expiration

When the underlying session expires, the LogonControl RPC call used in
ping-dc returns NT_STATUS_IO_DEVICE_ERROR. Retry once in this case,
instead of returning the error to the caller.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 23 02:46:34 CET 2014 on sn-devel-104
(cherry picked from commit 2fdc55160309cec89aeb88243cb18d058c67e918)

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

9 years agolibcli/smb: only force signing of smb2 session setups when binding a new session
Stefan Metzmacher [Fri, 12 Dec 2014 13:55:38 +0000 (13:55 +0000)]
libcli/smb: only force signing of smb2 session setups when binding a new session

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec 12 23:11:40 CET 2014 on sn-devel-104

(cherry picked from commit daff0f5d709eca621a7f319c892ecaba7b03e5c2)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Dec 18 23:32:50 CET 2014 on sn-devel-104

9 years agos3:smb2_server: allow reauthentication without signing
Stefan Metzmacher [Fri, 12 Dec 2014 08:22:15 +0000 (09:22 +0100)]
s3:smb2_server: allow reauthentication without signing

If signing is not required we should not require it for reauthentication.
Windows clients would otherwise fail to reauthenticate.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 382019656ee164fd21455ed7d7b5e9e18bd0ca72)

9 years agos3:smb2_server: use the global signing key to check if signing is required
Stefan Metzmacher [Thu, 12 Jun 2014 13:10:11 +0000 (15:10 +0200)]
s3:smb2_server: use the global signing key to check if signing is required

If we have a channel session key, we also always have a global session key.

For multi-channel it's possible that the channel session key is not in place
yet, in that case the global session key needs to be used.

In both cases (reauth or session bind) we session setup requests need to be
signed.

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

9 years agotestprogs/test_ldb: check rootdse search with extended-dn control
Stefan Metzmacher [Fri, 21 Nov 2014 13:11:54 +0000 (14:11 +0100)]
testprogs/test_ldb: check rootdse search with extended-dn control

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Dec 12 20:15:46 CET 2014 on sn-devel-104

(cherry picked from commit 7e81fe282540a5b52dcb8c5396321a67733790d2)

9 years agos4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control
Stefan Metzmacher [Thu, 20 Nov 2014 13:21:06 +0000 (14:21 +0100)]
s4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control

Otherwise we can't find the GUID of the 'serverName' attribute
as ANONYMOUS.

This results in

  root@ub1204-161:~# ldbsearch -U% -H ldap://172.31.9.161 -b '' -s base --extended-dn serverName
  search error - LDAP error 1 LDAP_OPERATIONS_ERROR -  <00002020: operations error at ../source4/dsdb/samdb/ldb_modules/rootdse.c:567> <>

While it works as system:

  root@ub1204-161:~# ldbsearch -U% -H /var/lib/samba/private/sam.ldb -b '' -s base --extended-dn serverName
  # record 1
  dn:
  serverName: <GUID=348c35e1-04e3-4988-a32c-32478d584551>;CN=UB1204-161,CN=Serve
   rs,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=s4xdom,DC=base

  # returned 1 records
  # 1 entries
  # 0 referrals

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit a6ecef4532e4529a819219cd814e2979c2df0797)

9 years agos3:utils/profiles fix a use after free
Christian Ambach [Tue, 4 Nov 2014 22:51:23 +0000 (23:51 +0100)]
s3:utils/profiles fix a use after free

path is a talloc-child of subkeys, so subkeys should not be freed before calling
verbose_output

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec  3 00:43:19 CET 2014 on sn-devel-104

(cherry picked from commit 3b90bfb1089e6a4b7e05e7ed62bb642521f57917)

9 years agos3:registry/regfio fix some valgrind warnings
Christian Ambach [Tue, 4 Nov 2014 22:50:07 +0000 (23:50 +0100)]
s3:registry/regfio fix some valgrind warnings

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4b41489901b7f1a78ffd479128c3e0d309e53b53)

9 years agos3:registry/regfio read SD from the correct location
Christian Ambach [Tue, 4 Nov 2014 22:47:26 +0000 (23:47 +0100)]
s3:registry/regfio read SD from the correct location

try to find the security descriptor at the data pointer, not at the beginning of the hbin

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 217a0189c15761f6c7b24c9d7bfdbccf85de8e1d)

9 years agos3: modules: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Mon, 8 Dec 2014 03:50:54 +0000 (19:50 -0800)]
s3: modules: Fix *allocate* calls to follow POSIX error return convention.

Fix up the time_audit and streams_xattr modules to follow
the -1,errno convention for errors.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:34:12 +0000 (15:34 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

Fix vfs_allocate_file_space(), vfs_slow_fallocate(),
vfs_fill_sparse() to follow the -1,errno convention
for errors.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit cc1f91cec627cb3e4fc89b96aae1e7e4c539cd1c)

9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:31:19 +0000 (15:31 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

vfswrap_fallocate() is broken in that it can call posix_fallocate()
which returns an int error (and doesn't set errno) but can also
call Linux fallocate() which returns -1 and sets errno.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit c9235deee0fc49c99cfaf2329b7af526d9dd12d0)

9 years agoVERSION: Bump version up to 4.0.24...
Karolin Seeger [Sun, 7 Dec 2014 20:47:37 +0000 (21:47 +0100)]
VERSION: Bump version up to 4.0.24...

...and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Disable git snapshots for the 4.0.23 release. samba-upstream/tags/samba-4.0.23
Karolin Seeger [Sun, 7 Dec 2014 20:46:20 +0000 (21:46 +0100)]
VERSION: Disable git snapshots for the 4.0.23 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.23.
Karolin Seeger [Sun, 7 Dec 2014 20:44:58 +0000 (21:44 +0100)]
WHATSNEW: Add release notes for Samba 4.0.23.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoRevert "buildtools: Rename perl vendorarch configure option."
Michael Adam [Thu, 4 Sep 2014 10:45:48 +0000 (12:45 +0200)]
Revert "buildtools: Rename perl vendorarch configure option."

This reverts commit 04685ff4eed9535769d6a5feee7353f1796a4389.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  9 03:07:20 CEST 2014 on sn-devel-104

(cherry picked from commit 1f878b9986523ce9e35dd74ae3c201f4e55f66f3)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Nov 18 23:11:44 CET 2014 on sn-devel-104

9 years agoRevert "buildtools: Add perl vendorlib configure option."
Michael Adam [Thu, 4 Sep 2014 10:45:40 +0000 (12:45 +0200)]
Revert "buildtools: Add perl vendorlib configure option."

This reverts commit 48f0183dbeddd7bdf333a40fe0d3e1c7e7fe00f2.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

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

9 years agoRevert "wafsamba: If perl can't provide defaults, define them."
Michael Adam [Thu, 4 Sep 2014 10:45:32 +0000 (12:45 +0200)]
Revert "wafsamba: If perl can't provide defaults, define them."

This reverts commit 0ba276ebad57d75a769e22414f94acbe8c177d97.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

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

9 years agoRevert "wafsamba: Fail with error message if perl doesn't provide valid dirs."
Michael Adam [Thu, 4 Sep 2014 10:45:21 +0000 (12:45 +0200)]
Revert "wafsamba: Fail with error message if perl doesn't provide valid dirs."

This reverts commit 2637890ef42a238093f0f3cbdda0d621d5f9b2e2.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

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

9 years agopidl/wscript: remove --with-perl-* options
Stefan Metzmacher [Tue, 26 Aug 2014 19:33:05 +0000 (21:33 +0200)]
pidl/wscript: remove --with-perl-* options

These are not needed anymore as we have useful defaults now.

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

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

9 years agoRevert "autobuild: Set perl vendorlib direcotry."
Stefan Metzmacher [Wed, 12 Nov 2014 10:36:13 +0000 (11:36 +0100)]
Revert "autobuild: Set perl vendorlib direcotry."

This reverts commit 60b8f8f61db0fd85e20a009d7274d19b470fbd65.

9 years agoRevert "script/autobuild: make use of --with-perl-{arch,lib}-install-dir"
Stefan Metzmacher [Wed, 12 Nov 2014 10:34:00 +0000 (11:34 +0100)]
Revert "script/autobuild: make use of --with-perl-{arch,lib}-install-dir"

This reverts commit d6043d62521391cf9c1d5b0f7f11618c6c3b46fb.

9 years agopidl: remove superfluous "use lib ...".
Michael Adam [Mon, 25 Aug 2014 21:58:48 +0000 (23:58 +0200)]
pidl: remove superfluous "use lib ...".

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

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit fac24e11655c554cd3113dfb6fc918a0fd3c880c)

9 years agopidl: fix the perl module search path (use lib ...) when installing pidl.
Michael Adam [Mon, 25 Aug 2014 21:57:23 +0000 (23:57 +0200)]
pidl: fix the perl module search path (use lib ...) when installing pidl.

This way, pidl can also run with modules installed under the $prefix.

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

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit b537c5a340bae2accbf35a4ec5eab7074b90f0b1)

9 years agowafsamba: add perl_fixup parameter to INSTALL_FILES
Michael Adam [Thu, 17 Jul 2014 14:54:54 +0000 (16:54 +0200)]
wafsamba: add perl_fixup parameter to INSTALL_FILES

This fixes the search path for modules when installing
a perl "binary" by replacing a line 'use lib "$RealBin/lib";'
which works for the build directory with the appropriate
"use lib" line.

This is a step in allowing to install perl modules under the
prefix directory again.

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

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

9 years agos3:build: don't detect perl in source3/wscript again.
Michael Adam [Wed, 27 Aug 2014 20:19:38 +0000 (22:19 +0200)]
s3:build: don't detect perl in source3/wscript again.

This is done in the top level now.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit e7fc38a7df90e26a96ec5573042dccc1746e4f2c)

9 years agopidl/wscript: don't check for perl again.
Michael Adam [Wed, 3 Sep 2014 23:38:14 +0000 (01:38 +0200)]
pidl/wscript: don't check for perl again.

This is done at the toplevel now.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 191fc0e541e7c9d0a1095dc287402df9947ce779)

9 years agobuild: do full SAMBA_CHECK_PERL() check in configure
Michael Adam [Mon, 25 Aug 2014 23:31:17 +0000 (01:31 +0200)]
build: do full SAMBA_CHECK_PERL() check in configure

...instead of only checking for the perl binary

This autodetects PERL_LIB_INSTALL_DIR and removes the
need of the --with-perl-lib-install-dir when using a --prefix!=/usr.

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

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 7bf9e937ae59e10a9b40be3a60ffaad49669fb83)

9 years agowafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.
Michael Adam [Mon, 25 Aug 2014 23:29:57 +0000 (01:29 +0200)]
wafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.

This checks for the perl binary, sets PERL and PERL_SPECIFIED
as well es the PERL_ARCH_INSTALL_DIR and PERL_LIB_INSTALL_DIR.

We want to avoid installing the perl modules outside the prefix.
I.e. generally,the perl modules should be installed
under "$prefix/share/perl5".

This improves the fixes for bug #10472.

The new strategy for automatically setting the paths is this:

- if the prefix equals perl's vendorprefix, then
  - PERL_LIB_INSTALL_DIR is set to perl's vendorlib dir
  - PERL_ARCH_INSTALL_DIR is set to perl's vendorarch dir
- otherwise:
  - PERL_LIB_INSTALL_DIR is set to ${DATADIR}/perl5
    (usually ${PREFIX}/share/perl5)
  - PERL_ARCH_INSTALL_DIR is set to ${LIBDIR}/perl5
    (usually ${PREFIX}/lib/perl5)

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 75c3e240e0703be8c86596e689e466b4dee5e85e)

9 years agodynconfig: implement PERL_ARCH_INSTALL_DIR
Michael Adam [Mon, 25 Aug 2014 22:41:54 +0000 (00:41 +0200)]
dynconfig: implement PERL_ARCH_INSTALL_DIR

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

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

9 years agodynconfig: implement PERL_LIB_INSTALL_DIR.
Michael Adam [Mon, 25 Aug 2014 21:59:46 +0000 (23:59 +0200)]
dynconfig: implement PERL_LIB_INSTALL_DIR.

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

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

9 years agolib/ldb/wscript: pass dep_vars=['LDB_VERSION'] to SAMBA_GENERATOR()
Stefan Metzmacher [Wed, 27 Aug 2014 08:29:50 +0000 (10:29 +0200)]
lib/ldb/wscript: pass dep_vars=['LDB_VERSION'] to SAMBA_GENERATOR()

bld.add_manual_dependency() only works for files not for environment variables.

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

9 years agodocs-xml/wscript_build: pass dep_vars=bld.dynconfig_varnames() to SAMBA_GENERATOR()
Stefan Metzmacher [Wed, 27 Aug 2014 08:15:56 +0000 (10:15 +0200)]
docs-xml/wscript_build: pass dep_vars=bld.dynconfig_varnames() to SAMBA_GENERATOR()

This avoids the use of always=True.

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

9 years agodynconfig/wscript: add dynconfig_varnames()
Stefan Metzmacher [Wed, 27 Aug 2014 08:13:09 +0000 (10:13 +0200)]
dynconfig/wscript: add dynconfig_varnames()

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

9 years agowafsamba: let SAMBA_BLDOPTIONS() use dep_vars=['defines'] instead of always=True
Stefan Metzmacher [Wed, 27 Aug 2014 08:08:21 +0000 (10:08 +0200)]
wafsamba: let SAMBA_BLDOPTIONS() use dep_vars=['defines'] instead of always=True

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

9 years agowafsamba: fix dependencies on environment variables for python_fixup
Stefan Metzmacher [Tue, 26 Aug 2014 21:14:23 +0000 (23:14 +0200)]
wafsamba: fix dependencies on environment variables for python_fixup

We now checksum the sourcecode of copy_and_fix_python_path()
and the env variables used by this function.

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

9 years agowafsamba: allow an optional dep_vars list to be passed to SAMBA_GENERATOR()
Stefan Metzmacher [Tue, 26 Aug 2014 21:11:39 +0000 (23:11 +0200)]
wafsamba: allow an optional dep_vars list to be passed to SAMBA_GENERATOR()

This can be used to checksum variables used in the rule function.

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

9 years agowafsamba: fix dependency for SAMBA_GENERATOR() when passing vars!=None
Stefan Metzmacher [Tue, 26 Aug 2014 21:11:39 +0000 (23:11 +0200)]
wafsamba: fix dependency for SAMBA_GENERATOR() when passing vars!=None

vars can only be a dictionary as that's the only thing bld.EXPAND_VARIABLES()
accepts.

We need to checksum the whole vars dictionary into the dependencies.

We set task.env.SAMBA_GENERATOR_VARS = vars and add SAMBA_GENERATOR_VARS
to the dep_vars.

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

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

9 years agowafsamba: fix dependency calculation for SAMBA_GENERATOR()
Stefan Metzmacher [Tue, 26 Aug 2014 21:11:39 +0000 (23:11 +0200)]
wafsamba: fix dependency calculation for SAMBA_GENERATOR()

We need to checksum the rule as string command of the
sourcecode of the python function.

This is stored in the 'ruledeps' envariable on the waf Task.
See exec_rule() in wafadmin/TaskGen.py.

    dep_vars = getattr(self, 'dep_vars', ['ruledeps'])
    if dep_vars:
        tsk.dep_vars = dep_vars
    if isinstance(self.rule, str):
        tsk.env.ruledeps = self.rule
    else:
        # only works if the function is in a global module such as a waf tool
        tsk.env.ruledeps = Utils.h_fun(self.rule)

If there's no 'dep_vars' it defaults to ['ruledeps'].
As we pass our own 'dep_vars' we need to explicitly add
'ruledeps'.

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

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

9 years agowafsamba: improve wording in a comment
Michael Adam [Mon, 25 Aug 2014 21:39:50 +0000 (23:39 +0200)]
wafsamba: improve wording in a comment

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

9 years agowafsamba: remove unused variable from copy_and_fix_python_path
Michael Adam [Mon, 25 Aug 2014 21:38:29 +0000 (23:38 +0200)]
wafsamba: remove unused variable from copy_and_fix_python_path

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

9 years agodocs: Always declare rule to build parameters.all.xml and do it first
Andrew Bartlett [Wed, 15 Jan 2014 05:11:41 +0000 (18:11 +1300)]
docs: Always declare rule to build parameters.all.xml and do it first

This ensures this file and the rule to generate it can always be found.

Andrew Bartlett

Change-Id: I76d9f4470e2678fc2df4e3a13642737128938f3a
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 2c86758b04515998c690f293fada2cc43116d764)

9 years agodocs: define and include entities for the docs
Garming Sam [Wed, 8 Jan 2014 23:01:18 +0000 (12:01 +1300)]
docs: define and include entities for the docs

This allows for dynamic default settings to be generated.

Change-Id: If8b93d233fb941bc7e3073ccf4b5ec0b0a231bd9
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 57ba012c10fb21f261a3ab9136be05a694278df9)

9 years agodocs: remove the file prefix from included path names
Garming Sam [Tue, 7 Jan 2014 04:09:39 +0000 (17:09 +1300)]
docs: remove the file prefix from included path names

This allows the inbuilt python xml modules to perform the include.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 1d68b5b0bb3158cabcd371ab5c24392bcb0a32bd)

9 years agodocs: update XInclude year to conform with current standard
Garming Sam [Tue, 7 Jan 2014 03:08:50 +0000 (16:08 +1300)]
docs: update XInclude year to conform with current standard

This allows the inbuilt python XML parser to handle these includes.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 02379369ef7968f297b8678c9743679b4775662e)

9 years agopdb_tdb: Fix a TALLOC/SAFE_FREE mixup
Volker Lendecke [Tue, 11 Nov 2014 10:35:50 +0000 (10:35 +0000)]
pdb_tdb: Fix a TALLOC/SAFE_FREE mixup

Signed-off-by: Volker Lendecke <vl@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10932
invalid free in pdb_tdb

9 years agospoolss: remove unused fill_job_info3()
David Disseldorp [Thu, 30 Oct 2014 00:37:51 +0000 (01:37 +0100)]
spoolss: remove unused fill_job_info3()

This logic has been moved into the previous EnumJobs(level=3) caller.
The info3 structure only contains two fields that are used, so it
doesn't make sense to have a separate helper for it.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d772b98283f289917a6a8370808d4d0912899384)

9 years agospoolss: fix jobid in level 3 EnumJobs response
David Disseldorp [Thu, 30 Oct 2014 00:37:50 +0000 (01:37 +0100)]
spoolss: fix jobid in level 3 EnumJobs response

Until now, these responses have incorrectly carried the printing backend
job identifier (sysjob), rather than the one allocated and returned by
Samba on job submission.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5e7ab3d2f4f7950099561eb22d6a9a1536297442)

9 years agospoolss: fix jobid in level 2 GetJob and EnumJobs responses
David Disseldorp [Thu, 30 Oct 2014 00:37:49 +0000 (01:37 +0100)]
spoolss: fix jobid in level 2 GetJob and EnumJobs responses

Until now, these responses have incorrectly carried the printing backend
job identifier (sysjob), rather than the one allocated and returned by
Samba on job submission.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 45abaf81c67b62bab571df208931241afa660802)

9 years agospoolss: fix jobid in level 1 GetJob and EnumJobs responses
David Disseldorp [Thu, 30 Oct 2014 00:37:48 +0000 (01:37 +0100)]
spoolss: fix jobid in level 1 GetJob and EnumJobs responses

Until now, these responses have incorrectly carried the printing backend
job identifier (sysjob), rather than the one allocated and returned by
Samba on job submission.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4d7f5d2af6ef6960dccaccf89c6e88947e2591bf)

9 years agospoolss: fix GetJob jobid lookups
David Disseldorp [Thu, 30 Oct 2014 00:37:47 +0000 (01:37 +0100)]
spoolss: fix GetJob jobid lookups

Clients issue GetJob requests using the jobid assigned by the spoolss
server. The corresponding printing backend (sysjob) identifier needs to
be resolved to locate the correct print queue entry.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3a28ae56977235d3c9e3abcd1f24b220e536c50d)

9 years agoprinting: add jobid_to_sysjob helper function
David Disseldorp [Thu, 30 Oct 2014 00:37:46 +0000 (01:37 +0100)]
printing: add jobid_to_sysjob helper function

Samba needs to deal with two types of print job identifiers, those
allocated by the printing backend (sysjob ids), and those allocated
by Samba's spoolss server (jobids).

This change adds a helper function to map spoolss jobids to sysjob ids,
to go alongside the corresponding sysjob to jobid mapping function.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 77b5be1742ee7aa2733a25bfa6a3af369f5c9401)

9 years agos3:smbd: fix file corruption using "write cache size != 0"
Stefan Metzmacher [Fri, 7 Nov 2014 23:57:40 +0000 (15:57 -0800)]
s3:smbd: fix file corruption using "write cache size != 0"

A client can:
- open a handle (h1)
- write some data to h1.
- open a 2nd handle h2 (downgrades both handles to level II)
- try to read the data on h2 (this gets old data)

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Nov  9 22:51:19 CET 2014 on sn-devel-104

9 years agospoolss: fix handling of bad EnumJobs levels
David Disseldorp [Mon, 27 Oct 2014 19:13:59 +0000 (20:13 +0100)]
spoolss: fix handling of bad EnumJobs levels

Currently Samba is inconsistent when returning WERR_UNKNOWN_LEVEL
errors for spoolss EnumJobs requests - if no print jobs are present,
then WERR_OK will be returned, regardless of whether the EnumJobs level
is supported or not.
This change fixes this behaviour, by catching invalid or unsupported
levels prior to the no-jobs response fast-path.

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

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): Tue Oct 28 03:05:35 CET 2014 on sn-devel-104

(cherry picked from commit d4f233a746d89e13aae78008b499c71b695ff882)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed Oct 29 23:28:50 CET 2014 on sn-devel-104

9 years agos3-nmbd: Fix netbios name truncation.
Jeremy Allison [Tue, 28 Oct 2014 18:55:30 +0000 (11:55 -0700)]
s3-nmbd: Fix netbios name truncation.

Try and cope with truncation more intelligently.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 6adcc7bffd5e1474ecba04d2328955c0b208cabc)
Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agoThere are tests all over the SMB1 code to check that srv_send_smb fails, but it never...
Richard Sharpe [Mon, 22 Jul 2013 23:04:43 +0000 (16:04 -0700)]
There are tests all over the SMB1 code to check that srv_send_smb fails, but it never returns false.

Even if the write to the socket/fd fails, we never return false and
will keep reading stuff off of the input buffer until it is exhausted
and then we will exit.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Sat Aug  3 17:41:22 CEST 2013 on sn-devel-104

(cherry picked from commit 852c9ac34dbef66d0b2619554c611157c2fab771)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10880
S3: source3/smbd/process.c::srv_send_smb() returns true on the error path.

9 years agos3: daemons - ensure nmbd and winbindd are consistent in command line processing...
Jeremy Allison [Mon, 14 Jul 2014 23:13:24 +0000 (16:13 -0700)]
s3: daemons - ensure nmbd and winbindd are consistent in command line processing by adding POPT_COMMON_DYNCONFIG.

Bug #10711 - nmbd fails to accept --piddir option.

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

Signed-off-by: Jeremy Allison <jra@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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Oct 13 23:31:07 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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Oct  9 23:25:47 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 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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Sep 30 22:44:58 CEST 2014 on sn-devel-104

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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Sep 29 22:07:06 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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Sep 18 11:15:53 CEST 2014 on sn-devel-104

9 years agoWHATSNEW: Fix typo.
Karolin Seeger [Mon, 15 Sep 2014 09:48:22 +0000 (11:48 +0200)]
WHATSNEW: Fix typo.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Bump version number up to 4.0.23...
Karolin Seeger [Sat, 13 Sep 2014 13:48:43 +0000 (15:48 +0200)]
VERSION: Bump version number up to 4.0.23...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Disable git snapshots for the 4.0.22 release. samba-upstream/tags/samba-4.0.22
Karolin Seeger [Sat, 13 Sep 2014 13:48:07 +0000 (15:48 +0200)]
VERSION: Disable git snapshots for the 4.0.22 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.22.
Karolin Seeger [Sat, 13 Sep 2014 13:47:13 +0000 (15:47 +0200)]
WHATSNEW: Add release notes for Samba 4.0.22.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Sep 11 22:02:42 CEST 2014 on sn-devel-104

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

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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Sep  2 22:45:38 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)