]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
10 years agos4-backupkey: Initialize ndr->switchlist for print
Arvid Requate [Mon, 7 Jul 2014 16:36:49 +0000 (18:36 +0200)] 
s4-backupkey: Initialize ndr->switchlist for print

ndr_print_bkrp_data_in_blob requires the level to be set in the
proper ndr->switch_list context.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 6af3cf60e31fdaa0873f45fd821165e265335c55)

10 years agos4-backupkey: Comply with [MS-BKRP] 2.2.1
Arvid Requate [Mon, 7 Jul 2014 16:25:29 +0000 (18:25 +0200)] 
s4-backupkey: Comply with [MS-BKRP] 2.2.1

[MS-BKRP] 2.2.1 specifies "The Common Name field of the Subject name
field SHOULD contain the name of the DNS domain assigned to the server."

In fact Windows 7 clients don't seem to care. Also in certificates
generated by native AD the domain name (after CN=) is encoded as
UTF-16LE. Since hx509_parse_name only supports UTF-8 strings currently
we just leave the encoding as it is for now.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 007c3978a46d5f50051605752a76d12f30c5a0de)

10 years agos4-backupkey: Set defined cert serialnumber
Arvid Requate [Mon, 7 Jul 2014 16:18:30 +0000 (18:18 +0200)] 
s4-backupkey: Set defined cert serialnumber

[MS-BKRP] 2.2.1 specifies that the serialnumber of the certificate
should be set identical to the subjectUniqueID. In fact certificates
generated by native AD have this field encoded in little-endian format.
See also
https://www.mail-archive.com/cifs-protocol@cifs.org/msg01364.html

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 577fa69b5287b047ee2564786e19c9941a25734c)

10 years agos4-backupkey: de-duplicate error handling
Arvid Requate [Mon, 7 Jul 2014 16:15:37 +0000 (18:15 +0200)] 
s4-backupkey: de-duplicate error handling

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 525c93caa6c264de7c0cb463d005d3dcda7e45af)

10 years agos4-backupkey: check for talloc failure
Arvid Requate [Mon, 7 Jul 2014 16:12:47 +0000 (18:12 +0200)] 
s4-backupkey: check for talloc failure

Check for talloc_memdup failure for uniqueid.data.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit d633fcb5666085fef290adbe05161a2f36329abf)

10 years agos4-backupkey: Cert lifetime of 365 days, not secs
Arvid Requate [Mon, 7 Jul 2014 15:59:29 +0000 (17:59 +0200)] 
s4-backupkey: Cert lifetime of 365 days, not secs

hx509_ca_tbs_set_notAfter_lifetime expects the lifetime value in
in seconds. The Windows 7 client didn't seem to care that the lifetime
was only 6'03''. Two other TODOs in this implementation:

* Since notBefore is not set explicietely to "now", the heimdal code
  default of now-(24 hours) is applied.

* Server side validity checks and cert renewal are missing.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 89803009b957b980818aa971a0f5dd14f75cbbe1)

10 years agos4-backupkey: Ensure RSA modulus is 2048 bits
Arvid Requate [Mon, 7 Jul 2014 15:39:51 +0000 (17:39 +0200)] 
s4-backupkey: Ensure RSA modulus is 2048 bits

RSA_generate_key_ex doesn't always generate a modulus of requested
bit length. Tests with Windows 7 clients showed that they decline
x509 certificates (MS-BKRP 2.2.1) in cases where the modulus length
is smaller than the specified 2048 bits. For the user this resulted
in DPAPI failing to retrieve stored credentials after the user password
has been changed at least two times. On the server side log.samba showed
that the client also called the as yet unlimplemented ServerWrap sub-
protocol function BACKUPKEY_BACKUP_KEY_GUID after it had called the
ClientWarp function BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID. After
enabling DPAPI auditing on the Windows Clients the Event Viewer showed
Event-ID 4692 failing with a FailureReason value of 0x7a in these cases.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10980
(cherry picked from commit 9b2ff26c893e5748d12d7a37a93eef7b1f4b1a1b)

10 years agoAdd link to the Samba User Survey 2015 to WHATSNEW.txt
Marc Muehlfeld [Sat, 28 Feb 2015 10:38:12 +0000 (11:38 +0100)] 
Add link to the Samba User Survey 2015 to WHATSNEW.txt

Promote the Samba User Survey in the 4.2 release notes
to receive more results.

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Mon Mar  2 23:48:58 CET 2015 on sn-devel-104

10 years agodoc-xml: Add 'sharesec' reference to 'access based share enum'
Andreas Schneider [Mon, 2 Mar 2015 10:55:01 +0000 (11:55 +0100)] 
doc-xml: Add 'sharesec' reference to 'access based share enum'

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Mar  2 14:33:33 CET 2015 on sn-devel-104

(cherry picked from commit e2ed224653985afa13e906e2a5f3656a18d622c0)
Signed-off-by: Andreas Schneider <asn@samba.org>
10 years agosnprintf: Try to support %j
Volker Lendecke [Wed, 11 Feb 2015 16:16:50 +0000 (17:16 +0100)] 
snprintf: Try to support %j

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 12 23:34:33 CET 2015 on sn-devel-104

(cherry picked from commit 5f08d8b1728cc4559e61e0c928577724e0e2f9d2)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11119
lib/replace/sprintf.c needs to support format specifier %j

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sun Mar  1 23:49:26 CET 2015 on sn-devel-104

10 years agotevent: version 0.9.23
Michael Adam [Thu, 26 Feb 2015 23:27:29 +0000 (00:27 +0100)] 
tevent: version 0.9.23

* Add Solaris ports as tevent backend.
* Improvements to the tevent_data tutorial.
* Remove use of the 'staticforward' macro.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Feb 27 03:48:57 CET 2015 on sn-devel-104

(cherry picked from commit 04b8e19e1708c5670d180f5cd86d8ed139e9e5a4)

The last 3 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11118
Add Solaris Ports as a tevent backend

