sfrench/samba-autobuild/.git
14 years agoRevert "Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail to respond... samba-3.5.1
Karolin Seeger [Mon, 8 Mar 2010 19:34:39 +0000 (20:34 +0100)]
Revert "Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail to respond to a read or write."

This reverts commit a6ae7a552f851a399991262377cc0e062e40ac20.

This fixes bug #7222 (All users have full rigths on all shares) (CVE-2010-0728).

14 years agoWHATSNEW: Prepare release notes for Samba 3.5.1.
Karolin Seeger [Mon, 8 Mar 2010 19:32:49 +0000 (20:32 +0100)]
WHATSNEW: Prepare release notes for Samba 3.5.1.

Karolin

14 years agoVERSION: Raise version number up to 3.5.1.
Karolin Seeger [Mon, 1 Mar 2010 14:03:03 +0000 (15:03 +0100)]
VERSION: Raise version number up to 3.5.1.

Karolin
(cherry picked from commit 0410c8bca22c61318bf71c845fca523614bef73a)

14 years agoWHATSNEW: Update changes since 3.5.0rc3. samba-3.5.0
Karolin Seeger [Mon, 1 Mar 2010 11:09:45 +0000 (12:09 +0100)]
WHATSNEW: Update changes since 3.5.0rc3.

Karolin
(cherry picked from commit 5fcab1948e6e3347cbe91fa2f27e547db499776b)

14 years agos3-net: fix net ads dns usage calls.
Günther Deschner [Mon, 8 Feb 2010 10:53:59 +0000 (11:53 +0100)]
s3-net: fix net ads dns usage calls.

Bjoern, please check.

Guenther

Fix bug #7181 (buildwarnings in net_ads.c).
(cherry picked from commit 7d5575fefe29a00c757dab0013c9d45b84f0be47)

14 years agos3-rpcclient: fix uninitialized variable in wkssvc_enumerateusers.
Günther Deschner [Wed, 17 Feb 2010 14:15:47 +0000 (15:15 +0100)]
s3-rpcclient: fix uninitialized variable in wkssvc_enumerateusers.

Guenther

Fix bug #7182.
(cherry picked from commit bb4a76538bfae593c4a997b10bdb1f6c1666701c)

14 years agos3: Fix but 7145 -- duplicate sam and unix accounts
Volker Lendecke [Sun, 28 Feb 2010 13:38:14 +0000 (14:38 +0100)]
s3: Fix but 7145 -- duplicate sam and unix accounts

For me this survives the

TESTS=posix_s3 POSIX_SUBTESTS="RPC-SAMR-LARGE-DC LOCAL-NSS-WRAPPER" make test

reproducer. Günther, please check!

Volker
(cherry picked from commit 0e9882a65e91e4ab55dc103c7f6aec4ccd966db0)
(cherry picked from commit fd59fa500a30a69ed09265bc3871fa640e232422)

14 years agos3:cli_netlogon: keep the the correct negotiate_flags on the cli->dc structure
Stefan Metzmacher [Fri, 19 Feb 2010 22:22:40 +0000 (23:22 +0100)]
s3:cli_netlogon: keep the the correct negotiate_flags on the cli->dc structure

This should fix the rpccli_netlogon_set_trust_password() against DC's
without netr_ServerPasswordSet2 support.

This fixes bug #7160.

metze
(cherry picked from commit 1e9df26ef970df41de54142a78606a15374acbac)
(cherry picked from commit a3e3355b5ccf74a2ffe5da6cbb2747e74586b1e5)

14 years agos3: Avoid calling cli_alloc_mid twice in cli_smb_req_iov_send
Volker Lendecke [Sun, 21 Feb 2010 19:39:36 +0000 (20:39 +0100)]
s3: Avoid calling cli_alloc_mid twice in cli_smb_req_iov_send

I hate macros....
(cherry picked from commit 65914ed8194b141a44516d626e71a1851bccff5f)

Fix bug #7166.
(cherry picked from commit b7d5b469ef134d60e1f795f66f7e5c3ef23d7971)

14 years agoWHATSNEW: Prepare release notes for Samba 3.5.0.
Karolin Seeger [Mon, 22 Feb 2010 14:44:34 +0000 (15:44 +0100)]
WHATSNEW: Prepare release notes for Samba 3.5.0.

Karolin
(cherry picked from commit 262854d8a2a39df2d151268442772ad92b0ddbcd)

14 years agoVERSION: Raise version number up to 3.5.0.
Karolin Seeger [Mon, 22 Feb 2010 14:40:57 +0000 (15:40 +0100)]
VERSION: Raise version number up to 3.5.0.

Karolin
(cherry picked from commit e8979e7edd42ec229cc7d53f636c99a09b97fde4)

14 years agoWHATSNEW: Update changes since 3.5.0rc2. samba-3.5.0rc3
Karolin Seeger [Fri, 19 Feb 2010 12:45:32 +0000 (13:45 +0100)]
WHATSNEW: Update changes since 3.5.0rc2.

Karolin
(cherry picked from commit 8b05660b20058bad9fc9fb2336f7d2d3b513579c)

14 years agolibrpc/ndr: don't overwrite the content in ndr_push_relative_ptr2_end()
Stefan Metzmacher [Fri, 19 Feb 2010 07:11:24 +0000 (08:11 +0100)]
librpc/ndr: don't overwrite the content in ndr_push_relative_ptr2_end()

metze
(cherry picked from commit 76aa37f653fec2d511921768381db7da661750cb)

The last 24 patches address bug #6888 (REGRESSION: printing support for 64 bit
windows clients broken).
(cherry picked from commit b094f4954d0bef08794c5edcf102444908f1971c)

