samba.git
10 years agobug #10471: Don't respond with NXDOMAIN to records that exist with another type
Kai Blin [Thu, 27 Feb 2014 22:49:24 +0000 (23:49 +0100)]
bug #10471: Don't respond with NXDOMAIN to records that exist with another type

DNS queries for records with the wrong type need to trigger an empty
response with RCODE_OK instead of returning NXDOMAIN.

This adds a test and fixes bug #10471

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d9829df13317b38677d92a499134727ab31fbb0e)

10 years agos3: smbd: Fileserving share access checks.
Jeremy Allison [Mon, 17 Mar 2014 21:35:00 +0000 (14:35 -0700)]
s3: smbd: Fileserving share access checks.

Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579
fixed share_access not being reset between users,
by changing make_connection_snum() to call a common
function check_user_share_access() in the same way
that change_to_user() (which can be called on any
incoming packet) does.

Unfortunately that bugfix was incorrect and
broke "force user" and "force group" as it
called check_user_share_access() inside
make_connection_snum() using the conn->session_info
pointer instead of the vuser->session_info pointer.

conn->session_info represents the token to use
when actually accessing the file system, and so
is modified by force user and force group.

vuser->session_info represents the "pristine"
token of the user logging in, and is never modified
by force user and force group.

Samba 3.6.x checked the share access based on
the "pristine" token of the user logging in,
not the token modified by force user and force group.
This change restores the expected behavior.

Fixes bug #9878 - force user does not work as expected

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

Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agosmbreadline: switch to new-style readline typedef
Gustavo Zacarias [Thu, 6 Mar 2014 21:57:40 +0000 (18:57 -0300)]
smbreadline: switch to new-style readline typedef

Function, CPFunction, CPPFunction and VFunction typedefs are considered
old-style (deprecated) starting from readline 4.2 (circa 2001).
Compatibility typedefs have been in place up to readline 6.2 but were
removed with the 6.3 release thus causing builds to break.
Switch to the new-style specific prototyped typedef.

Return value is unused so the callback should still be void (see
readline/input.c around line 456 in version 6.3).

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 13 00:21:47 CET 2014 on sn-devel-104

(cherry picked from commit 29d779c7029f89e530994c45ae065707ffd62c43)

Fix bug #10506 - smbreadline doesn't build with readline 6.3.

10 years agos4:lib/socket: simplify iface_list_wildcard() and its callers
Stefan Metzmacher [Thu, 27 Feb 2014 09:28:23 +0000 (10:28 +0100)]
s4:lib/socket: simplify iface_list_wildcard() and its callers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Change-Id: Ib317d71dea01fc8ef6b6a26455f15a8a175d59f6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar  7 02:18:17 CET 2014 on sn-devel-104
(cherry picked from commit f7883ae02a4e8935a44396f776712cebfd411e52)

10 years agos4:lib/socket: use the same logic in iface_list_wildcard() as in smbd
Stefan Metzmacher [Thu, 27 Feb 2014 09:18:35 +0000 (10:18 +0100)]
s4:lib/socket: use the same logic in iface_list_wildcard() as in smbd

If we have ipv6 support we should listen on "::" too.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Change-Id: I8ce185d5070280149bee9fd33010443be9031089
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a571fe520d09a00273a58b1fb0fa9aab8e0aefce)

10 years agos3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE
Stefan Metzmacher [Fri, 6 Dec 2013 12:56:12 +0000 (13:56 +0100)]
s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar  5 22:53:34 CET 2014 on sn-devel-104
(cherry picked from commit 032621d5bf842e60dc9cd1cd0d3acc90482462a6)

10 years agos3:smbd: fix the maxentries calculation depending on the max_send.
Stefan Metzmacher [Wed, 5 Mar 2014 13:03:42 +0000 (14:03 +0100)]
s3:smbd: fix the maxentries calculation depending on the max_send.

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

10 years agos3:smbd: simplify maxentries calculation in reply_search()
Stefan Metzmacher [Wed, 5 Mar 2014 13:00:40 +0000 (14:00 +0100)]
s3:smbd: simplify maxentries calculation in reply_search()

Using helper variables make it much easier to understand.

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

10 years agos3:smbd: fix the read numtoread calculation depending on the max_send.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix the read numtoread calculation depending on the max_send.

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

10 years agos3:smbd: fix the lockread numtoread calculation depending on the max_send.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix the lockread numtoread calculation depending on the max_send.

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

10 years agos3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.

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

10 years agos3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.

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

10 years agos3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.c
Stefan Metzmacher [Fri, 6 Dec 2013 12:53:45 +0000 (13:53 +0100)]
s3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.c

We're now sure that sconn->smb1.sessions.max_send is >= SMB_BUFFER_SIZE_MIN.
in order to garantee some progress we need to make sure our assumed
header overhead is less than SMB_BUFFER_SIZE_MIN.

Assuming 372 bytes for the SMBtrans headers should still be more than
enough.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2ec49cf57c88735be962b0681b487df5efe7ed6b)

10 years agos3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session setup request
Stefan Metzmacher [Fri, 6 Dec 2013 12:52:09 +0000 (13:52 +0100)]
s3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session setup request

This makes sure sconn->smb1.sessions.max_send is always >= SMB_BUFFER_SIZE_MIN.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit cce1eaea91088efd742891befdaafade0c1fdce6)