10 years agoAdd Solaris ports as a tevent backend.
Jeremy Allison [Mon, 22 Jul 2013 21:23:33 +0000 (14:23 -0700)] 
Add Solaris ports as a tevent backend.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Sun Feb 15 23:25:07 CET 2015 on sn-devel-104

(cherry picked from commit 88c1eb4ae10a9f69d2e828b4e5543915c1d990c6)

10 years agoUpdate the tevent_data.dox tutrial stuff to fix some errors, including white space...
Richard Sharpe [Sat, 24 Jan 2015 05:56:19 +0000 (21:56 -0800)] 
Update the tevent_data.dox tutrial stuff to fix some errors, including white space problems.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Sat Jan 24 09:33:03 CET 2015 on sn-devel-104

(cherry picked from commit 6a56bdf9869162e57c816c067598552bd33c2910)

10 years agoctdb-io: Do not use sys_write to write to client sockets
Amitay Isaacs [Mon, 23 Feb 2015 01:38:11 +0000 (12:38 +1100)] 
ctdb-io: Do not use sys_write to write to client sockets

When sending messages to clients, ctdb checks for EAGAIN error code and
schedules next write in the subsequent event loop.  Using sys_write in
these places causes ctdb to loop hard till a client is able to read from
the socket.  With real time scheduling, ctdb daemon spins consuming 100%
of CPU trying to write to the client sockets.  This can be quite harmful
when running under VMs or machines with single CPU.

This regression was introduced when all read/write calls were replaced to
use sys_read/sys_write wrappers (c1558adeaa980fb4bd6177d36250ec8262e9b9fe).

The existing code backs off in case of EAGAIN failures and waits for an
event loop to process the write again.  This should give ctdb clients
a chance to get scheduled and to process the ctdb socket.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Feb 24 12:29:30 CET 2015 on sn-devel-104

(cherry picked from commit 04a061e4d19d5bdbd8179fb0fab8b0875eec243e)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11124
CTDB daemon is non responsive and consuming 100% CPU

10 years agosmbd: Stop using vfs_Chdir after SMB_VFS_DISCONNECT.
Ira Cooper [Thu, 15 Jan 2015 16:41:50 +0000 (11:41 -0500)] 
smbd: Stop using vfs_Chdir after SMB_VFS_DISCONNECT.

This sequencing is causing problems for vfs_ceph, and likely
other vfs modules.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 16 00:13:17 CET 2015 on sn-devel-104

(cherry picked from commit 81464daea71e5fa3067ec7d5f5c69c890c0f7949)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11115
S3: vfs_Chdir() is called after SMB_VFS_DISCONNECT in
source3/smbd/service.c::close_cnum().

10 years agovfs: Add a brief vfs_ceph manpage.
Günther Deschner [Thu, 5 Feb 2015 14:59:52 +0000 (15:59 +0100)] 
vfs: Add a brief vfs_ceph manpage.

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

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
10 years agodoc:man:vfs_glusterfs: improve the configuration section.
Michael Adam [Thu, 19 Feb 2015 15:59:00 +0000 (16:59 +0100)] 
doc:man:vfs_glusterfs: improve the configuration section.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Feb 20 14:29:21 CET 2015 on sn-devel-104

(cherry picked from commit e6e6f563e6968dcb3ae558a7857f8dff49d2939f)

The last 3 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11117
vfs_glusterfs manpage corrections

10 years agodoc:man:vfs_glusterfs: improve and update description.
Michael Adam [Fri, 13 Feb 2015 00:04:11 +0000 (01:04 +0100)] 
doc:man:vfs_glusterfs: improve and update description.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 7852dd9e4c806d4e2b5428cb783b8ce6db8902d0)

10 years agodoc:man:vfs_glusterfs: remove extra % signs.
Michael Adam [Fri, 13 Feb 2015 00:03:21 +0000 (01:03 +0100)] 
doc:man:vfs_glusterfs: remove extra % signs.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit b9bf3c4d785606573ee3b9cb8e727bb04b3be6fb)

10 years agodebug: Set close-on-exec for the main log file FD
Andrew Bartlett [Mon, 16 Feb 2015 02:59:11 +0000 (15:59 +1300)] 
debug: Set close-on-exec for the main log file FD

This does not change the properties of dup2() of the fd as STDERR, however this is closed
before we start smbd or winbindd as child processes.

This is needed otherwise the logfile remains open in the child process, and
logfile rotation can mean this old log remains on disk indefinatly.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11100
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>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb 16 11:42:47 CET 2015 on sn-devel-104

(cherry picked from commit 1d95b0afc3547a91f8558873ce58652c271ed9eb)

10 years agoVERSION: Bump version up to 4.2.0...
Karolin Seeger [Tue, 24 Feb 2015 18:55:27 +0000 (19:55 +0100)] 
VERSION: Bump version up to 4.2.0...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.2.0rc5 release. samba-4.2.0rc5
Karolin Seeger [Tue, 24 Feb 2015 18:52:24 +0000 (19:52 +0100)] 
VERSION: Disable git snapshots for the 4.2.0rc5 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.2.0rc5.
Karolin Seeger [Tue, 24 Feb 2015 18:24:32 +0000 (19:24 +0100)] 
WHATSNEW: Add release notes for Samba 4.2.0rc5.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agos3-netlogon: Make sure we do not deference a NULL pointer.
Andreas Schneider [Mon, 16 Feb 2015 09:59:23 +0000 (10:59 +0100)] 
s3-netlogon: Make sure we do not deference a NULL pointer.

This is an additional patch for CVE-2015-0240.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Mon Feb 23 23:07:35 CET 2015 on sn-devel-104

10 years agoCVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized...
Jeremy Allison [Wed, 28 Jan 2015 22:47:31 +0000 (14:47 -0800)] 
CVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized pointer.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3: smbd: SMB2 close. If a file has delete on close, store the return info before...
Jeremy Allison [Fri, 20 Feb 2015 02:50:45 +0000 (18:50 -0800)] 
s3: smbd: SMB2 close. If a file has delete on close, store the return info before deleting.