14 years agospoolss: use ndr_push_spoolss_PrinterInfo2 hand-marshalled version (moves devmode...
Günther Deschner [Sat, 13 Feb 2010 02:45:25 +0000 (03:45 +0100)]
spoolss: use ndr_push_spoolss_PrinterInfo2 hand-marshalled version (moves devmode relative pointer down to sd).

Guenther
(cherry picked from commit 0a8011aa98ccaa81dc6ba2d30672ef4856fc31d8)
(cherry picked from commit a2c03502df39c0ee8859895f4a80a3e48f798508)

14 years agospoolss: add spoolss_security_descriptor.
Günther Deschner [Tue, 16 Feb 2010 01:48:01 +0000 (02:48 +0100)]
spoolss: add spoolss_security_descriptor.

Guenther
(cherry picked from commit 28817424935e5b6eaf465fe993dedc2b0a0cf177)
(cherry picked from commit 412ff72854040d5f619e978ce65c60f50f980f2b)

14 years agos3: re-run make samba3-idl.
Günther Deschner [Tue, 9 Feb 2010 15:47:32 +0000 (16:47 +0100)]
s3: re-run make samba3-idl.

Guenther
(cherry picked from commit faf7ab156092a1deffec25db300f11cdedb558a1)

14 years agosecurity: make two bitmaps public.
Günther Deschner [Tue, 16 Feb 2010 09:46:07 +0000 (10:46 +0100)]
security: make two bitmaps public.

Guenther
(cherry picked from commit f10a2d773d141f67319e19b45c40101bb9cb6cf4)
(cherry picked from commit 1623a11fbde6f00fa3d05c8d088f48e206ad63ee)

14 years agospoolss: make two bitmaps public.
Günther Deschner [Sat, 13 Feb 2010 03:27:05 +0000 (04:27 +0100)]
spoolss: make two bitmaps public.

Guenther
(cherry picked from commit 8c4ff98ea11ff06e20bea73596e9643d8194a890)
(cherry picked from commit 63eae72f981b619dd2baf1973bc5744ccd2fca28)

14 years agospoolss: make all security descriptors and devicemodes 4 byte aligned and add missing...
Stefan Metzmacher [Thu, 18 Feb 2010 14:36:08 +0000 (15:36 +0100)]
spoolss: make all security descriptors and devicemodes 4 byte aligned and add missing subcontexts.

Guenther
(cherry picked from commit 8f52957369bf8ce7591d5d9a1436ccb7e384c612)
(cherry picked from commit ef3bd911cae625b524fa79dc28e67db1234f1eeb)

14 years agospoolss: set NDR_RELATIVE_REVERSE flag for various unions that have relative pointers.
Günther Deschner [Mon, 14 Dec 2009 16:22:39 +0000 (17:22 +0100)]
spoolss: set NDR_RELATIVE_REVERSE flag for various unions that have relative pointers.

Guenther
(cherry picked from commit 6d0a39741dacd81e33b25a91fa28cdf983d10d84)
(cherry picked from commit 7c7917ba9cdc17c6b5d1e1e51cde714c0be6e036)

14 years agondr_spoolss_buf: use LIBNDR_FLAG_NO_NDR_SIZE in NDR_SPOOLSS_SIZE_*
Stefan Metzmacher [Thu, 18 Feb 2010 14:17:42 +0000 (15:17 +0100)]
ndr_spoolss_buf: use LIBNDR_FLAG_NO_NDR_SIZE in NDR_SPOOLSS_SIZE_*

metze
(cherry picked from commit 2059a165ee6f4d231aa4075d8ddea70b8df8944f)
(cherry picked from commit 8343c3c28a17cf8c464c9167d453855b5a0482c1)

14 years agospoolss: use subcontext in NDR_SPOOLSS_PUSH_ENUM_OUT macro.
Stefan Metzmacher [Wed, 23 Dec 2009 14:52:39 +0000 (15:52 +0100)]
spoolss: use subcontext in NDR_SPOOLSS_PUSH_ENUM_OUT macro.

metze
(cherry picked from commit a4c3aeb79306190b09e284a6a28e3b40fbc5823b)
(cherry picked from commit db00f017f2ab67931bf04d53df592658fde69419)

14 years agolibndr: fix ndr_size_* calculation with relative reverse buffers
Stefan Metzmacher [Thu, 18 Feb 2010 14:13:20 +0000 (15:13 +0100)]
libndr: fix ndr_size_* calculation with relative reverse buffers

metze
(cherry picked from commit 8310f02414efd3b792857ed20c636c4c114e1ba2)
(cherry picked from commit 2d157eac5abcfe75968d80978c82d6b7b2b0359b)

14 years agolibndr: for now align reverse relative pointers to 2 bytes by default.
Stefan Metzmacher [Thu, 18 Feb 2010 12:40:44 +0000 (13:40 +0100)]
libndr: for now align reverse relative pointers to 2 bytes by default.

This is just a hack and we should let the callers use FLAG_ALIGN2
explicit in future.

metze
(cherry picked from commit 4a76d29374769ba4c075b8d5767498848d2e17d6)
(cherry picked from commit d8251b5ab5e2d1abb8c69cc6ee2fe56bd074e48d)

14 years agolibndr: implement LIBNDR_RELATIVE_REVERSE handling
Stefan Metzmacher [Wed, 17 Feb 2010 20:24:40 +0000 (21:24 +0100)]
libndr: implement LIBNDR_RELATIVE_REVERSE handling

This is based on Guenther's initial code.

metze
(cherry picked from commit 31c7780c16651b284009874cf3da04587dc36d19)
(cherry picked from commit 148460b4ed9dd1ecf83acace0641bab6d22f7296)

14 years agolibndr: store a subcontext buffer size in ndr_push_subcontext_start.
Günther Deschner [Mon, 14 Dec 2009 14:33:32 +0000 (15:33 +0100)]
libndr: store a subcontext buffer size in ndr_push_subcontext_start.

Guenther
(cherry picked from commit 05347754ee61f06466d6d9b7f390001992f793ce)
(cherry picked from commit b8f0d947baab823586cea518e091de55de7b5f56)

14 years agolibndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the...
Stefan Metzmacher [Wed, 17 Feb 2010 19:27:08 +0000 (20:27 +0100)]
libndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the RELATIVE_REVERSE flag

metze
(cherry picked from commit b5f9c44da55abb28222441a7e064a2a25891981f)
(cherry picked from commit 983ac75b5b1f6bb79df15340c9ea73ed9c69aee2)

14 years agolibndr: add LIBNDR_FLAG_NO_RELATIVE_REVERSE so that relative reverse processing can...
Günther Deschner [Tue, 9 Feb 2010 17:27:37 +0000 (18:27 +0100)]
libndr: add LIBNDR_FLAG_NO_RELATIVE_REVERSE so that relative reverse processing can be disabled for single structure elements.

Guenther
(cherry picked from commit a2c34296fa6ca2ffb69cb69698a9b5f81803e8a8)
(cherry picked from commit cc103797c60b7a2ee48d73fefd91d7f4ab6586e3)

14 years agolibndr: add LIBNDR_FLAG_RELATIVE_REVERSE flag.
Günther Deschner [Mon, 14 Dec 2009 14:09:00 +0000 (15:09 +0100)]
libndr: add LIBNDR_FLAG_RELATIVE_REVERSE flag.

Guenther
(cherry picked from commit ee13a51b0514ec3ac4ca9c532c2b101a08ec9784)
(cherry picked from commit f7634ed1d3ca13c18e2c2a0f5f8206c3212b32c7)

14 years agolibndr: change subcontext buffer allocation to allocate on subcontext_start.
Günther Deschner [Wed, 16 Dec 2009 21:54:02 +0000 (22:54 +0100)]
libndr: change subcontext buffer allocation to allocate on subcontext_start.

Guenther
(cherry picked from commit c9fa97b01774d767acfabaf1eec7a6aad1510440)
(cherry picked from commit 07a51577816e493c04f0fa7baaf798e9455d923f)

14 years agolibrpc/ndr: make ndr_push_relative_ptr2() static
Stefan Metzmacher [Wed, 17 Feb 2010 19:00:36 +0000 (20:00 +0100)]
librpc/ndr: make ndr_push_relative_ptr2() static

metze
(cherry picked from commit 66fe881cfc0a0919a1d01df896ff8458436e780e)

14 years agolibrpc/ndr_krb5pac: use ndr_push_relative_ptr2_start()/_end()
Stefan Metzmacher [Wed, 17 Feb 2010 19:00:04 +0000 (20:00 +0100)]
librpc/ndr_krb5pac: use ndr_push_relative_ptr2_start()/_end()

metze
(cherry picked from commit e03591111a1b9c2f05c29a7afac4641f23f455f4)
(cherry picked from commit bdf8ae4229e16feb4547893d44805c4d04d7a9ab)

14 years agolibrpc/ndr_drsblobs: use ndr_push_relative_ptr2_start()/_end()
Stefan Metzmacher [Wed, 17 Feb 2010 18:59:19 +0000 (19:59 +0100)]
librpc/ndr_drsblobs: use ndr_push_relative_ptr2_start()/_end()

metze
(cherry picked from commit b423bd2115e006f9af5d40cf5b651e03739d53a0)
(cherry picked from commit e57719ee8395fb288ad7d544c4a2b8fbf15bc72c)

14 years agospoolss: fix relative pointers in ndr_push_spoolss_DriverInfo101.
Günther Deschner [Thu, 11 Feb 2010 17:54:31 +0000 (18:54 +0100)]
spoolss: fix relative pointers in ndr_push_spoolss_DriverInfo101.

Guenther
(cherry picked from commit bfd6edb3e9339d602eb6514ff50c3bb6c671174e)
(cherry picked from commit 08fd161d53b1de4d8b55b2a24bc489658805332f)

14 years agos3: re-run make full_idl.
Günther Deschner [Mon, 14 Dec 2009 13:17:05 +0000 (14:17 +0100)]
s3: re-run make full_idl.

Guenther
(cherry picked from commit c869328b1642043480f9600c88bcce9da37959b1)
(cherry picked from commit 5edccc592e66c1ccea24b81c6a96c21fbabe746d)

14 years agopidl: use ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.
Günther Deschner [Mon, 14 Dec 2009 13:09:22 +0000 (14:09 +0100)]
pidl: use ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.

Guenther
(cherry picked from commit a049d75193b284fe9efb28d303ea46ba407e5a7a)
(cherry picked from commit b9db7b7e824a2dcbb9f501fa441392d151afc3a3)

14 years agolibndr: add ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.
Günther Deschner [Mon, 14 Dec 2009 13:08:34 +0000 (14:08 +0100)]
libndr: add ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.

Guenther
(cherry picked from commit 478bf4173af63345c27e09fd2dede56d506da0af)

14 years agoFix bug #7154 - mangling method = hash can crash storing a name not containing a '.'
Jeremy Allison [Thu, 18 Feb 2010 19:22:44 +0000 (11:22 -0800)]
Fix bug #7154 - mangling method = hash can crash storing a name not containing a '.'

Fix use of uninitialized variable. This can lead to crashes if
mangling = hash processes names with no '.'.

Jeremy.
(cherry picked from commit df13b1303a751962d8f7d5298b39e4a7500fef15)
(cherry picked from commit 7122d0e97ca9edeea28c9e898e77f576a886471e)

14 years agoFix bug #7155 - valgrind Conditional jump or move depends on uninitialised value...
Jeremy Allison [Thu, 18 Feb 2010 20:21:10 +0000 (12:21 -0800)]
Fix bug #7155 - valgrind Conditional jump or move depends on uninitialised value(s) error when "mangling method = hash"

The charset array allocated in init_chartest() is allocated
by MALLOC, but only some elements of it being set after allocation. Fix is to
memset to zero after allocation.

Jeremy.
(cherry picked from commit a4e8210ba7d6d471cb9f17754244393b9c1e5930)
(cherry picked from commit fd906e77a0959189db767392981a89b5130939e2)

14 years agos3-docs: Remove trailing whitespaces and fix a typo.
Karolin Seeger [Thu, 18 Feb 2010 12:10:21 +0000 (13:10 +0100)]
s3-docs: Remove trailing whitespaces and fix a typo.

Karolin
(cherry picked from commit 494819773d61daa32d4ee2a0a15088f3b4abe6e2)
(cherry picked from commit b3c5b9d7739143cc3cc7c004a73fce2969aaa6b8)

14 years agos3:docs: add some advice for usage of strict allocate
Björn Jacke [Wed, 17 Feb 2010 22:03:32 +0000 (23:03 +0100)]
s3:docs: add some advice for usage of strict allocate
(cherry picked from commit 37115f91aebec9c846e54790c6bcf433ae35888a)
(cherry picked from commit cbf728ce617323ca866799370491a402800772c1)

14 years agotsocket/bsd: fix comment in tdgram_bsd_recvfrom_handler()
Stefan Metzmacher [Wed, 17 Feb 2010 18:11:11 +0000 (19:11 +0100)]
tsocket/bsd: fix comment in tdgram_bsd_recvfrom_handler()

metze
(cherry picked from commit c42d9c4ec410e205091784cd97cbceb5572609d8)
(cherry picked from commit d68c7db67dc8f87be8a924d1b2b66379fc52b723)

14 years agoFix commit d07cd37b993d3c9beded20323174633b806196b5
Jeremy Allison [Wed, 17 Feb 2010 17:24:34 +0000 (09:24 -0800)]
Fix commit d07cd37b993d3c9beded20323174633b806196b5

Which was:

    tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD

Metze, this has to have been wrong - you are throwing away the talloc_realloc
pointer returned. Also no error checking. Please review.

Thank goodness for gcc warnings :-).

