samba.git
10 years agoVERSION: Bump version number up to 4.0.18...
Karolin Seeger [Thu, 10 Apr 2014 09:52:52 +0000 (11:52 +0200)]
VERSION: Bump version number up to 4.0.18...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.0.17. samba-4.0.17
Karolin Seeger [Thu, 10 Apr 2014 09:41:12 +0000 (11:41 +0200)]
WHATSNEW: Add release notes for Samba 4.0.17.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agos3: messages: Implement cleanup of dead records.
Jeremy Allison [Wed, 2 Apr 2014 23:45:25 +0000 (16:45 -0700)]
s3: messages: Implement cleanup of dead records.

When a smbd process dies, pending messages.tdb records for this process
might not get cleaned up. Implement a cleanup for dead records that is
triggered after a smbd dies uncleanly; the records for that PID are
deleted.

Based on a patchset from Christof Schmitt <cs@samba.org>.

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

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10534
Cleanup messages.tdb record after unclean smbd shutdown

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Apr  7 11:55:50 CEST 2014 on sn-devel-104

10 years agos3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.
Jeremy Allison [Tue, 25 Mar 2014 15:47:39 +0000 (08:47 -0700)]
s3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.

This has to be done in every code path that creates
an NT token, as remote users may have been added to
the local /etc/group database. Tokens created merely
from the info3 structs (via the DC or via the krb5 PAC)
won't have these local groups.

This code needs to special-case the guest user, as
this token can have the token_sid[0] set to the Guest
SID, not the mapping of UNIX uid -> SID.

Other users that may have a well-known SID
set in token_sid[0] (like SYSTEM) are usually
not mappable to UNIX users and can be ignored
when adding local groups from /etc/group.

Combined back-port of fixes
6034ab521c47fc5f4732398652c9c6847ff92035 and
a9fa09723bee3588db2168ac13f7ad0334452c11 from
master.

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

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)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Apr  1 11:33:36 CEST 2014 on sn-devel-104

10 years agolsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public...
Alexander Bokovoy [Tue, 18 Mar 2014 17:41:38 +0000 (19:41 +0200)]
lsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public structs

For Python bindings PIDL wants the struct to be defined as public if we
want to use __ndr_print/pack/unpack.

Define the [public] attribute to ForestTrustCollisionInfo/Record to
allow easier debugging when there is collision in establishing a trust.

This change does not affect C code as NDR functions are always
generated, only not exposed in Python bindings.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Mon Mar 24 12:44:50 CET 2014 on sn-devel-104

(cherry picked from commit 59767911bded48388c27d5f9cd2ff1346a1c01a6)

10 years agos3-rpc_server: Fix handling of fragmented rpc requests.
Andreas Schneider [Thu, 20 Mar 2014 13:45:01 +0000 (14:45 +0100)]
s3-rpc_server: Fix handling of fragmented rpc requests.

We need to call pipe_init_outgoing_data() as the first thing in
process_complete_pdu(). Otherwise the caller may use uninitialized
memory and tries to write a response into the socket.

The problem happens only if a real socket is used, which means
in all cases for master and only with external rpc daemons in v4-0
and v4-1.