If we delete the file on close, the stat after the close
will fail so we fail to return the attributes requested.

Bug 11104 - SMB2/SMB3 close response does not include attributes when requested.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <sfrench@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 20 20:54:18 CET 2015 on sn-devel-104

(cherry picked from commit a6008b2de7b2974073f38a1df88aacc27d3c6f57)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sun Feb 22 16:41:21 CET 2015 on sn-devel-104

10 years agos3: smbd: SMB2 close. Call utility function setup_close_full_information()
Jeremy Allison [Fri, 20 Feb 2015 02:49:03 +0000 (18:49 -0800)] 
s3: smbd: SMB2 close. Call utility function setup_close_full_information()

Replaces existing inline code.

Bug 11104 - SMB2/SMB3 close response does not include attributes when requested.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <sfrench@samba.org>
(cherry picked from commit 4a8c6988e349a4f714f3052ebf3f96f801d3c11f)

10 years agos3: smbd: SMB2 close. Add utility function setup_close_full_information()
Jeremy Allison [Fri, 20 Feb 2015 02:46:55 +0000 (18:46 -0800)] 
s3: smbd: SMB2 close. Add utility function setup_close_full_information()

Not yet used.

Bug 11104 - SMB2/SMB3 close response does not include attributes when requested.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <sfrench@samba.org>
(cherry picked from commit 2ccfdf760e4adcf25d59c629c9d6d6b31a10a9f1)

10 years agos4: smbtorture: leases - show stat opens grant leases and can be broken.
Jeremy Allison [Wed, 18 Feb 2015 19:51:53 +0000 (11:51 -0800)] 
s4: smbtorture: leases - show stat opens grant leases and can be broken.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 19 23:10:43 CET 2015 on sn-devel-104

(cherry picked from commit 75dff778c5f13c008419cf292d2ea73cf3a33d7b)

10 years agos3: smbd: leases - losen paranoia check. Stat opens can grant leases.
Jeremy Allison [Wed, 18 Feb 2015 19:49:27 +0000 (11:49 -0800)] 
s3: smbd: leases - losen paranoia check. Stat opens can grant leases.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit cec2a38e971ac83260f3a9a5c4ac7095f8d23d65)

10 years agos3: smbd: leases - new torture test shows stat opens can get leases.
Jeremy Allison [Wed, 18 Feb 2015 19:48:31 +0000 (11:48 -0800)] 
s3: smbd: leases - new torture test shows stat opens can get leases.

Can also issue breaks on these leases.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit 2d3db5e7930af9dd2a70727b2f2828bd73a1ec3b)

10 years agosamba-tool: Create NIS enabled users and unixHomeDirectory attribute
Marc Muehlfeld [Sat, 31 Jan 2015 18:44:26 +0000 (19:44 +0100)] 
samba-tool: Create NIS enabled users and unixHomeDirectory attribute

Allow to create NIS enabled user accounts via 'samba-tool user add'.

To create NIS enabled accounts, the parameters
--uid-number=, --login-shell=, --unix-home=, --gid-number=
are mandatory. Because we didn't had a parameter to set unixHomeDirectory
yet, this patch also adds this feature.

'unixUserPassword: ABCD!efgh12345$67890' is added by default, when you
enable NIS on an account in ADUC. The same we do in samba-tool.

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

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Marc Muehlfeld <mmuehlfeld@samba.org>
Autobuild-Date(master): Tue Feb  3 17:18:32 CET 2015 on sn-devel-104

(cherry picked from commit 362cac25a744d2d5c6e01495d341969b863d7f12)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sat Feb 21 22:44:33 CET 2015 on sn-devel-104

10 years agos3: smbclient: Allinfo leaves the file handle open.
Jeremy Allison [Tue, 10 Feb 2015 17:32:11 +0000 (09:32 -0800)] 
s3: smbclient: Allinfo leaves the file handle open.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Feb 10 23:28:46 CET 2015 on sn-devel-104

(cherry picked from commit 080ec0f7d9735b27138deb5f91a397935f089f02)

10 years agoprinting/cups: pack requested-attributes with IPP_TAG_KEYWORD
David Disseldorp [Tue, 3 Feb 2015 18:26:42 +0000 (19:26 +0100)] 
printing/cups: pack requested-attributes with IPP_TAG_KEYWORD

The CUPS IPP_GET_JOBS requested-attributes array indicates which job
attributes the caller would like in the cupsd response.

Until now, Samba has packed these attributes with a IPP_TAG_NAME
format tag. In recent versions of CUPS, this results in the IPP_GET_JOBS
response only including the job-id and job-printer-uri fields, even with
JobPrivateValues=none configured.

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

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 Feb 10 01:38:58 CET 2015 on sn-devel-104

(cherry picked from commit 2f4998113e539ea4ba6fb0a72ba6ac25c9d74bd6)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed Feb 11 23:30:21 CET 2015 on sn-devel-104

10 years agos3:smb2_server: protect against integer wrap with "smb2 max credits = 65535"
Stefan Metzmacher [Thu, 29 Jan 2015 09:12:30 +0000 (10:12 +0100)] 
s3:smb2_server: protect against integer wrap with "smb2 max credits = 65535"

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 29 14:58:40 CET 2015 on sn-devel-104

(cherry picked from commit 8aed0fc38ae28cce7fd1a443844a865265fc719c)

Autobuild-User(v4-2-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-2-test): Sun Feb  1 12:39:51 CET 2015 on sn-devel-104

10 years agos3:smb2_server: always try to grant the credits the client just consumed
Stefan Metzmacher [Wed, 28 Jan 2015 14:22:30 +0000 (15:22 +0100)] 
s3:smb2_server: always try to grant the credits the client just consumed

It turns out that the effective credits_requested is always at least 1,
even if the client sends credits_requested == 0.

This means the client is not able to reduce the amount of credits
itself.