Jeremy.
(cherry picked from commit 936828de71023d90aaec6c1dba84052246bbad11)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ba85facc2ce212d52140086f876eb4915b40bf22)

14 years agotsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD
Stefan Metzmacher [Wed, 17 Feb 2010 12:53:02 +0000 (13:53 +0100)]
tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD

metze
(cherry picked from commit d07cd37b993d3c9beded20323174633b806196b5)
(cherry picked from commit b9e7200f933480bce20219f0294364288be3a5df)

14 years agotsocket/bsd: set IPV6_V6ONLY on AF_INET6 sockets
Stefan Metzmacher [Wed, 17 Feb 2010 08:33:18 +0000 (09:33 +0100)]
tsocket/bsd: set IPV6_V6ONLY on AF_INET6 sockets

Some system already have this as default. It's easier
to behave the same way on all systems and handle ipv6
and ipv4 sockets separate.

metze
(cherry picked from commit 1ffcb991a900b78c9175f6b093839fe96b1bd7d9)
(cherry picked from commit d1dfa2e92fea3dc54771c4b1a6e3c06ee478b54f)

14 years agotsocket/bsd: fix bug #7140 autodetect ipv4 and ipv6 based on the remote address if...
Stefan Metzmacher [Wed, 17 Feb 2010 07:49:28 +0000 (08:49 +0100)]
tsocket/bsd: fix bug #7140 autodetect ipv4 and ipv6 based on the remote address if the local address is any