10 years agos3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX
Stefan Metzmacher [Fri, 6 Dec 2013 12:50:49 +0000 (13:50 +0100)]
s3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX

SMB_BUFFER_SIZE_MAX is UINT16_MAX and the largest value a client
can possibly specify in the session setup request.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5cd5c1613996ecebdcd632e932957947f4c27308)

10 years agos3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()
Stefan Metzmacher [Fri, 6 Dec 2013 12:45:35 +0000 (13:45 +0100)]
s3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()

The current limit of 128*1024 causes problems as the value has to be
<= UINT16_MAX otherwise some clients get confused, as they want to
use the MaxBufferSize value from the negprot response (uint32_t)
for the MaxBufferSize value in thet session setup request (uint16_t).
E.g. Windows 7 (as client) sends MaxBufferSize = 0 if the server value
is > UINT16_MAX.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a349b0bef9085fd139640ec92399bc63d8029cb9)

10 years agos3:include: let CLI_BUFFER_SIZE be an alias of SMB_BUFFER_SIZE_MAX
Stefan Metzmacher [Fri, 6 Dec 2013 12:57:15 +0000 (13:57 +0100)]
s3:include: let CLI_BUFFER_SIZE be an alias of SMB_BUFFER_SIZE_MAX

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7f3faa1f1837870195352253fe220e0677565d9e)

10 years agolibcli/smb: add SMB_BUFFER_SIZE_MIN/MAX defines
Stefan Metzmacher [Fri, 6 Dec 2013 12:28:35 +0000 (13:28 +0100)]
libcli/smb: add SMB_BUFFER_SIZE_MIN/MAX defines

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 900839e2216048a614f2f0aeb1f79092fc93334f)

10 years agos3:param: avoid using BUFFER_SIZE to limit the lp_min_receive_file_size()
Stefan Metzmacher [Wed, 19 Feb 2014 12:59:07 +0000 (13:59 +0100)]
s3:param: avoid using BUFFER_SIZE to limit the lp_min_receive_file_size()

There's really no reason to add such limit.

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

10 years agos3:client: only limit the buffer by the given length 'n'
Stefan Metzmacher [Wed, 19 Feb 2014 12:57:28 +0000 (13:57 +0100)]
s3:client: only limit the buffer by the given length 'n'

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

10 years agos3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZE
Stefan Metzmacher [Wed, 19 Feb 2014 12:56:06 +0000 (13:56 +0100)]
s3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZE

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

10 years agos3:utils/smbfilter: use a local variable for the packet buffer
Stefan Metzmacher [Wed, 19 Feb 2014 12:54:44 +0000 (13:54 +0100)]
s3:utils/smbfilter: use a local variable for the packet buffer

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

10 years agos4: smbtorture: Add a proper change_notify going async followed by tdis test.
Jeremy Allison [Mon, 24 Feb 2014 18:44:59 +0000 (10:44 -0800)]
s4: smbtorture: Add a proper change_notify going async followed by tdis test.

[Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 12 20:12:58 CET 2014 on sn-devel-104

(cherry picked from commit 9c677fff0bb0abc8d19dd67c33b3e044b1a9862e)

10 years agos4: smbtorture: Update the torture_smb2_notify_ulogoff test to demonstrate the problem.
Jeremy Allison [Tue, 28 Jan 2014 22:07:26 +0000 (14:07 -0800)]
s4: smbtorture: Update the torture_smb2_notify_ulogoff test to demonstrate the problem.

[Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd.

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

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

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

10 years agos3:smb2_tcon: cancel and wait for pending requests on tdis
Stefan Metzmacher [Mon, 10 Mar 2014 08:53:18 +0000 (09:53 +0100)]
s3:smb2_tcon: cancel and wait for pending requests on tdis

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10344
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 95f96a81083be578ee638c0cebd590228d9a4424)

10 years agos3:smb2_sesssetup: cancel and wait for pending requests on logoff
Stefan Metzmacher [Mon, 10 Mar 2014 08:53:18 +0000 (09:53 +0100)]
s3:smb2_sesssetup: cancel and wait for pending requests on logoff

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

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

10 years agos3:smb2_tcon: split smbd_smb2_tdis into an async *_send/recv pair.
Jeremy Allison [Mon, 10 Mar 2014 08:53:18 +0000 (09:53 +0100)]
s3:smb2_tcon: split smbd_smb2_tdis into an async *_send/recv pair.

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

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 195c2d84807a7580e90e288cc813a6c6ca596055)
Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_sesssetup: split smbd_smb2_logoff into an async *_send/recv pair.
Jeremy Allison [Mon, 10 Mar 2014 08:53:18 +0000 (09:53 +0100)]
s3:smb2_sesssetup: split smbd_smb2_logoff into an async *_send/recv pair.

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

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 506817dfc9d18c2c5c35d60a6e61a82917665e2d)
Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_lock: return RANGE_NOT_LOCKED instead of CANCELLED for logoff and tdis
Stefan Metzmacher [Mon, 10 Mar 2014 08:47:11 +0000 (09:47 +0100)]
s3:smb2_lock: return RANGE_NOT_LOCKED instead of CANCELLED for logoff and tdis

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

10 years agos3:smb2_lock: fix whitespaces/tabs in smbd_smb2_lock_cancel()
Stefan Metzmacher [Mon, 10 Mar 2014 08:43:35 +0000 (09:43 +0100)]
s3:smb2_lock: fix whitespaces/tabs in smbd_smb2_lock_cancel()

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