Without this fix a client (e.g. Windows7) would reach the case
where it has been granted all credits it asked for.
When copying a large file with a lot of parallel requests,
all these requests have credits_requested == 0.
This means the amount of granted credits where reduced by each
request and only when the granted credits reached 0,
the server granted one credit to allow the client to go on.
The client might require more than one credit ([MS-SMB2] says
Windows clients require at least 4 credits) and freezes
with just 1 credit.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1944c857e59922a2ebfc88a6a824a6ed9396f2d5)

10 years agowafsamba: create unique names when building shared modules
Stefan Metzmacher [Fri, 16 Jan 2015 23:24:53 +0000 (00:24 +0100)] 
wafsamba: create unique names when building shared modules

After commit 76fdcf5c15bd904c3686f0c2dd93d27486c61ca4, we could endup
with bin/default/source3/auth/libauth-samba4.so being created two times.
Once by SAMBA3_LIBRARY('auth',...) and once again by SAMBA3_MODULE('auth_samba4', ...).

As a result bin/default/source3/auth/libauth-samba4.so gets randomly
overwritten.

SAMBA3_MODULE('auth_samba4', ...) results in
bin/default/source3/auth/libauth_module_samba4.so now.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jan 19 04:43:53 CET 2015 on sn-devel-104

(cherry picked from commit 47155641cb48d39d3ee7d8b8962f5ed6b23617d4)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Jan 27 13:22:33 CET 2015 on sn-devel-104

10 years agowafsamba: remove unused variable in SAMBA_MODULE()
Stefan Metzmacher [Fri, 16 Jan 2015 23:24:53 +0000 (00:24 +0100)] 
wafsamba: remove unused variable in SAMBA_MODULE()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
(cherry picked from commit 4da20e2e31790ca54f17b4a6039c24b7b502ac5f)

10 years agowafsamba: passing 'subsystem' to SAMBA_MODULE() is not optional
Stefan Metzmacher [Fri, 16 Jan 2015 23:24:53 +0000 (00:24 +0100)] 
wafsamba: passing 'subsystem' to SAMBA_MODULE() is not optional

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
(cherry picked from commit 85a30cc44070b09de963961ccfa3d7c40144317b)

10 years agowafsamba: make it possible to pass bundled_name to SAMBA_LIBRARY()
Stefan Metzmacher [Fri, 16 Jan 2015 23:24:53 +0000 (00:24 +0100)] 
wafsamba: make it possible to pass bundled_name to SAMBA_LIBRARY()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
(cherry picked from commit 7668e457a6463fb2c1d7499659f37d10ca322190)

10 years agowafadmin: backported the openbsd fixes from waf 1.7
Thomas Nagy [Mon, 16 Sep 2013 22:00:40 +0000 (00:00 +0200)] 
wafadmin: backported the openbsd fixes from waf 1.7

This is a backport from waf 1.5...

Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan  9 02:02:07 CET 2015 on sn-devel-104

(cherry picked from commit 115eb94215f4d9c73d05606de2ad978f6b48d07f)

10 years agowafsamba: remove commented out code.
Michael Adam [Mon, 22 Dec 2014 10:30:21 +0000 (11:30 +0100)] 
wafsamba: remove commented out code.

This code has only ever been there as commented out...

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 9f2979a1a42f4714bdc49d09e4b5094333409834)

10 years agoRevert "waf: added suncc_wrap"
Michael Adam [Mon, 22 Dec 2014 10:27:40 +0000 (11:27 +0100)] 
Revert "waf: added suncc_wrap"

This reverts commit 65743f932b511db009655847e77288c95c0aa525.

Conflicts:
buildtools/wafsamba/samba_optimisation.py

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

10 years agowafsamba: generate an empty.c file if a SAMBA_{LIBRARY,SUBSYSTEM} doesn't have any...
Stefan Metzmacher [Fri, 19 Dec 2014 12:10:30 +0000 (13:10 +0100)] 
wafsamba: generate an empty.c file if a SAMBA_{LIBRARY,SUBSYSTEM} doesn't have any source files

This is better than passing '-' as filename to the compiler/linker.
This replaces commit 65743f932b511db009655847e77288c95c0aa525.

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

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

10 years agowafsamba: flags from enviroment are put before our own internal versions
Ralph Boehme [Fri, 19 Dec 2014 08:05:33 +0000 (09:05 +0100)] 
wafsamba: flags from enviroment are put before our own internal versions

Ensure user provided CPPFLAGS and LDFLAGS are put *behind* our
internally computed compiler and linker flags.

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

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a6bda1f2bc85779feb9680bc74821da5ccd401c5)

10 years agowafsamba: filter out standard library paths from RPATH and LIBPATH
Michael Adam [Thu, 18 Dec 2014 20:36:07 +0000 (21:36 +0100)] 
wafsamba: filter out standard library paths from RPATH and LIBPATH

We should avoid passing them explicitly to the compiler/linker.

We ask the compiler with the '-print-search-dirs' argument
or fallback to [ '/usr/lib', '/usr/lib64' ].

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

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

10 years agowafsamba: fix ordering problems with lib-provided and internal RPATHs
Michael Adam [Thu, 18 Dec 2014 17:09:15 +0000 (18:09 +0100)] 
wafsamba: fix ordering problems with lib-provided and internal RPATHs

When a library or system (like cups) provides an RPATH,
e.g. with -Wl,-R or -Wl,-rpath, this was added by waf
to the LINKFLAGS, wich was later prepended to our RPATH.
But if the path by chance contains an older version of
one of our internal libraries like talloc, this would lead
to linking the too old talloc into our binaries.

This has been observed on, e.g., FreeBSD, but it is a general
problem.

This patch fixes the problem by specially parsing the RPATH
linker options from the pkg-config(, cups-config, ....) output
and putting the paths into the RPATH_<lib> container, which
is then later correctly appended to our internal RPATH.

This is a better fix than commit 64f5e24100a764ec198cab9a8d2c43fa86e7027c
as it touches wafsamba only. 64f5e24100a764ec198cab9a8d2c43fa86e7027c
is already in waf 1.5 upstream, but has some possible bugs,
e.g. it doesn't handle -Wl,-R, (with ',' at the end)
or some combinations where the path is given via an additional
-Wl,/path argument.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

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