metze
(cherry picked from commit 8a0949dfc8d2ecf577dfc5ef38496421101b734e)
(cherry picked from commit b4a5c3325a272c97658aaede1f1c659260524789)

14 years agotsocket/bsd: fix bug #7140 use calculated sa_socklen for bind() in tstream_bsd_connec...
Stefan Metzmacher [Wed, 17 Feb 2010 07:45:58 +0000 (08:45 +0100)]
tsocket/bsd: fix bug #7140 use calculated sa_socklen for bind() in tstream_bsd_connect_send()

This is needed because, we can't use sizeof(sockaddr_storage) for AF_UNIX
sockets. Also some platforms require exact values for AF_INET and AF_INET6.

metze
(cherry picked from commit 6637b2f4b06fcee1e8e1b1782dd96e3273f8caac)
(cherry picked from commit c84c467be347384ab1ceb7d74147fef364678235)

14 years agotsocket/bsd: fix do_bind logic for AF_INET
Stefan Metzmacher [Wed, 17 Feb 2010 07:42:22 +0000 (08:42 +0100)]
tsocket/bsd: fix do_bind logic for AF_INET

We want the explicit bind() when we don't use the any address.

metze
(cherry picked from commit 135543b4c300e2fc31ee4165ce630644e1aef455)
(cherry picked from commit fc63303b07b09f6d6855284f4e0080972fe424f7)

14 years agosocket_wrapper: also ignore AF_INET6 in swrap_setsockopt()
Stefan Metzmacher [Wed, 17 Feb 2010 08:43:00 +0000 (09:43 +0100)]
socket_wrapper: also ignore AF_INET6 in swrap_setsockopt()

metze
(cherry picked from commit 0b3e950731fe72a258a631e39ca1304d54663536)
(cherry picked from commit 6aa09416ad5f27e3db679765657b67e54dde5fd9)

14 years agos3-modules: fix get_acl_blob in the acl_tdb VFS module.
Günther Deschner [Thu, 18 Feb 2010 01:13:07 +0000 (02:13 +0100)]
s3-modules: fix get_acl_blob in the acl_tdb VFS module.

Shuttle-reviewed by jra :)

Guenther
(cherry picked from commit 6cf10cc1020dd7ef483887caebcbd76d28572432)

Fix bug #7148 (vfs_acl_tdb module uses uninitialized variable. Reading blob can
fail.)
(cherry picked from commit 61ea3d3f897f2b6c1b893e727f57ce079782572b)

14 years agoFix bug #6557 - Do not work VFS full_audit
Jeremy Allison [Wed, 17 Feb 2010 18:11:57 +0000 (10:11 -0800)]
Fix bug #6557 - Do not work VFS full_audit

Re-arrange the operations order so SMB_VFS_CONNECT is done
first as root (to allow modules to correctly initialize themselves).

Reviewed modules to check if they needed CONNECT invoked as
a user (which we previously did) and it turns out any of them
that cared needed root permissions anyway.

Jeremy.
(cherry picked from commit 1d71d4b6b5f5fdf5caf9fed861c2032bb307a32f)

14 years agos3: Fix bug 7139 owner of file not available with kerberos.
Volker Lendecke [Tue, 16 Feb 2010 22:29:48 +0000 (23:29 +0100)]
s3: Fix bug 7139 owner of file not available with kerberos.

To provide the user with the same SID when doing Kerberos logins, attempt to do
a make_server_info_sam instead of a make_server_info_pw.
(cherry picked from commit 45c634eafa2f398827f16345b56603b969964527)

14 years agoWHATSNEW: Update changes.
Karolin Seeger [Wed, 17 Feb 2010 13:51:03 +0000 (14:51 +0100)]
WHATSNEW: Update changes.

Karolin
(cherry picked from commit 3bb72e7f3e6be64011cabfd37866b29ffb0e18a4)