The problem looks like this in the logs.

    [2014/03/20 14:49:35.531663, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1627(process_complete_pdu)
      Processing packet type 0
    [2014/03/20 14:49:35.531695, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1472(dcesrv_auth_request)
      Checking request auth.
    [2014/03/20 14:49:35.531738, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:521(named_pipe_packet_process)
      Sending 1 fragments in a total of 0 bytes
    [2014/03/20 14:49:35.531769, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:526(named_pipe_packet_process)
      Sending PDU number: 0, PDU Length: 4294967228
    [2014/03/20 14:49:35.531801,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:565(named_pipe_packet_done)
      Writev failed!
    [2014/03/20 14:49:35.531845,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:595(named_pipe_packet_done)
      Fatal error(Message too long). Terminating client(127.0.0.1) connection!

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Guenther Deschner <gd@samba.org
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Mar 20 18:30:17 CET 2014 on sn-devel-104

(cherry picked from commit 5277fc4d0393ffe2e415ad26610b36d2986c62d7)

10 years agos3:rpc_server: minor refactoring of process_request_pdu()
Gregor Beck [Thu, 9 Jan 2014 09:15:31 +0000 (10:15 +0100)]
s3:rpc_server: minor refactoring of process_request_pdu()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit b5f30205931a4b9d0b3b257d5855869e606f8b63)

10 years agopidl-waf: Only install Yapp::Driver if it is not available.
Andreas Schneider [Fri, 28 Feb 2014 15:00:54 +0000 (16:00 +0100)]
pidl-waf: Only install Yapp::Driver if it is not available.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar  6 23:30:47 CET 2014 on sn-devel-104

The last 9 patches address bug #10472 - pidl: waf should have an option
for the dir to install perl files and do not glob.

10 years agopidl-waf: Check for system perl(Parse::Yapp::Driver).
Andreas Schneider [Fri, 28 Feb 2014 14:59:45 +0000 (15:59 +0100)]
pidl-waf: Check for system perl(Parse::Yapp::Driver).

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Add a function to check for a system perl module.
Andreas Schneider [Fri, 28 Feb 2014 14:59:41 +0000 (15:59 +0100)]
pidl-waf: Add a function to check for a system perl module.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Do not glob to install pidl modules.
Andreas Schneider [Fri, 28 Feb 2014 14:55:46 +0000 (15:55 +0100)]
pidl-waf: Do not glob to install pidl modules.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Install pidl modules to the perl vendorlib directory.
Andreas Schneider [Fri, 28 Feb 2014 14:53:10 +0000 (15:53 +0100)]
pidl-waf: Install pidl modules to the perl vendorlib directory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Remove unused variable pidl_src.
Andreas Schneider [Fri, 28 Feb 2014 14:54:09 +0000 (15:54 +0100)]
pidl-waf: Remove unused variable pidl_src.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautobuild: Set perl vendorlib direcotry.
Andreas Schneider [Wed, 5 Mar 2014 15:27:15 +0000 (16:27 +0100)]
autobuild: Set perl vendorlib direcotry.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agobuildtools: Add perl vendorlib configure option.
Andreas Schneider [Fri, 28 Feb 2014 14:50:02 +0000 (15:50 +0100)]
buildtools: Add perl vendorlib configure option.

After this patch has been pushed, we need to change autobuild to compile
with this option or we will not be able to install pidl.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agobuildtools: Rename perl vendorarch configure option.
Andreas Schneider [Fri, 28 Feb 2014 14:47:45 +0000 (15:47 +0100)]
buildtools: Rename perl vendorarch configure option.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agodns: Extend tests for records with another type
Kai Blin [Fri, 28 Feb 2014 09:35:07 +0000 (10:35 +0100)]
dns: Extend tests for records with another type

Add another check to the one added for bug #10471, for added paranoia

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Tue Mar  4 15:47:10 CET 2014 on sn-devel-104

(cherry picked from commit 5bd47bb563c3736b9de1a3a93bdf46a498928643)

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:48:30 +0000 (14:48 -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 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:smbd: s/EVENT_FD/TEVENT_FD
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:57 +0000 (10:18 +0100)]
s3:smbd: s/EVENT_FD/TEVENT_FD

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

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)

Fix bug #10188 - spoolss: architecture is undocumented.

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.0.16' into v4-0-test
Stefan Metzmacher [Tue, 11 Mar 2014 19:55:57 +0000 (20:55 +0100)]
Merge tag 'samba-4.0.16' into v4-0-test

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

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.0.16 release.
Karolin Seeger [Tue, 11 Mar 2014 11:00:52 +0000 (12:00 +0100)]
VERSION: Disable git snapshots for the 4.0.16 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.0.16.
Karolin Seeger [Tue, 11 Mar 2014 10:42:21 +0000 (11:42 +0100)]
WHATSNEW: Add release notes for Samba 4.0.16.

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.0.16 release. samba-4.0.16
Karolin Seeger [Tue, 11 Mar 2014 11:00:52 +0000 (12:00 +0100)]
VERSION: Disable git snapshots for the 4.0.16 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.0.16.
Karolin Seeger [Tue, 11 Mar 2014 10:42:21 +0000 (11:42 +0100)]
WHATSNEW: Add release notes for Samba 4.0.16.

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.0.16...
Karolin Seeger [Sun, 16 Feb 2014 20:01:42 +0000 (21:01 +0100)]
VERSION: Bump version number up to 4.0.16...

and re-enable git snapshots.

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

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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Mar 10 18:37:25 CET 2014 on sn-devel-104

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

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Feb 23 04:57:30 CET 2014 on sn-devel-104

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>
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 agosmbd: Fix calls to create_conn_struct_cwd to be correctly indented.
Andrew Bartlett [Mon, 7 Jan 2013 22:29:48 +0000 (09:29 +1100)]
smbd: Fix calls to create_conn_struct_cwd to be correctly indented.

These are whitespace changes only, left out of the previous commit to preserve clarity.

Andrew Bartlett.

Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5a3e915d20bb11984c42081bf25ce09baa58e04e)

10 years agosmbd: Split create_conn_struct into a fn that does not change the working dir
Andrew Bartlett [Wed, 10 Oct 2012 02:47:49 +0000 (13:47 +1100)]
smbd: Split create_conn_struct into a fn that does not change the working dir

The python bindings do not want the current working directory changed
during operations, so we provide two functions, one providing the
original behaviour, and other providing the python bindings with just
the memory allocation and initilisation stuff.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6c80cf747d75e648a1d88d477bcf476e6874c4b3)

10 years agoVERSION: Bump version number up to 4.0.15...
Karolin Seeger [Sun, 16 Feb 2014 20:01:42 +0000 (21:01 +0100)]
VERSION: Bump version number up to 4.0.15...

and re-enable git snapshots.

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

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.0.15.
Karolin Seeger [Sun, 16 Feb 2014 19:58:36 +0000 (20:58 +0100)]
WHATSNEW: Add release notes for Samba 4.0.15.

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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Feb 16 19:18:59 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-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Feb 14 22:35:40 CET 2014 on sn-devel-104