10 years agowafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ...
Stefan Metzmacher [Wed, 7 Jan 2015 10:13:04 +0000 (11:13 +0100)] 
wafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ./configure

CFLAGS and LDFLAGS are also used during the configure checks and might impact
their results.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit d744c7c080d81121b84a592a95761e03c2a1090c)

10 years agowafsamba: improve -fvisibility=hidden, we should check it together this WERROR_CFLAGS
Stefan Metzmacher [Wed, 7 Jan 2015 08:16:57 +0000 (09:16 +0100)] 
wafsamba: improve -fvisibility=hidden, we should check it together this WERROR_CFLAGS

GCC ignores -fvisibility=hidden with a warning instead of failing
om some platforms (e.g. Solaris).

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

Based on a patch from Tom Schulz <schulz@adi.com>.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 46fdd6221e9c64b459e0d05e6d02d89deb8dafb5)

10 years agowafsamba: let CURRENT_CFLAGS() use bld.env.VISIBILITY_CFLAGS
Stefan Metzmacher [Wed, 7 Jan 2015 08:58:38 +0000 (09:58 +0100)] 
wafsamba: let CURRENT_CFLAGS() use bld.env.VISIBILITY_CFLAGS

This is better than a hardcoded value in multiple places.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 52eb8854ff8535577c9282f8e4133875fbb0ed33)

10 years agowafsamba: move -fvisibility=hidden checks from lib/replace to wafsamba
Stefan Metzmacher [Wed, 7 Jan 2015 08:56:56 +0000 (09:56 +0100)] 
wafsamba: move -fvisibility=hidden checks from lib/replace to wafsamba

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 4683fc0f1dc5af3bcf81edaebfbd6c8d3b38df9e)

10 years agowafsamba: move '-fstack-protector' checks from lib/replace to wafsamba
Stefan Metzmacher [Wed, 7 Jan 2015 08:54:43 +0000 (09:54 +0100)] 
wafsamba: move '-fstack-protector' checks from lib/replace to wafsamba

This moves the check to the end of the configure run,
which means we no longer use this on configure checks,
but only for the real build.

This behavior is similar than our developer cflags.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 208be32c6a9b275c507fb5e3334b832a3cb9578a)

10 years agowafsamba: move WERROR_CFLAGS checks from lib/replace to wafsamba
Stefan Metzmacher [Wed, 7 Jan 2015 08:52:53 +0000 (09:52 +0100)] 
wafsamba: move WERROR_CFLAGS checks from lib/replace to wafsamba

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0f4ce418ae1410a294aa6e629beea68c6a16aff8)

10 years agowafsamba: move compiler / cflags related stuff from lib/replace to wafsamba
Stefan Metzmacher [Wed, 7 Jan 2015 08:48:38 +0000 (09:48 +0100)] 
wafsamba: move compiler / cflags related stuff from lib/replace to wafsamba

We should have this just in one central place.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 7a3dc668528f398458851aca5d27ff789414343a)

10 years agowafsamba: let TO_LIST(mylist) return a copy of mylist
Stefan Metzmacher [Wed, 7 Jan 2015 08:41:02 +0000 (09:41 +0100)] 
wafsamba: let TO_LIST(mylist) return a copy of mylist

In most cases we have TO_LIST(mystring) which returns an independent
list.

newlist = TO_LIST(mylist) returned just a reference to mylist.
Which means newlist.append("end") would also modify mylist.

TO_LIST() should always return an independent list.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit ab4b988ba2ba85ec2bfb01d7711d6870b3e0f710)

10 years agowafsamba: check for rpath compiler/linker flags
Ralph Boehme [Thu, 18 Dec 2014 05:37:28 +0000 (06:37 +0100)] 
wafsamba: check for rpath compiler/linker flags

Older SunOS linker only support -Wl,-R,/path instead of -Wl,-rpath,/path.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

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

10 years agowafsamba: fill PRIVATE_NAME() logic again
Stefan Metzmacher [Thu, 18 Dec 2014 14:05:12 +0000 (15:05 +0100)] 
wafsamba: fill PRIVATE_NAME() logic again

We append bld.env.PRIVATE_EXTENSION to the name of private libraries
again, but only unless they have a abi_directory, vnum or soname defined.

This avoids naming conflicts with system libraries, e.g. libidmap.so
on Solaris

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

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

10 years agowafsamba: add -Werror=return-type for developer builds
Stefan Metzmacher [Fri, 7 Nov 2014 08:36:16 +0000 (09:36 +0100)] 
wafsamba: add -Werror=return-type for developer builds

This avoids errors like this:

 ../source3/utils/status.c: In function ‘print_share_mode’:
 ../source3/utils/status.c:126:3: error: ‘return’ with no value, in function
 returning non-void [-Werror=return-type]
   return;

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

10 years agoReduce the no-op build times by 30%
Thomas Nagy [Fri, 26 Sep 2014 21:46:01 +0000 (23:46 +0200)] 
Reduce the no-op build times by 30%

Change-Id: Ie68436c1e7c75c1786e9ed6b6a54d2b55abbbcea
Reviewed-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct  3 13:25:18 CEST 2014 on sn-devel-104

(cherry picked from commit 1c5ef289a872cf0dc78b2e9dd35b20fa99db86fb)

10 years agoDon't use a nested function when testing for visibility attribute support.
Jelmer Vernooij [Sat, 8 Nov 2014 16:22:30 +0000 (16:22 +0000)] 
Don't use a nested function when testing for visibility attribute support.