14 years agocifs.upcall: allocate a talloc context for smb_krb5_unparse_name
Jeff Layton [Tue, 16 Feb 2010 14:16:42 +0000 (09:16 -0500)]
cifs.upcall: allocate a talloc context for smb_krb5_unparse_name

cifs.upcall calls smb_krb5_unparse_name with a NULL talloc context.
Older versions of this function though will conditionally use
SMB_REALLOC instead of TALLOC_REALLOC when a NULL context is passed
in. To make it more consistent, just spawn a talloc context that
we can pass into this function.

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=565446
https://bugzilla.samba.org/show_bug.cgi?id=6868

Reported-by: Ludek Finstrle <luf@seznam.cz>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit a8cc2fa09ed43a167f62711bef363a5ac335dc78)

Fix bug #6868 (make bin/cifs.upcall fails).
(cherry picked from commit 01750852c1e9983b9d59a73d412101b4e0eb81a1)

14 years agos3-docs: Document 'smbclient -C'.
Volker Lendecke [Tue, 16 Feb 2010 10:00:08 +0000 (11:00 +0100)]
s3-docs: Document 'smbclient -C'.
(cherry picked from commit f6c39cec27eea2522c62e6f1ff85efdafde351ac)
(cherry picked from commit f6a7e9eadf85b19ec0ccca513a261bcad0bcf048)

14 years agos3/smbd: change locking behavior when "lock spin time = 0".
Steven Danneman [Fri, 12 Feb 2010 23:42:50 +0000 (15:42 -0800)]
s3/smbd: change locking behavior when "lock spin time = 0".

The "lock spin time" parameter mimics the following Windows
setting which by default is 250ms in Windows and 200ms in Samba.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\LockViolationDelay

When a client sends repeated, non-blocking, contending BRL requests
to a Windows server, after the first Windows starts treating these
requests as timed blocking locks with the above timeout.

As an efficiency, I've changed the behavior when this setting is 0,
to skip this logic and treat all requests as non-blocking locks.

This gives the smbd server behavior similar to the 3.0 release with
the do_spin_lock() implementation.

I've also changed the blocking lock parameter in the call from
push_blocking_lock_request() to true as all requests made in this
path are blocking by definition.
(cherry picked from commit cb0ea273696fc9024e6da18eb3e319024f8643f5)

Fix bug #7138 (Backport 'lock spin time" enhancement to 3.5.1).
(cherry picked from commit 3e72ded677389816dd4f502792139cd8b2945f98)

14 years agoFix error in docs. Should be milliseconds, not microseconds.
Jeremy Allison [Sat, 13 Feb 2010 05:29:58 +0000 (21:29 -0800)]
Fix error in docs. Should be milliseconds, not microseconds.
(cherry picked from commit c7f16abc47a2d291d3da95b4c8e654010e36bc0f)
(cherry picked from commit 53531cb983739391fc70b1490f29d294785fee68)

14 years agos3: by default don't use pthread pool support
Björn Jacke [Fri, 29 Jan 2010 11:42:25 +0000 (12:42 +0100)]
s3: by default don't use pthread pool support
(cherry picked from commit 118725c892e445fcc1dc5947cb919cf99c49373f)

The last seven patches address bug #6983 (Build with aio support fails on Debian
Sarge).
(cherry picked from commit 3e43399fdbeb5a145c9e2d22390a8758f515fe36)

14 years agos3:nsswitch: also use pthread CFLAGS for the nsswitch modules that might require it
Björn Jacke [Thu, 4 Feb 2010 10:03:55 +0000 (11:03 +0100)]
s3:nsswitch: also use pthread CFLAGS for the nsswitch modules that might require it
(cherry picked from commit 55d65ba7213e5b30711b5b5939d53e3d3990d86a)
(cherry picked from commit 6be22ad4248c1cfd3fad22818ca9fc3c3894b4c0)

14 years agos3: fix build on Tru64 after it broke with deactivating pthread pool support
Björn Jacke [Thu, 4 Feb 2010 09:35:45 +0000 (10:35 +0100)]
s3: fix build on Tru64 after it broke with deactivating pthread pool support
(cherry picked from commit acedd1c8320afa672ca70c6594bc90ccb7e75a6a)
(cherry picked from commit ff2a7386e625a041448ff9f64862d83533a191b8)

14 years agos3: link thread objects in libsmbclient only and adjust linker flags
Björn Jacke [Fri, 29 Jan 2010 14:23:29 +0000 (15:23 +0100)]
s3: link thread objects in libsmbclient only and adjust linker flags
(cherry picked from commit a20b43f23f2254edb1fcd6d3916dd57e6a4778ee)
(cherry picked from commit 1797fbd5837f430424305b9a00dcbe64c916f8ae)

14 years agos3: syntax fix
Björn Jacke [Wed, 27 Jan 2010 22:43:23 +0000 (23:43 +0100)]
s3: syntax fix
(cherry picked from commit 1f7e97a8a257b3280ca14168adf2d59ca9e1074c)
(cherry picked from commit cbe55a58727775383a53482037aa425608b917a1)

14 years agos3: get pthread detection also on HP-UX right
Björn Jacke [Wed, 27 Jan 2010 17:54:55 +0000 (18:54 +0100)]
s3: get pthread detection also on HP-UX right
(cherry picked from commit 6bade10a1eb21689613770f9a54e0a080663029c)
(cherry picked from commit 22296525a64d21351c21511cf6a0464d7d577314)

14 years agos3: fix detection and flags for using pthread
Björn Jacke [Mon, 25 Jan 2010 23:17:10 +0000 (00:17 +0100)]
s3: fix detection and flags for using pthread

I hope this fixes the build on Tru64, IRIX and maybe bug #6983
(cherry picked from commit 5439e1a03f66ff9722987f908babfd71ebd698f1)
(cherry picked from commit 63253834e5008991c2e4011d22fb825262b255e5)

14 years agos3-docs: fix eventlogadm manpage typo.
Günther Deschner [Thu, 7 Jan 2010 11:05:18 +0000 (12:05 +0100)]
s3-docs: fix eventlogadm manpage typo.

Guenther
(cherry picked from commit c1ca00047d26ace240fa5f34b428392b5d61e6c3)