10 years agos4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis
Stefan Metzmacher [Fri, 7 Mar 2014 11:31:19 +0000 (12:31 +0100)]
s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis

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

10 years agos3: lib: Back-port tevent_queue_wait_send/recv -> smbd_tevent_queue_wait_send/recv
Jeremy Allison [Thu, 13 Mar 2014 17:06:48 +0000 (10:06 -0700)]
s3: lib: Back-port tevent_queue_wait_send/recv -> smbd_tevent_queue_wait_send/recv

Required for bugfix:

[Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agotevent: fix crash bug in tevent_queue_immediate_trigger()
Stefan Metzmacher [Sat, 11 Jan 2014 07:58:05 +0000 (08:58 +0100)]
tevent: fix crash bug in tevent_queue_immediate_trigger()

Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()).
If triggerA() removes itself tevent_queue_entry_destructor() will be called
for A, this schedules the immediate event to call triggerB().
If triggerA() then also removes B by an explicit of implizit talloc_free(),
q->list is NULL, but the immediate event is still scheduled and can't be unscheduled.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 7fe5584e2a59584431cb2ddf8a4da22bfb924454)

10 years agoMerge tag 'samba-4.1.6' into v4-1-test
Stefan Metzmacher [Tue, 11 Mar 2014 19:50:47 +0000 (20:50 +0100)]
Merge tag 'samba-4.1.6' into v4-1-test

Signed-off-by: Stefan Metzmacher <metze@samba.org>
10 years agoVERSION: Bump version number up to 4.1.7.
Karolin Seeger [Tue, 11 Mar 2014 18:34:09 +0000 (19:34 +0100)]
VERSION: Bump version number up to 4.1.7.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.1.6 release.
Karolin Seeger [Tue, 11 Mar 2014 11:42:27 +0000 (12:42 +0100)]
VERSION: Disable git snapshots for the 4.1.6 release.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10245
CVE-2013-4496: Enforce password lockout for SAMR password
changes.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
CVE-2013-6442: ensure we don't lose an existing ACL when
setting owner or group owner.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.1.6.
Karolin Seeger [Tue, 11 Mar 2014 11:40:13 +0000 (12:40 +0100)]
WHATSNEW: Add release notes for Samba 4.1.6.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10245
CVE-2013-4496: Password lockout not enforced for SAMR password
changes.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
CVE-2013-6442: smbcacls --chown | --chgrp dacl regression

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoCVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when setting owner...
Jeremy Allison [Wed, 18 Dec 2013 21:56:18 +0000 (13:56 -0800)]
CVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when setting owner or group owner.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
Bug 10327 - CVE-2013-6442: smbcacls --chown | --chgrp dacl regression

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4496:Revert remainder of ce895609b04380bfc41e4f8fddc84bd2f9324340
Andrew Bartlett [Wed, 27 Nov 2013 17:50:01 +0000 (06:50 +1300)]
CVE-2013-4496:Revert remainder of ce895609b04380bfc41e4f8fddc84bd2f9324340

Part of this was removed when ChangePasswordUser was unimplemented,
but remove the remainder of this flawed commit.  Fully check the
password first, as extract_pw_from_buffer() already does a partial
check of the password because it needs a correct old password to
correctly decrypt the length.

Andrew Bartlett

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4496:samr: Remove ChangePasswordUser
Andrew Bartlett [Tue, 5 Nov 2013 03:16:46 +0000 (16:16 +1300)]
CVE-2013-4496:samr: Remove ChangePasswordUser

This old password change mechanism does not provide the plaintext to
validate against password complexity, and it is not used by modern
clients.

The missing features in both implementations (by design) were:

 - the password complexity checks (no plaintext)
 - the minimum password length (no plaintext)

Additionally, the source3 version did not check:

 - the minimum password age
 - pdb_get_pass_can_change() which checks the security
   descriptor for the 'user cannot change password' setting.
 - the password history
 - the output of the 'passwd program' if 'unix passwd sync = yes'.

Finally, the mechanism was almost useless, as it was incorrectly
only made available to administrative users with permission
to reset the password.  It is removed here so that it is not
mistakenly reinstated in the future.

Andrew Bartlett

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4496:s3:auth: fix memory leak in the ACCOUNT_LOCKED_OUT case.
Stefan Metzmacher [Tue, 5 Nov 2013 13:04:20 +0000 (14:04 +0100)]
CVE-2013-4496:s3:auth: fix memory leak in the ACCOUNT_LOCKED_OUT case.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoCVE-2013-4496:s3-samr: Block attempts to crack passwords via repeated password changes
Andrew Bartlett [Fri, 1 Nov 2013 01:55:44 +0000 (14:55 +1300)]
CVE-2013-4496:s3-samr: Block attempts to crack passwords via repeated password changes

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.1.6 release. samba-4.1.6
Karolin Seeger [Tue, 11 Mar 2014 11:42:27 +0000 (12:42 +0100)]
VERSION: Disable git snapshots for the 4.1.6 release.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10245
CVE-2013-4496: Enforce password lockout for SAMR password
changes.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
CVE-2013-6442: ensure we don't lose an existing ACL when
setting owner or group owner.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.1.6.
Karolin Seeger [Tue, 11 Mar 2014 11:40:13 +0000 (12:40 +0100)]
WHATSNEW: Add release notes for Samba 4.1.6.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10245
CVE-2013-4496: Password lockout not enforced for SAMR password
changes.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
CVE-2013-6442: smbcacls --chown | --chgrp dacl regression

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoCVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when setting owner...
Jeremy Allison [Wed, 18 Dec 2013 21:56:18 +0000 (13:56 -0800)]
CVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when setting owner or group owner.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
Bug 10327 - CVE-2013-6442: smbcacls --chown | --chgrp dacl regression

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4496:Revert remainder of ce895609b04380bfc41e4f8fddc84bd2f9324340
Andrew Bartlett [Wed, 27 Nov 2013 17:50:01 +0000 (06:50 +1300)]
CVE-2013-4496:Revert remainder of ce895609b04380bfc41e4f8fddc84bd2f9324340