Some compilers support __attribute__((visibility)), but not nested
functions (e.g. http://www.cprover.org/goto-cc/)

Change-Id: I01a5dd6f5f913664621c4090e2dca177527436bb
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749983
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749985
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749986
Signed-Off-By: Jelmer Vernooij <jelmer@debian.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 10 08:29:19 CET 2014 on sn-devel-104

(cherry picked from commit 2afc5b797826780c07e04ed153edc82f410668a2)

10 years agoFix more pep8 issues in code I touched recently.
Jelmer Vernooij [Mon, 2 Jun 2014 00:53:01 +0000 (02:53 +0200)] 
Fix more pep8 issues in code I touched recently.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I35f3204bdf5d00b3280d703427ded2fa2163a6f7

(similar to commit 0c2408531709eb720a2e96f72afbc2ecbfe6b06d)
This only backports the buildtools/wafsamba/ changes

10 years agoRemove last instances of pep8 error E712 (use 'is' rather than '==' for booleans)
Jelmer Vernooij [Mon, 2 Jun 2014 00:36:13 +0000 (02:36 +0200)] 
Remove last instances of pep8 error E712 (use 'is' rather than '==' for booleans)

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I43b394a6225b4c2049d979fda75548c82d781f67
(cherry picked from commit bd6faaf56a6237874cc84ddb8be0f09a9b742a54)

10 years agos3: lib, s3: modules: Fix compilation on Solaris.
Jeremy Allison [Fri, 3 Oct 2014 16:24:04 +0000 (09:24 -0700)] 
s3: lib, s3: modules: Fix compilation on Solaris.

Based on work from YOUZHONG YANG <youzhong@gmail.com>.
Code needs fixing when HAVE_STRUCT_MSGHDR_MSG_CONTROL is
not defined. Also Solaris doesn't have msg_flags field
(which we set to zero anyway, so if we initialize
the entire struct to zero, we never need to refer to it).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct  6 12:33:36 CEST 2014 on sn-devel-104

(cherry picked from commit 57bcb8055eb3e15c4ce7bcdeeef7efed175ed347)

10 years agos4:dsdb/tests: add test_timevalues1() to verify timestamp values
Stefan Metzmacher [Fri, 9 Jan 2015 07:56:59 +0000 (08:56 +0100)] 
s4:dsdb/tests: add test_timevalues1() to verify timestamp values

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jan 24 20:17:20 CET 2015 on sn-devel-104

(cherry picked from commit dc2f91020e3b52942f8aab60fd1db70d2afadd51)

10 years agoldb: version 1.1.20
Stefan Metzmacher [Mon, 19 Jan 2015 16:17:13 +0000 (17:17 +0100)] 
ldb: version 1.1.20

- Bug 9810 - validate_ldb of String(Generalized-Time) does not accept millisecond format ".000Z"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit c7af8ae9d2aa19db2533e69b8a4d7c1b6f8e2d9f)

10 years agolib/ldb: fix logic in ldb_val_to_time()
Stefan Metzmacher [Mon, 19 Jan 2015 14:47:58 +0000 (15:47 +0100)] 
lib/ldb: fix logic in ldb_val_to_time()

040408072012Z should represent 20040408072012.0Z
as well as 20040408072012.000Z or
20040408072012.RandomIgnoredCharaters...Z

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit d1b515535da46591d3a646a848c7427b6ff951a7)

10 years agoRemove use of the "staticforward" macro
Petr Viktorin [Wed, 3 Dec 2014 12:59:58 +0000 (13:59 +0100)] 
Remove use of the "staticforward" macro

This macro was used for compatibility with broken compilers.
Since Python 2.3, it is always defined as `static`, and only exists
"for source compatibility with old C extensions".

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 02980268e8641a1558c6f475d4669ce4d663504d)

10 years agoldb: bump to version 1.1.19
Andrew Bartlett [Fri, 19 Dec 2014 02:25:03 +0000 (15:25 +1300)] 
ldb: bump to version 1.1.19

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit 02f6ab85a0dcec59c12384a8738eecf7d322071f)

10 years agoldb: Allow to register extended match rules
Samuel Cabrero [Wed, 5 Nov 2014 10:02:25 +0000 (11:02 +0100)] 
ldb: Allow to register extended match rules

This allows to extend LDB by registering extended match rules from outside
the library itself. This is necessary when the implementation requires
knowledge about syntaxes implemented in samba extensions, like the
LDAP_MATCHING_RULE_TRANSITIVE_EVAL match.

Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Singed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit faa4be0535fd41bf282b1afc749a05412f4ee96c)

10 years agos3-pam_smbpass: Fix memory leak in pam_sm_authenticate().
Andreas Schneider [Thu, 22 Jan 2015 09:27:59 +0000 (10:27 +0100)] 
s3-pam_smbpass: Fix memory leak in pam_sm_authenticate().

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 0cb9b28acb7008cd30c6de3add9876eb5607a5a6)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sun Jan 25 00:37:52 CET 2015 on sn-devel-104

10 years agoutils: Fix 'net time' segfault.
Andreas Schneider [Tue, 13 Jan 2015 16:04:26 +0000 (17:04 +0100)] 
utils: Fix 'net time' segfault.

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

This is part two of the bugfix. Make sure we pass the IP we found to
cli_servertime(). Hence we always pass at least one of name or IP.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 45829800eb3f3a8aeccfe7c1114dcf9df60371d5)

10 years agocli_connect_nb_send: don't segfault on host == NULL.
Michael Adam [Fri, 16 Jan 2015 15:18:45 +0000 (16:18 +0100)] 
cli_connect_nb_send: don't segfault on host == NULL.

The functions called futher down can cope with host == NULL.

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

This is part one of the bugfix:
This ensures that it is enough to pass one of host or address to the function.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

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

10 years agovfs_snapper: encode and decode Snapper DBus strings
David Disseldorp [Wed, 21 Jan 2015 17:16:57 +0000 (18:16 +0100)] 
vfs_snapper: encode and decode Snapper DBus strings

Snapper uses a special character encoding for strings used in DBus
requests and responses. This change ensures that Samba packs and unpacks
strings in the corresponding format, using the previously added
encode/decode helper functions.

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

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

10 years agovfs_snapper: add DBus string encoding and decoding helpers
David Disseldorp [Wed, 21 Jan 2015 17:16:56 +0000 (18:16 +0100)] 
vfs_snapper: add DBus string encoding and decoding helpers