Fix bug #7137 (eventlogadm manpage typo for dump command).
(cherry picked from commit 3da0d891bfc0c7afedc5c4acf988f8347676269c)

14 years agospoolss: disable GetPrinterDriver level 101 (as called by XP).
Günther Deschner [Thu, 11 Feb 2010 11:54:57 +0000 (12:54 +0100)]
spoolss: disable GetPrinterDriver level 101 (as called by XP).

We still dont get the marshalling right, disable and XP will just fall back to
level 6.

Guenther
(cherry picked from commit ddbda92f87aeedb1a1a976a43a1e5ada3897646e)

Fix bug #7136 (spoolss getprinterdriver2 level 101 marshalling bad).
(cherry picked from commit 4ad86ab5e79c97c5edbd897c54f66bc2b437d90f)

14 years agoVERSION: We need another release candidate.
Karolin Seeger [Mon, 15 Feb 2010 09:22:45 +0000 (10:22 +0100)]
VERSION: We need another release candidate.

Karolin
(cherry picked from commit 70e4d52d290e1851afe9c1f9e4503534713ec8fb)

14 years agoWHATSNEW: Update changes since 3.5.0rc2.
Karolin Seeger [Mon, 15 Feb 2010 09:37:09 +0000 (10:37 +0100)]
WHATSNEW: Update changes since 3.5.0rc2.

Karolin
(cherry picked from commit 4a386fb1850b558cc7355ecd4e0ce0a9849283e0)

14 years agoFixes issue with preexec scripts creating a share directory, and problems is a smb...
Jeremy Allison [Fri, 12 Feb 2010 00:00:51 +0000 (16:00 -0800)]
Fixes issue with preexec scripts creating a share directory, and problems is a smb.conf reload turns wide links back on after a connection is establised.

Includes git refs :
cd18695fc2e4d09ab75e9eab2f0c43dcc15adf0b
94865e4dbd3d721c9855aada8c55e02be8b3881e
5d92d969dda450cc3564dd2265d2b042d832c542
02a5078f1fe6285e4a0b6ad95a3aea1c5bb3e8cf
a6f402ad87ff0ae14d57d97278d67d0ceaaa1d82

from master.

Jeremy.

Fix bug #7104 ("wide links" and "unix extensions" are incompatible.)
(cherry picked from commit 09fbad07d7fc6577b5617b1ecc912072ad220463)

14 years agos3: Fix typo found by jhell <jhell@DataIX.net>
Volker Lendecke [Sat, 13 Feb 2010 15:38:25 +0000 (16:38 +0100)]
s3: Fix typo found by jhell <jhell@DataIX.net>
(cherry picked from commit 271a4c60dbec0d001dc55df58de8e54274137853)
(cherry picked from commit eb390b8f917f52eb28f46f39a19abdc717051f3d)

14 years agos3-spoolss: implement spoolss_EnumJobs level 3.
Günther Deschner [Wed, 10 Feb 2010 23:44:06 +0000 (00:44 +0100)]
s3-spoolss: implement spoolss_EnumJobs level 3.

Level 3 has been added with NT 4.0 and Windows 7 (at least 64bit version) makes
use of it in order to display queued jobs. Windows 7 will *not* fall back to
level 2 if we just return WERR_UNKNOWN_LEVEL, instead there will be no printjobs
displayed at all.

Guenther
(cherry picked from commit 25001bbd1b0b32073073dab7cf5b78a2b902163f)

Fix bug #7130 (enumjobs level 3 is required by win7).
(cherry picked from commit 223d9163651a3a2c0bb2bd72886f1a119b7f1fed)

14 years agoWHATSNEW: Mention new "nmbd bind explicit broadcast" parameter.
Karolin Seeger [Thu, 11 Feb 2010 12:25:12 +0000 (13:25 +0100)]
WHATSNEW: Mention new "nmbd bind explicit broadcast" parameter.

Karolin
(cherry picked from commit df5db3d3f02d40d08891faa83717d306ebcd1331)

14 years agoMore of the fix for bug #7118 - nmbd problems with socket address.
Jeremy Allison [Wed, 10 Feb 2010 20:32:05 +0000 (12:32 -0800)]
More of the fix for bug #7118 - nmbd problems with socket address.

Add a simple "processed packet queue" cache to stop nmbd responding to
packets received on the broadcast and non-broadcast socket (which
it has opened when "nmbd bind explicit broadcast = yes").

This is a very simple packet queue - it only keeps the packets
processed during a single call to listen_for_packets() (i.e. one
select call). This means that if the delivery notification for a
packet received on both broadcast and non-broadcast addresses
is done in two different select calls, the packet will still be
processed twice. This is a very rare occurrance and we can just
live with it when it does as the protocol is stateless. If this
is ever flagged as a repeatable problem then we can add a longer
lived cache, using timeout processing to clear etc. etc. But without
storing all packets processed we can never be *sure* we've eliminated
the race condition so I'm going to go with this simple solution until
someone proves a more complex one is needed :-).

Jeremy.
(cherry picked from commit 6fe7ee1d216fcf722b3efa23fd80782ce0dd0e9f)

14 years agoMake "nmbd bind explicit broadcast" on by default.
Jeremy Allison [Mon, 8 Feb 2010 22:35:02 +0000 (14:35 -0800)]
Make "nmbd bind explicit broadcast" on by default.

Fix a comment typo.

Jeremy.
(cherry picked from commit 05123ef78c903de2a12b95fb30632f03ac919a4d)

14 years agos3:docs-xml: document "nmbd bind explicit broadcast"
Stefan Metzmacher [Mon, 8 Feb 2010 11:59:13 +0000 (12:59 +0100)]
s3:docs-xml: document "nmbd bind explicit broadcast"

metze
(cherry picked from commit 9887751f6fa6f7e4fd5c79c637e0576405000c01)

The last 3 fixes address bug #7118 (nmbd problems with socket address).
(cherry picked from commit 5456e5e460041256cfa886eb8bab380c59c25b19)

14 years agos3:nmbd: change "nmbd:bind explicit broadcast" into "nmbd bind explicit broadcast"
Stefan Metzmacher [Mon, 8 Feb 2010 11:51:29 +0000 (12:51 +0100)]
s3:nmbd: change "nmbd:bind explicit broadcast" into "nmbd bind explicit broadcast"