Part of this was removed when ChangePasswordUser was unimplemented,
but remove the remainder of this flawed commit.  Fully check the
password first, as extract_pw_from_buffer() already does a partial
check of the password because it needs a correct old password to
correctly decrypt the length.

Andrew Bartlett

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4496:samr: Remove ChangePasswordUser
Andrew Bartlett [Tue, 5 Nov 2013 03:16:46 +0000 (16:16 +1300)]
CVE-2013-4496:samr: Remove ChangePasswordUser

This old password change mechanism does not provide the plaintext to
validate against password complexity, and it is not used by modern
clients.

The missing features in both implementations (by design) were:

 - the password complexity checks (no plaintext)
 - the minimum password length (no plaintext)

Additionally, the source3 version did not check:

 - the minimum password age
 - pdb_get_pass_can_change() which checks the security
   descriptor for the 'user cannot change password' setting.
 - the password history
 - the output of the 'passwd program' if 'unix passwd sync = yes'.

Finally, the mechanism was almost useless, as it was incorrectly
only made available to administrative users with permission
to reset the password.  It is removed here so that it is not
mistakenly reinstated in the future.

Andrew Bartlett

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoCVE-2013-4496:s3:auth: fix memory leak in the ACCOUNT_LOCKED_OUT case.
Stefan Metzmacher [Tue, 5 Nov 2013 13:04:20 +0000 (14:04 +0100)]
CVE-2013-4496:s3:auth: fix memory leak in the ACCOUNT_LOCKED_OUT case.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoCVE-2013-4496:s3-samr: Block attempts to crack passwords via repeated password changes
Andrew Bartlett [Fri, 1 Nov 2013 01:55:44 +0000 (14:55 +1300)]
CVE-2013-4496:s3-samr: Block attempts to crack passwords via repeated password changes

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoVERSION: Bump version number up to 4.1.6...
Karolin Seeger [Fri, 21 Feb 2014 09:21:08 +0000 (10:21 +0100)]
VERSION: Bump version number up to 4.1.6...

and re-enable git snapshots.

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

10 years agos3-spoolssd: Don't register spoolssd if epmd is not running.
Andreas Schneider [Thu, 27 Feb 2014 08:58:27 +0000 (09:58 +0100)]
s3-spoolssd: Don't register spoolssd if epmd is not running.

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

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

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Mon Mar 10 18:34:41 CET 2014 on sn-devel-104

10 years agos3-vfs: Fix stream_depot vfs module on btrfs.
Andreas Schneider [Fri, 8 Nov 2013 14:41:18 +0000 (15:41 +0100)]
s3-vfs: Fix stream_depot vfs module on btrfs.

Checking if the directory is empty using 'nlink == 2' only checks if
there are no subdirectories. It doesn't indicate if there are files in
the directory. However checking link count for no subdirectories is
wrong and applications shouldn't rely on it, see:

https://lkml.org/lkml/2012/2/1/756

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

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

10 years agos3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()
Gregor Beck [Thu, 20 Feb 2014 10:25:53 +0000 (11:25 +0100)]
s3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()

As a domain member we should always use a DC of our own domain.

It would be possible to pass all sids in one single dcerpc_wbint_LookupSids()
call. For now we just fix bug.

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

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 66fb0ce9557553a4c01607b517e65ac4c93841d0)

10 years agos3:winbindd: fix _wbint_LookupSids() on error
Gregor Beck [Thu, 20 Feb 2014 12:14:31 +0000 (13:14 +0100)]
s3:winbindd: fix _wbint_LookupSids() on error

We need to make sure that r->out.domains remains valid,
otherwise we're not able to marshall the response.

Note that wbint_LookupSids() has [out,ref] lsa_RefDomainList *domains,
while lsa_LookupSids() has [out,ref] lsa_RefDomainList **domains.

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

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 3413e64149702136429d7b5acaa7a52c49abf564)

10 years agopidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers
Stefan Metzmacher [Wed, 25 Sep 2013 23:20:10 +0000 (01:20 +0200)]
pidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit f50b561336c7b6c08300e6e477859d1f9fab62c2)

10 years agos3: smbd: Ensure brl_get_locks_internal() always returns a valid struct byte_range_lo...
Jeremy Allison [Fri, 28 Feb 2014 00:19:53 +0000 (16:19 -0800)]
s3: smbd: Ensure brl_get_locks_internal() always returns a valid struct byte_range_lock even if there are no locks.

brl_get_locks_internal() currently returns NULL when it can't
find any byte range locks on the file. This is an error - it
should return a valid struct byte_range_lock containing num_locks == 0
so it can be cached.