Snapper uses the following mechanism for encoding and decoding strings
used in DBus traffic:
Characters above 127 (0x7F - ASCII DEL) must be encoded hexadecimal as
"\x??". As a consequence "\" must be encoded as "\\".

This change adds string encoding and decoding helpers to vfs_snapper.

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

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

10 years agovfs_snapper: free dbus req messages in error paths
David Disseldorp [Wed, 21 Jan 2015 17:16:55 +0000 (18:16 +0100)] 
vfs_snapper: free dbus req messages in error paths

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

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

10 years agos3-vfs: Fix developer build of vfs_ceph module.
Günther Deschner [Fri, 9 Jan 2015 11:54:51 +0000 (12:54 +0100)] 
s3-vfs: Fix developer build of vfs_ceph module.

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

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 5deb685ecd6f611bcf357f7040dc62582a50d2aa)

10 years agovfs_glusterfs: Add comments to the pipe(2) code.
Ira Cooper [Thu, 22 Jan 2015 22:14:31 +0000 (17:14 -0500)] 
vfs_glusterfs: Add comments to the pipe(2) code.

The guarantees around read(2) and write(2) and pipes are critical
to understanding this code.  Hopefully these comments will help.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 23 20:58:51 CET 2015 on sn-devel-104

(cherry picked from commit 3b2d8bdbb1851961536241d3aaaf6ac936964517)

The last 10 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11069
Backport remaining performance patches for vfs_glusterfs to 4.2/4.1.

10 years agovfs: Fix a typo
Volker Lendecke [Wed, 21 Jan 2015 19:49:24 +0000 (20:49 +0100)] 
vfs: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 22 13:14:38 CET 2015 on sn-devel-104

(cherry picked from commit db63e4887c81c3e458194004353d7ef92c67b393)

10 years agovfs:glusterfs: whitespace fix.
Michael Adam [Wed, 21 Jan 2015 21:07:53 +0000 (22:07 +0100)] 
vfs:glusterfs: whitespace fix.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 22 03:20:17 CET 2015 on sn-devel-104

(cherry picked from commit cde5d380e192487ae77734afcb3eb3d327aafb98)

10 years agovfs_glusterfs: Replace eventfd with pipes, for AIO use
Ira Cooper [Tue, 20 Jan 2015 04:08:17 +0000 (23:08 -0500)] 
vfs_glusterfs: Replace eventfd with pipes, for AIO use

Pipes clean up the AIO implementation substantially, due to the fact
that they implement a natural ithread safe queue instead of us
creating our own queue.

Signed-off-by: Ira Cooper <ira@samba.org>
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Wed Jan 21 20:40:11 CET 2015 on sn-devel-104

(cherry picked from commit 4c3a3d9e6adc95d0f0e1f6030b2406613d9f9f53)

10 years agovfs/glusterfs: Change xattr key to match gluster key.
raghavendra talur [Wed, 10 Dec 2014 15:45:03 +0000 (21:15 +0530)] 
vfs/glusterfs: Change xattr key to match gluster key.

Gluster changed the key used to do get_real_filename
in 3.5. This changes Samba's glusterfs vfs-module
to use the same key.

This will render SMB_VFS_GET_REALFILENAME() working
again under 3.5 and will remove support for that functionality
for Gluster 3.4 and older.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit af9ec9fea5a730023cdee6e236f9585e3a18b0e6)

10 years agovfs_glusterfs: Implement AIO support
Poornima G [Thu, 11 Dec 2014 02:05:10 +0000 (07:35 +0530)] 
vfs_glusterfs: Implement AIO support

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 17 16:35:37 CET 2014 on sn-devel-104

(cherry picked from commit 051b81aac81c7ccb234da221e9f8272b70b265ce)

10 years agovfs_glusterfs: Change sys_get_acl_file/fd to return ACLs corresponding to mode bits...
Poornima G [Fri, 12 Dec 2014 13:11:49 +0000 (14:11 +0100)] 
vfs_glusterfs: Change sys_get_acl_file/fd to return ACLs corresponding to mode bits when there are no ACLs set.

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 26b3544251babdfcdf5ada338a4ed39ff18bc47a)

10 years agovfs_glusterfs: Set connectpath as snapdir-entry-path.
raghavendra talur [Wed, 10 Dec 2014 07:00:10 +0000 (12:30 +0530)] 
vfs_glusterfs: Set connectpath as snapdir-entry-path.

snapview client in gluster would require connectpath
in order add snapdir entry to readdir result.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 10 16:38:27 CET 2014 on sn-devel-104

(cherry picked from commit a12ae815b01b372cbf8697d32d5d45d7b2d5f93d)

10 years agovfs_glusterfs: Remember the connect path too for reopening.
raghavendra talur [Wed, 10 Dec 2014 06:56:34 +0000 (12:26 +0530)] 
vfs_glusterfs: Remember the connect path too for reopening.

As Samba allows us to share subdirs, lets re-use preopened
connections to glusterfs only if they are for same volume
AND same connectpath.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 2fb4317352a165d0dd4af78fcf0a576fa246eab2)

10 years agovfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr...
Poornima G [Thu, 30 Oct 2014 11:44:51 +0000 (17:14 +0530)] 
vfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr calls.

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit a4fa9ca5a7a4c0b770079ab126f8172ff6d6851c)

10 years agolibsmb: provide authinfo domain for encrypted session referrals
David Disseldorp [Mon, 19 Jan 2015 12:39:35 +0000 (13:39 +0100)] 
libsmb: provide authinfo domain for encrypted session referrals

6c9de0cd056afc0b478c02f1bdb0e06532388037 requires this extra change.

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>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 21 04:29:06 CET 2015 on sn-devel-104

(cherry picked from commit 6da86012a2ca521efe0cf1bf05fcd04c3099b190)

10 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.2 rebase with cli_init_creds() call]

10 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)

10 years agosamba3.py: Correctly initialize cache directory for passdb test
Christof Schmitt [Thu, 15 Jan 2015 21:31:19 +0000 (14:31 -0700)] 
samba3.py: Correctly initialize cache directory for passdb test