metze
(cherry picked from commit 0140bc389d56511c3255720856bdb64803ba8930)
(cherry picked from commit 431a78a2f823b415d9fb2b207448e33e6ba12138)

14 years agos3:nmbd: also listen explicit on the subnet broadcast addresses
Stefan Metzmacher [Thu, 28 Jan 2010 10:04:05 +0000 (11:04 +0100)]
s3:nmbd: also listen explicit on the subnet broadcast addresses

And send replies always via the unicast address of the subnet.

This behavior is off by default (as before)
and can be enabled with "nmbd:bind explicit broadcast = yes".

metze
(cherry picked from commit 30a1bc365071befd07e68e24ca4fa3843159ab13)
(cherry picked from commit fe629dbf1aab33f6e75c14b916684c9adeca017f)

14 years agos3: change ldap filter to what really was intended (cherry picked from commit 9b75650...
Björn Jacke [Wed, 10 Feb 2010 12:48:11 +0000 (13:48 +0100)]
s3: change ldap filter to what really was intended (cherry picked from commit 9b75650f1a963e36a6dd697b5ad2725a8c7c9250)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Part of a fix for bug #7116.
(cherry picked from commit 23116018779938f931394a022893f2a46654a697)

14 years agoWHATSNEW: Update changes since 3.5.0rc2.
Karolin Seeger [Wed, 10 Feb 2010 10:05:13 +0000 (11:05 +0100)]
WHATSNEW: Update changes since 3.5.0rc2.

Karolin
(cherry picked from commit 085bd69d49e7605e511060110cc0bab5faf99e62)

14 years agoFix off-by-one error in working out the limit of the NetServerEnum comment.
Jeremy Allison [Tue, 9 Feb 2010 20:17:08 +0000 (12:17 -0800)]
Fix off-by-one error in working out the limit of the NetServerEnum comment.

Jeremy.

Part of a fix for bug #7122 (Reading a large browselist fails (server returns
invalid values in subsequent SMBtrans replies).
(cherry picked from commit 89a7121a3ff3ad110c3635bb493983fafdcee9f6)

14 years agoFix bug #7122 - Reading a large browselist fails (server returns invalid values in...
Jeremy Allison [Tue, 9 Feb 2010 23:14:38 +0000 (15:14 -0800)]
Fix bug #7122 - Reading a large browselist fails (server returns invalid values in subsequent SMBtrans replies)

There are two problems:

1). The server is off-by-one in the end of buffer space test.
2). The server returns 0 in the totaldata (smb_vwv1) and totalparams (smb_vwv0)
fields in the second and subsequent SMBtrans replies.

This patch fixes both.

Jeremy.
(cherry picked from commit b07a14dc37d2899f662e1cf87064f99c0bd10b25)

14 years agotdb: raise version to 1.2.1
Simo Sorce [Sat, 6 Feb 2010 15:48:39 +0000 (10:48 -0500)]
tdb: raise version to 1.2.1

after recent fixes we need to raise the version to 1.2.1 so that
we can require also the right patched version.

Original commit was 70534adee10fc6f5bba2d9304668dc6508e5de5a in master.
source4/min_versions.m4 was copied from the master branch.
(cherry picked from commit 70128dded977498ef5a693214053192f13c93c6b)

14 years agos3:smbd: use StrCaseCmp() instead of strcasecmp
Stefan Metzmacher [Tue, 9 Feb 2010 17:58:36 +0000 (18:58 +0100)]
s3:smbd: use StrCaseCmp() instead of strcasecmp

metze
(cherry picked from commit bc8242a08e1bb9489cc8171b1ec02bd2518b1857)

Part of a fix for bug #7119 (support for large browselist).
(cherry picked from commit 89b5ebed83ce8e4363928b2b5ddcc2953762c56c)

14 years agos3:smbd: Fix really ugly bool vs. int bug!!!
Stefan Metzmacher [Tue, 9 Feb 2010 17:54:41 +0000 (18:54 +0100)]
s3:smbd: Fix really ugly bool vs. int bug!!!

A comparison function for qsort needs to return an 'int'!
Otherwise you'll get random results depending on the compiler
and the architecture...

metze
(cherry picked from commit 1686a5e7e7eb1b411b003cbbde5c0d28741c6d02)

Part of a fix for bug #7119 (support for large browselist).
(cherry picked from commit 81191c8bbdf7517f35245cca6945ed898ae1e0e2)

14 years agos3:passdb: only use gid_to_sid() result if the result is a group of our local sam
Stefan Metzmacher [Tue, 9 Feb 2010 11:57:01 +0000 (12:57 +0100)]
s3:passdb: only use gid_to_sid() result if the result is a group of our local sam

Otherwise retry with pdb_gid_to_sid().

metze
(cherry picked from commit 4dc2be2264926fe415e4e40e212f94793c9831d1)

Last seven patches address bug #7116 (pdb_ldap performance fixes).
(cherry picked from commit 8946a47fcebe57f459c59ee2cb163e15901ff996)

14 years agos3:pdb_ldap: don't search for the users primary group, if we already know it
Stefan Metzmacher [Fri, 5 Feb 2010 15:20:21 +0000 (16:20 +0100)]
s3:pdb_ldap: don't search for the users primary group, if we already know it

metze
(cherry picked from commit 6753fb1cf6a834b12b2a9dce3b1a9555390c17be)
(cherry picked from commit da7cb9feacc7cb84499c73ef463d187a7b2754e8)

14 years agos3:pdb_ldap: optimize ldapsam_alias_memberships() and cache ldap searches.
Stefan Metzmacher [Wed, 3 Feb 2010 10:32:41 +0000 (11:32 +0100)]
s3:pdb_ldap: optimize ldapsam_alias_memberships() and cache ldap searches.

ldapsam_alias_memberships() does the same LDAP search twice, triggered
via add_aliases() from create_local_nt_token().

This happens when no domain aliases are used.

metze
(cherry picked from commit 49ace81e19de231825216cbf07c7422687131bb6)
(cherry picked from commit cb31c1df92b195b3fb80b6e21bfba83b8cd867fd)