Returning NULL when there are no locks causes POSIX lock
tests to fail returning NT_STATUS_NO_MEMORY (as it thinks
it can't allocate the struct) instead of NT_STATUS_OK.

This is a back-port of git commit abf08ed544ce05ea5a6e6ea2e531b6a2d97e15cc
that went into master.

Fixes bug:

Bug 10431 - STATUS_NO_MEMORY response from Query File Posix Lock request

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

Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agodoc: add "spoolss: architecture" parameter usage
David Disseldorp [Mon, 14 Oct 2013 10:01:58 +0000 (12:01 +0200)]
doc: add "spoolss: architecture" parameter usage

Windows spoolss print clients only allow association of server-side
drivers with printers when the driver architecture matches the
advertised print server architecture. Samba's spoolss print server
architecture can be changed using this parameter.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Oct 16 17:12:34 CEST 2013 on sn-devel-104

(cherry picked from commit b92937e64ed7ce3c7cdd4da0e263c7a53da45c49)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10188
spoolss: architecture is undocumented

10 years agos3-printing: Fix obvious memory leak in printer_list_get_printer().
Jeremy Allison [Tue, 25 Feb 2014 00:18:31 +0000 (16:18 -0800)]
s3-printing: Fix obvious memory leak in printer_list_get_printer().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Feb 25 13:19:37 CET 2014 on sn-devel-104

(cherry picked from commit 148bbdd8d04400b5d873f636671dd443952ca04f)

10 years agorpc_client: retry open on STATUS_PIPE_NOT_AVAILABLE
David Disseldorp [Mon, 3 Mar 2014 18:49:35 +0000 (19:49 +0100)]
rpc_client: retry open on STATUS_PIPE_NOT_AVAILABLE

Windows Server starts some named pipe services on demand, and responds
to initial open requests with STATUS_PIPE_NOT_AVAILABLE. The FssagentRpc
named pipe on Windows Server 2012 exhibits this behaviour.

This change sees rpcclient retry named pipe open requests when the
server responds with STATUS_PIPE_NOT_AVAILABLE. The retry logic is
contained in an asynchronous tevent_timer callback, to allow for
non-blocking callers.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ebe6627c1f0e6b488a0c456860a055fd5701e84d)
[ddiss@samba.org: rebasead for 4.1 without 46d29d46bc065d51e3f7ca6892]

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10484
Initial FSRVP rpcclient requests fail with NT_STATUS_PIPE_NOT_AVAILABLE

10 years agos3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"
Stefan Metzmacher [Thu, 13 Feb 2014 14:36:27 +0000 (15:36 +0100)]
s3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"

If smbd_server_connection_terminate("CTDB_SRVID_RELEASE_IP") is triggered from
within ctdbd_migrate(), we got a smb_panic complaining about invalid
lock_order, as ctdbd_migrate is called from dbwrap_fetch_locked().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10444
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 21 14:51:51 CET 2014 on sn-devel-104
(cherry picked from commit 33f10d06baf44e31d558bc5bd926c886915322cc)

10 years agos3:lib/ctdbd_conn: let release_ip_handler return bool
Stefan Metzmacher [Mon, 17 Feb 2014 10:57:52 +0000 (11:57 +0100)]
s3:lib/ctdbd_conn: let release_ip_handler return bool

If it returns true the passed ip address matched and we
let a nested ctdb operation fail with NT_STATUS_ADDRESS_CLOSED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 9677fae6aab26d2bf0884dc31516d2dcd8840c03)

10 years agos3:smbd: maintain smbd_server_connection->status
Stefan Metzmacher [Mon, 17 Feb 2014 11:01:12 +0000 (12:01 +0100)]
s3:smbd: maintain smbd_server_connection->status

If this isn't NT_STATUS_OK, we skip any io on the socket.

This avoids possible problems during shutdown.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 52ccb40d595fc80bfa53b0b9cd75ffb902369681)

10 years agos3:smbd: simplify exit_server_common()
Stefan Metzmacher [Mon, 17 Feb 2014 11:05:42 +0000 (12:05 +0100)]
s3:smbd: simplify exit_server_common()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 58c71bee40bb91868fc69d8f7fa640db0e33efae)

10 years agos3: ldap client can return NT_STATUS_OK when an error occurs in a paged search.
Daniel Liberman [Wed, 22 Jan 2014 00:25:41 +0000 (16:25 -0800)]
s3: ldap client can return NT_STATUS_OK when an error occurs in a paged search.

"Inside ads_do_search_all_args(), if the first call to ads_do_paged_search_args()
fails, the proper error status is returned.

But, if the execution is already inside the loop to get all the accounts doing
several calls to ads_do_paged_search_args(), and one of these calls times out,
the status returned is from the *first* call, so success. This causes
net_ads_search() to interpret the return from ads_do_search_retry() as
success and print all the accounts returned, but it’s only a subset."

Also ensure we free previously returned results on error
in subsequent fetches.

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

Signed-off-by: Daniel Liberman <danielvl@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 23 01:40:54 CET 2014 on sn-devel-104

(cherry picked from commit b04e8b7557b82a4b96cf74db04742fb017edb3ba)

10 years agowaf: improve iconv checks
Christian Ambach [Wed, 4 Dec 2013 21:50:11 +0000 (22:50 +0100)]
waf: improve iconv checks

there are broken iconv implementations around (e.g. on AIX) that you
can compile against but that refuse any mapping requests