Running 'make test TESTS=tests.samba3' succeeds, but the log shows that
it tried to open the gencache tdb in the wrong directory:
Unable to create directory /usr/local/samba/var/cache for file gencache.tdb. Error was No such file or directory

Fix this by correctly initializing the cache directory.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Fri Jan 16 02:36:39 CET 2015 on sn-devel-104
(cherry picked from commit c31f54112e21b2e76398a402e864a2b6b6c74e6c)

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

10 years agogencache: Request mutexes for gencache_notrans.tdb
Christof Schmitt [Mon, 17 Nov 2014 21:59:34 +0000 (14:59 -0700)] 
gencache: Request mutexes for gencache_notrans.tdb

The check in tdb_wrap ensures that mutexes are only used on systems that
properly support them.

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): Wed Nov 26 19:04:11 CET 2014 on sn-devel-104
(cherry picked from commit 068f9e26486fbcd36c109df9ada50c9384ba52c5)

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

10 years agogencache: Convert gencache.tdb to tdb_wrap
Christof Schmitt [Mon, 17 Nov 2014 22:44:47 +0000 (15:44 -0700)] 
gencache: Convert gencache.tdb to tdb_wrap

This change is not strictly necessary, but for consistency both gencache
tdbs are now opened through tdb_wrap.

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

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

10 years agogencache: Convert gencache_notrans to use tdb_wrap
Christof Schmitt [Mon, 17 Nov 2014 21:30:49 +0000 (14:30 -0700)] 
gencache: Convert gencache_notrans to use tdb_wrap

This allows using on the mutex check in tdb_wrap.

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

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

10 years agos3:gencache: don't use transaction non non-persistent gencache_notrans.tdb
Michael Adam [Wed, 2 Jul 2014 05:44:04 +0000 (07:44 +0200)] 
s3:gencache: don't use transaction non non-persistent gencache_notrans.tdb

gencache_notrans.tdb is a non-persistent cache layer above the
persistent gencache.tdb. Despite its name, and despite the
nature of non-persistent tdbs, the current stabilization code
uses a transaction on gencache_notrans.tdb like this:

  transaction_start(cache)
  transaction_start(cache_notrans)
  traverse(cache_notrans, stabilize_fn)
  transaction_commit(cache)
  transaction_commit(cache_notrans)

where stabilze_fn does this on a record:
  1. store it to or delete it from cache
     (depending on the timeout)
  2. delete it from the cache_notrans

This patch changes gencache_notrans.tdb to avoid
transactions by using an all-record lock like this:

  tdb_allrecord_lock(cache_notrans)
  transaction_start(cache)
  traverse(cache_notrans, stabilize_fn_mod)
  transaction_commit(cache)
  traverse(cache_notrans, wipe_fn)
  tdb_wipe_all(cache_notrans)
  tdb_allrecord_unlock(cache_notrans)

with stabilize_fn_mod doing only:
  1. store the record to or delete it from cache
     (depending on the timeout)

and wipe_fn deleting the records from the gencache_notrans db.

This is a step towards making non-persistent-db specific features
like mutex locking usable for gencache_notrans.tdb.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 35fd2ca4984b3a1a8bbcb5c1c9e0d724e3c63d80)

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

10 years agos3:gencache: simply stabilize() a bit more: remove error from state
Michael Adam [Thu, 26 Jun 2014 14:56:41 +0000 (16:56 +0200)] 
s3:gencache: simply stabilize() a bit more: remove error from state

state.error is set to true if and only if the traverse
callback returns error (-1), and hence only if the traverse
fails.

Hence the the error state is redundant.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit d240cf7894f076a2ed2b6bc434f20a93cfbb1ca4)

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

10 years agos3:gencache: fix logic in stabilization when deleting a record from stable cache
Michael Adam [Thu, 26 Jun 2014 14:37:17 +0000 (16:37 +0200)] 
s3:gencache: fix logic in stabilization when deleting a record from stable cache

Set state->written = true in the delete case
if and only if the record has really been deleted.

This does currently not seem to lead to an unneeded
write to the DB, since failure to delete the record
will cause the traverse and hence the transaction
to cancel. But I think this is clearer.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 202ee81e869f4b51e1f904ef6ac3fb0030edfede)

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

10 years agolib: Use tdb_parse_record in gencache_set
Volker Lendecke [Tue, 25 Nov 2014 21:03:18 +0000 (21:03 +0000)] 
lib: Use tdb_parse_record in gencache_set

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 26 14:50:38 CET 2014 on sn-devel-104
(cherry picked from commit ec0c9ad0994d35e22ecc50e552d14582c51622b1)

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

10 years agos3: auth - tests: Add test for "force user" being a unix-only user, not in passdb.
Jeremy Allison [Tue, 13 Jan 2015 21:49:58 +0000 (13:49 -0800)] 
s3: auth - tests: Add test for "force user" being a unix-only user, not in passdb.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 14 08:46:08 CET 2015 on sn-devel-104

(cherry picked from commit d098b6c877629af0f23070481deaccdf65acd249)

Autobuild-User(v4-2-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-2-test): Fri Jan 23 11:04:50 CET 2015 on sn-devel-104

10 years agos3: auth: Add previously missing allocation fail check.
Jeremy Allison [Tue, 13 Jan 2015 21:49:36 +0000 (13:49 -0800)] 
s3: auth: Add previously missing allocation fail check.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 83066ed539658a9fa6deb897b15b20a0624227fe)

10 years agos3: auth: Plumb in the SamInfo3_handle_sids() utility function into passwd_to_SamInfo3().
Jeremy Allison [Tue, 13 Jan 2015 21:45:16 +0000 (13:45 -0800)] 
s3: auth: Plumb in the SamInfo3_handle_sids() utility function into passwd_to_SamInfo3().

Core fix for:

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

Based on code from Michael Zeis <mzeis.quantum@gmail.com>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 60895e62fe21e41cf4a09ec8a92239b8f015b450)