14 years agos3:pdb_ldap: try to build the full unix_pw structure with ldapsam:trusted support
Stefan Metzmacher [Thu, 4 Feb 2010 16:19:57 +0000 (17:19 +0100)]
s3:pdb_ldap: try to build the full unix_pw structure with ldapsam:trusted support

And also store the gid_to_sid mappings in the idmap_cache.

metze
(cherry picked from commit 25038fa85ff69962ca0975f31802218a897aa1ec)
(cherry picked from commit 66a48d2226d245c373b744c7edea60b3daa57f0f)

14 years agos3:passdb: speed up pdb_get_group_sid()
Stefan Metzmacher [Thu, 4 Feb 2010 16:16:59 +0000 (17:16 +0100)]
s3:passdb: speed up pdb_get_group_sid()

Use the cached version gid_to_sid() instead
of pdb_gid_to_sid().

And also avoid the expensive lookup_sid() call
for wellkown domain groups.

metze
(cherry picked from commit e10d0869567436902c8b8cfb50f8c64148d554cb)
(cherry picked from commit b0c8ff971934ef8aa21abece8693807e0a2ca722)

14 years agos3: Make pdb_copy_sam_account also copy the group sid
Volker Lendecke [Sun, 31 Jan 2010 14:18:51 +0000 (15:18 +0100)]
s3: Make pdb_copy_sam_account also copy the group sid

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit b99046fed1bf4a908ed856afb17c3c934c6d305d)
(cherry picked from commit a1862c23346959cd0aa77653bf488e0686d14376)

14 years agos3: shortcut gid_to_sid when "ldapsam:trusted = yes"
Stefan Metzmacher [Sat, 30 Jan 2010 21:28:19 +0000 (22:28 +0100)]
s3: shortcut gid_to_sid when "ldapsam:trusted = yes"

The normal gid_to_sid behaviour is to call sys_getgrgid()
to get the name for the given gid and then call the
getsamgrnam passdb method for the resulting name.

In the ldapsam:trusted case we can reduce the gid_to_sid
operation to one simple search for the gidNumber attribute
and only get the sambaSID attribute from the correspoinding
LDAP object. This reduces the number of ldap roundtrips
for this operation.

metze
(cherry picked from commit 779821df8ecfe3ed2392582b500d26332f0b80fc)
(cherry picked from commit 0fb99386d41241f62312d4bb535976344e5d6492)

14 years agoMissed one check on the memcpy for bug #7063.
Jeremy Allison [Tue, 9 Feb 2010 22:56:12 +0000 (14:56 -0800)]
Missed one check on the memcpy for bug #7063.

Jeremy.
(cherry picked from commit 60fed68259f430cbd67cd1f347cc3218e3c0ea35)

14 years agoSecond part of fix for bug 7063 - Samba 3.4.5 on ubuntu 8.04 64 bit - Core dumps.
Jeremy Allison [Tue, 9 Feb 2010 22:48:15 +0000 (14:48 -0800)]
Second part of fix for bug 7063 - Samba 3.4.5 on ubuntu 8.04 64 bit - Core dumps.

Ensure we have no naked memcpy calls. This isn't a crash bug (it's
already checked in the data_blob_talloc_zero() above, but I want to
get into the pattern of having all memcpy's covered by safety checks.

Jeremy.
(cherry picked from commit faf4f9cd5e3d948b93dc94b099e87eceec8a3909)

14 years agos3-docs: Add missing para end tag.
Karolin Seeger [Tue, 9 Feb 2010 15:36:39 +0000 (16:36 +0100)]
s3-docs: Add missing para end tag.

Karolin
(cherry picked from commit b78de63ef3cde53e3aabbe46654aac5a335f16a8)

14 years agoWHATSNEW: Add changes since 3.5.0rc2.
Karolin Seeger [Tue, 9 Feb 2010 14:28:33 +0000 (15:28 +0100)]
WHATSNEW: Add changes since 3.5.0rc2.

Karolin
(cherry picked from commit e504f6c153854016e879a6af3bcffbab7c5652af)

14 years agoWHATSNEW: Update changes.
Karolin Seeger [Tue, 9 Feb 2010 10:36:37 +0000 (11:36 +0100)]
WHATSNEW: Update changes.

Karolin
(cherry picked from commit d7d33a15a66a0afd0b5004294ed3bf2210ce7361)

14 years agoFix bug #6876 for acl_tdb module.
Jeremy Allison [Mon, 8 Feb 2010 19:04:38 +0000 (11:04 -0800)]
Fix bug #6876 for acl_tdb module.

As pointed out by bj@sernet.de, the rmdir module initializer was
duplicated. Fix this properly.

Jeremy.
(cherry picked from commit b5a81d917e52a595f691d42372d727422286a377)

14 years agos3:libsmb: fix NetServerEnum3 rap calls.
Stefan Metzmacher [Mon, 8 Feb 2010 17:38:03 +0000 (18:38 +0100)]
s3:libsmb: fix NetServerEnum3 rap calls.

metze
(cherry picked from commit 9b5198dd443a00fdad4faa1f9cdabedd81012d93)

Fix bug #7119 (support for large browselist).
(cherry picked from commit 8a3e7bffdad2b1493cc962313bab8b0e58bc5543)

14 years agos3:smbd: implement api_RNetServerEnum3
Stefan Metzmacher [Fri, 5 Feb 2010 17:08:46 +0000 (18:08 +0100)]
s3:smbd: implement api_RNetServerEnum3

This is needed to support large browse lists.

metze
(cherry picked from commit 30eec0656c926d3d85a438dc28f17649b53318f8)
(cherry picked from commit 68119c56d7080e292b7245feec6bb7b2b7c47e79)

14 years agoutil: added binsearch.h for binary array searches
Andrew Tridgell [Thu, 10 Dec 2009 03:35:24 +0000 (14:35 +1100)]
util: added binsearch.h for binary array searches

This was moved from the schema_query code. It will now be used in more
than one place, so best to make it a library macro. I think there are
quite a few places that could benefit from this.
(cherry picked from commit 71943e8858943718affb6a3c0ded2127f07057f0)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 448b8f35d7a7cff73d35304673302178f593c9d0)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 6b24639c08b764eb0205c63674e80b303b2be2ac)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit dd7a09d2098fe0951f8dc716aba1bc9c7a485219)