make sure we do the same as the autoconf-based build did and
fall back to our own code

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 15b2d1a658b3fc428c20a7a461168f464951f40f)
(cherry picked from commit f5cbfd6ce5e5a0977e5c1a53046ee883b3431246)

10 years agos3:libsmb: call smbXcli_tcon_set_fs_attributes() directly
Stefan Metzmacher [Fri, 27 Sep 2013 04:06:32 +0000 (06:06 +0200)]
s3:libsmb: call smbXcli_tcon_set_fs_attributes() directly

We should try to set all attributes we got and not just
FILE_CASE_SENSITIVE_SEARCH.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct 17 19:02:03 CEST 2013 on sn-devel-104
(cherry picked from commit 2474455b7f924ae19ea8897d5e506076f7e77419)

10 years agos3:libsmb: remove unused cli_state->case_sensitive
Stefan Metzmacher [Fri, 27 Sep 2013 03:45:21 +0000 (05:45 +0200)]
s3:libsmb: remove unused cli_state->case_sensitive

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

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

10 years agos3:libsmb: remove unused cli_state->dfsroot
Stefan Metzmacher [Wed, 18 Sep 2013 07:40:08 +0000 (09:40 +0200)]
s3:libsmb: remove unused cli_state->dfsroot

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

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

10 years agos3:libsmb: add SMB2/3 support to cli_dfs_get_referral()
Stefan Metzmacher [Sun, 13 Oct 2013 14:54:18 +0000 (16:54 +0200)]
s3:libsmb: add SMB2/3 support to cli_dfs_get_referral()

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

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

10 years agos3/libsmb: make use of smbXcli_tcon_is_dfs_share()
Stefan Metzmacher [Fri, 27 Sep 2013 03:44:33 +0000 (05:44 +0200)]
s3/libsmb: make use of smbXcli_tcon_is_dfs_share()

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

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

10 years agos3/libsmb: Use smbXcli_conn_dfs_supported instead of test on CAP_DFS
Luk Claes [Fri, 17 May 2013 18:46:24 +0000 (20:46 +0200)]
s3/libsmb: Use smbXcli_conn_dfs_supported instead of test on CAP_DFS

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

Signed-off-by: Luk Claes <luk@debian.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 114e33717df8b49239ac08399a379a8363d33b85)

10 years agos3:libsmb: don't pass down FLAG_CASELESS_PATHNAMES and FLAGS2_DFS_PATHNAMES anymore
Stefan Metzmacher [Fri, 27 Sep 2013 03:34:12 +0000 (05:34 +0200)]
s3:libsmb: don't pass down FLAG_CASELESS_PATHNAMES and FLAGS2_DFS_PATHNAMES anymore

They're now handled at the smbXcli_conn and smbXcli_tcon layer.

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

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

10 years agos3:libsmb: call smbXcli_tcon_{get,set}_fs_attributes() from cli_set_case_sensitive()
Stefan Metzmacher [Fri, 27 Sep 2013 03:11:45 +0000 (05:11 +0200)]
s3:libsmb: call smbXcli_tcon_{get,set}_fs_attributes() from cli_set_case_sensitive()

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

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

10 years agolibcli/smb: add SMB2_HDR_FLAG_DFS for SMB2 Create operations on dfs shares
Stefan Metzmacher [Wed, 18 Sep 2013 01:50:42 +0000 (03:50 +0200)]
libcli/smb: add SMB2_HDR_FLAG_DFS for SMB2 Create operations on dfs shares

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

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

10 years agolibcli/smb: add FLAG_CASELESS_PATHNAMES based on FILE_CASE_SENSITIVE_SEARCH to smb1...
Stefan Metzmacher [Fri, 27 Sep 2013 03:31:07 +0000 (05:31 +0200)]
libcli/smb: add FLAG_CASELESS_PATHNAMES based on FILE_CASE_SENSITIVE_SEARCH to smb1 requests

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

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

10 years agolibcli/smb: move Filesystem Attributes defines to smb_constants.h
Stefan Metzmacher [Fri, 27 Sep 2013 03:30:03 +0000 (05:30 +0200)]
libcli/smb: move Filesystem Attributes defines to smb_constants.h

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

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

10 years agolibcli/smb: add FLAGS2_DFS_PATHNAMES for SMB1 operations against dfs shares
Stefan Metzmacher [Wed, 18 Sep 2013 01:31:33 +0000 (03:31 +0200)]
libcli/smb: add FLAGS2_DFS_PATHNAMES for SMB1 operations against dfs shares

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

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

10 years agolibcli/smb: add smbXcli_tcon_{set,get}_fs_attributes()
Stefan Metzmacher [Fri, 27 Sep 2013 03:02:09 +0000 (05:02 +0200)]
libcli/smb: add smbXcli_tcon_{set,get}_fs_attributes()

These are the attributes returned from the FileFsAttributeInformation
request.

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

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

10 years agolibcli/smb: add smbXcli_tcon_is_dfs_share()
Stefan Metzmacher [Fri, 13 Sep 2013 09:07:32 +0000 (11:07 +0200)]
libcli/smb: add smbXcli_tcon_is_dfs_share()

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

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

10 years agolibcli/smb: Introduce smbXcli_conn_dfs_supported
Luk Claes [Fri, 17 May 2013 18:41:45 +0000 (20:41 +0200)]
libcli/smb: Introduce smbXcli_conn_dfs_supported

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

Signed-off-by: Luk Claes <luk@debian.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 24e7be87d17910c1f4170ecd5fe2d2a8b1419ba5)

10 years agos3:libsmb: make use of smb1cli_tcon_set_values()
Stefan Metzmacher [Fri, 13 Sep 2013 07:10:42 +0000 (09:10 +0200)]
s3:libsmb: make use of smb1cli_tcon_set_values()

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

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

10 years agos3/libsmb: Use smbXcli_conn_use_unicode instead of smb1 specific test
Luk Claes [Fri, 17 May 2013 18:13:50 +0000 (20:13 +0200)]
s3/libsmb: Use smbXcli_conn_use_unicode instead of smb1 specific test

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

10 years agoheimdal_build: only enable libintl functions if everything was found
Christian Ambach [Wed, 19 Feb 2014 21:17:01 +0000 (22:17 +0100)]
heimdal_build: only enable libintl functions if everything was found

do not rely on intl.h being available but also on the functions being usable
This should fix the build on HP-UX

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
Signed-off-by: Christian Ambach <ambi@samba.org>
Change-Id: I5dd88d2d5216b778624778455cca99b32d0be58f
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 20 01:28:24 CET 2014 on sn-devel-104

(cherry picked from commit 8f0d06fa5e654f647664727db6f12901579ec2c7)

10 years agowaf:lib/replace fix iconv checks on HP/UX
Christian Ambach [Wed, 29 Jan 2014 19:48:38 +0000 (20:48 +0100)]
waf:lib/replace fix iconv checks on HP/UX

we need to copy away the list of LDFLAGS
to be tried before modifying it instead of
just creating a new reference and then continuing
with a modified list while it should have been
reset back to the original value

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 13 02:01:03 CET 2014 on sn-devel-104

(cherry picked from commit 6a7c420a79cc1258528f152f4de9a0608767729f)

10 years agowaf:lib/replace gettext configure checks
Christian Ambach [Thu, 25 Jul 2013 17:41:02 +0000 (19:41 +0200)]
waf:lib/replace gettext configure checks

Make sure we only try to work with gettext if we found
the prototypes and were able to link

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri Jan 17 19:30:33 CET 2014 on sn-devel-104

(cherry picked from commit da891e2101c568d2f0b9a2bda78702826ea68f3c)

10 years agowaf:lib/replace fix gettext detection
Christian Ambach [Thu, 12 Dec 2013 21:10:36 +0000 (22:10 +0100)]
waf:lib/replace fix gettext detection

if the user has specified a path for gettext, add it to CFLAGS and LDFLAGS
so we can find it during configure and build

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 31db0c8acdd68f396417e1f6504a91a40295bc89)

10 years agowaf:lib/replace change detection of gettext
Christian Ambach [Thu, 12 Dec 2013 21:12:07 +0000 (22:12 +0100)]
waf:lib/replace change detection of gettext

convert this to an automatic check: if no option is given, try to find gettext
and if found, use it
if user has specified --with-gettext, then bail out if it could not be found
in case of --without-gettext, skip all gettext related configure checks

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a83f491810d34cc8b6eb4b0f40bbbb1440e0f84d)

10 years agowaf:lib/replace fix up libintl related checks
Christian Ambach [Thu, 2 Jan 2014 21:23:16 +0000 (22:23 +0100)]
waf:lib/replace fix up libintl related checks

on a default installation of AIX, libintl.a exists but
libintl.h does not
So check for the declarations of those functions as well
to make sure that the build works.

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit df6ddcfbfcd33274c1b768ce26829b0ad9278cd0)

10 years agowaf:lib/replace correct detection of libiconv
Christian Ambach [Thu, 2 Jan 2014 22:28:20 +0000 (23:28 +0100)]
waf:lib/replace correct detection of libiconv

add -liconv as a complete command line argument,
not all characters on their own

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1a42ff7d8db63b26e2beb43268a1c4664723358e)

10 years agos3: printing: Fix problem with server taking too long to respond to a MSG_PRINTER_DRV...
Jeremy Allison [Wed, 12 Feb 2014 18:13:19 +0000 (10:13 -0800)]
s3: printing: Fix problem with server taking too long to respond to a MSG_PRINTER_DRVUPGRADE message.

Receiving a MSG_PRINTER_DRVUPGRADE causes
smbd to iterate over all printers looking
for ones that uses the driver. This is a very
expensive operation requiring a read of all
registry printer parameters.

On a system with a large number of printers,
this causes the clients to timeout (smbd
can take longer than 60 seconds to respond).

This patch fixes the problem by forwarding
the MSG_PRINTER_DRVUPGRADE to the background
lpq queue updater process and allowing it to
take care of the updating of the changeid
in the registry, allowing the smbd connected
to the client to return to processing requests
immediately.

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

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): Tue Feb 18 17:48:30 CET 2014 on sn-devel-104

(cherry picked from commit cd655715b8ee0a4e681d67b3996f71017b941401)

10 years agolibrpc/nbt: increase MAX_COMPONENTS limit for nbt_names.
Günther Deschner [Tue, 4 Feb 2014 15:38:46 +0000 (16:38 +0100)]
librpc/nbt: increase MAX_COMPONENTS limit for nbt_names.

domains with more then 10 subdomains are not so uncommon.

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

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Feb 13 16:30:50 CET 2014 on sn-devel-104

(cherry picked from commit 4e05bad0d18e351cb2a2db74860e77adea727c79)
Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Fri Feb 21 13:19:27 CET 2014 on sn-devel-104

10 years agodfs: always call create_conn_struct with root privileges
Garming Sam [Wed, 18 Dec 2013 20:55:44 +0000 (09:55 +1300)]
dfs: always call create_conn_struct with root privileges

This fixes a bug in dfs_samba4 identified by Daniel Müller.

create_conn_struct calls SMB_VFS_CONNECT which requires root privileges.
SMB_VFS_CONNECT in turn calls dfs_samba4_connect which connects to samdb.

Calls were made to this function without ever becoming root (notably via setup_dfs_referral)
which resulted in an error and the VFS connect failing. This happens when you have an active
directory domain controller with host msdfs = yes in smb.conf and dfs links in place.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Bjoern Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 10 20:11:03 CET 2014 on sn-devel-104

(cherry picked from commit 24a687642de21ce872d25f16b3525003844d05f9)

Fix bug #10378 - dfs: always call create_conn_struct with root privileges.

10 years agoVERSION: Bump version number up to 4.1.6...
Karolin Seeger [Fri, 21 Feb 2014 09:21:08 +0000 (10:21 +0100)]
VERSION: Bump version number up to 4.1.6...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.1.5 release. samba-4.1.5
Karolin Seeger [Fri, 21 Feb 2014 09:20:09 +0000 (10:20 +0100)]
VERSION: Disable git snapshots for the 4.1.5 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.1.5.
Karolin Seeger [Fri, 21 Feb 2014 09:19:38 +0000 (10:19 +0100)]
WHATSNEW: Add release notes for Samba 4.1.5.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agos3:smb2_notify: fix use after free on long living notify requests
Stefan Metzmacher [Thu, 30 Jan 2014 15:12:44 +0000 (16:12 +0100)]
s3:smb2_notify: fix use after free on long living notify requests

This is a hack, but it should fix the bug:

   change_notify_add_request() talloc moves smb_request away,
   which is not expected by the smb2_notify.c code...

   smbd_smb2_notify_reply() uses tevent_req_defer_callback()
   (in older versions an immediate event) to defer the response.
   This is needed as change_notify_reply() will do more things
   after calling reply_fn() (smbd_smb2_notify_reply is this case)
   and often change_notify_remove_request() is called after
   change_notify_reply().

   change_notify_remove_request() implicitly free's the smb_request
   that was passed to change_notify_add_request().

   smbd_smb2_fake_smb_request() added the smb_request as smb2req->smb1req,
   which is expected to be available after smbd_smb2_notify_recv() returned.

The long term solution would be the following interface:

struct tevent_req *change_notify_request_send(TALLOC_CTX *mem_ctx,
                                              struct tevent_context *ev,
                                              struct files_struct *fsp,
                                              uint32_t max_length,
                                              uint32_t filter,
                                              bool recursive);
NTSTATUS change_notify_request_recv(struct tevent_req *req,
                                    TALLOC_CTX *mem_ctx,
                                    DATA_BLOB *buffer);

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 14 11:18:15 CET 2014 on sn-devel-104
(cherry picked from commit e0bf930f23fe20ee00d0006a5f6c2ba1a8f592a0)

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Sun Feb 16 19:14:12 CET 2014 on sn-devel-104

10 years agos3: modules: streaminfo: As we have no VFS function SMB_VFS_LLISTXATTR we can't cope...
Jeremy Allison [Fri, 7 Feb 2014 18:19:26 +0000 (10:19 -0800)]
s3: modules: streaminfo: As we have no VFS function SMB_VFS_LLISTXATTR we can't cope with a symlink when lp_posix_pathnames() is true.

Fix bug : Bug 10429 - samba returns STATUS_OBJECT_NAME_NOT_FOUND when attempting to remove dangling symlink

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb  8 00:01:16 CET 2014 on sn-devel-104
(cherry picked from commit 17adbbcad7e401dd544dfa76f7ec9aeb6a847381)

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Fri Feb 14 22:30:55 CET 2014 on sn-devel-104

10 years agos3: vfs_dirsort module.
Jeremy Allison [Tue, 11 Feb 2014 18:39:04 +0000 (10:39 -0800)]
s3: vfs_dirsort module.

Add raw.search torture test on a share definition with:

vfs objects = dirsort

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 30cc8f41da58b87ff575860b7cde640520829923)

10 years agos3: vfs_dirsort module.
Jeremy Allison [Thu, 30 Jan 2014 01:01:30 +0000 (17:01 -0800)]
s3: vfs_dirsort module.

Allow dirsort to work when multiple simultaneous
directories are open. The old code only keeps one
active private data pointer on the connection struct, opening
a second directory on the same connection will overwrite it.

This modification turns the private data pointer
into a linked list of open directories on the
connection struct, and finds the correct one by searching
on the passed in DIR *.

With this code in place, smbd passes raw.search
torture test on a share definition with:

vfs objects = dirsort

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fd79652b0e598882e0c4d156bd897c29dae8ec04)

10 years agosmbd: Fix an ancient oplock bug
Volker Lendecke [Wed, 4 Sep 2013 11:57:00 +0000 (13:57 +0200)]
smbd: Fix an ancient oplock bug

If we get an oplock break response, we forgot to remove the oplock break
timeout.

Found by stopping raw.oplock.exclusive5 after the 2nd open and watching a debug
level 10 log. This amends 08a9de89 from 2007.

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

Fix bug #10436 - cancel fsp->oplock_timeout in downgrade_file_oplock().