samba.git
10 years agos4:cldap_server: Do not handle netlogon ourself anymore
Benjamin Franzke [Fri, 1 Nov 2013 09:52:02 +0000 (10:52 +0100)]
s4:cldap_server: Do not handle netlogon ourself anymore

Netlogon is now handled by the ldb rootdse module.

The netlogon files will be moved to dsdb in the next commit.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
(cherry picked from commit 7106dcf2b8525ec653f24e417d846f9d00172b6d)

10 years agos4:dsdb/rootdse: Support netlogon request
Benjamin Franzke [Sun, 27 Oct 2013 05:55:48 +0000 (06:55 +0100)]
s4:dsdb/rootdse: Support netlogon request

This patch adds support for a netlogon ldap style request
over the tcp socket.  This is available since win2k3+ [1].

The automatic client join & configuration daemon "realmd" makes
use of this ability.
Realmd can now be used to join a computer to a samba 4 domain.
(See also:
https://lists.samba.org/archive/samba-technical/2013-October/095606.html)

Tested with:
ldapsearch -h samba-srv -x -b '' -s base "(&(NtVer=\06\00\00\00)(AAC=\00\00\00\00))" NetLogon

And compared the result in wireshark with cldap request issued by
examples/misc/cldap.pl.

[1]: http://wiki.wireshark.org/MS-CLDAP?action=recall&rev=8

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
(cherry picked from commit 0620c79d76b69811fd6c00d912db05477d894724)

10 years agos4:dsdb/rootdse: Pass rootdse context to rootdse_add_dynamic
Benjamin Franzke [Fri, 1 Nov 2013 05:55:41 +0000 (06:55 +0100)]
s4:dsdb/rootdse: Pass rootdse context to rootdse_add_dynamic

This replaced the *module parameter, and uses ac->module in the function
instead, same for *req and *attrs.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
(cherry picked from commit 7a5a62547bc10053fb1e4850e0acacb6a837f36f)

10 years agoprovision: Fix string replacement ordering
Benjamin Franzke [Fri, 6 Sep 2013 14:20:43 +0000 (16:20 +0200)]
provision: Fix string replacement ordering

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
(cherry picked from commit ca8acb681a1ccaddf85376ff30c9b13b1a4c943d)

10 years agos4:cldap_server: Move netlogon parsing into utility function
Benjamin Franzke [Sun, 27 Oct 2013 15:07:04 +0000 (16:07 +0100)]
s4:cldap_server: Move netlogon parsing into utility function

To be used later by netlogon-request over ldap.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
(cherry picked from commit 372127416825a8a947cd976f8a4165611c006c43)

10 years agos4:torture/cldap: Fix a typo
Benjamin Franzke [Fri, 1 Nov 2013 09:24:43 +0000 (10:24 +0100)]
s4:torture/cldap: Fix a typo

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
(cherry picked from commit 32ee231da590d7b8aee74728a423b282ae845bce)

10 years agos3-lib/util: fix logic inside set_namearray loops.
Jeremy Allison [Tue, 8 Apr 2014 17:38:33 +0000 (10:38 -0700)]
s3-lib/util: fix logic inside set_namearray loops.

Additional fix for bug #10544 - s3-lib/util: set_namearray reads across end of namelist string.

Not strictly needed as the initial fix addresses
the problem, but corrects the internal logic
inside the loops.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 4f59580331b934b183c3344da57f2002d88d4512)

10 years agos3-lib/util: fix read across end of namelist string
Björn Baumbach [Mon, 7 Apr 2014 11:46:42 +0000 (13:46 +0200)]
s3-lib/util: fix read across end of namelist string

If the namelist is not terminated with a '/', we try to read
the next character after the string termination '\0'.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr  8 21:44:16 CEST 2014 on sn-devel-104
(cherry picked from commit 8f46b130c5c796d66d26982f5cd99c52f7c8ece1)

Fix bug #10544 - s3-lib/util: set_namearray reads across end of namelist
string.

10 years agos3-nmbd: reset debug settings after reading config file (bug #10239)
Björn Baumbach [Wed, 19 Mar 2014 14:01:11 +0000 (15:01 +0100)]
s3-nmbd: reset debug settings after reading config file (bug #10239)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 25 18:29:06 CET 2014 on sn-devel-104

(cherry picked from commit a7df00c82049547129f063a40a842b156c8aead4)

10 years agoVERSION: Bump version number up to 4.1.8...
Karolin Seeger [Thu, 17 Apr 2014 07:55:39 +0000 (09:55 +0200)]
VERSION: Bump version number up to 4.1.8...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.1.7. samba-4.1.7
Karolin Seeger [Thu, 17 Apr 2014 07:54:27 +0000 (09:54 +0200)]
WHATSNEW: Add release notes for Samba 4.1.7.

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-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Fri Apr  4 23:07:07 CEST 2014 on sn-devel-104

10 years agos3:libsmb: SMBC_getatr() if no method worked, try all methods again on next attempt
Gregor Beck [Fri, 18 Oct 2013 13:32:55 +0000 (15:32 +0200)]
s3:libsmb: SMBC_getatr() if no method worked, try all methods again on next attempt

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
The last 10 patches address bug #10230 - (lib)smbclient fails with NetApp.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10230

10 years agoclient: use cli_qpathinfo3 for allinfo
Gregor Beck [Mon, 14 Oct 2013 09:44:36 +0000 (11:44 +0200)]
client: use cli_qpathinfo3 for allinfo

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: cli_qpathinfo3 use cli_qpathinfo2 for smb2
Gregor Beck [Mon, 14 Oct 2013 09:43:45 +0000 (11:43 +0200)]
s3:libsmb: cli_qpathinfo3 use cli_qpathinfo2 for smb2

cli_qpathinfo3 only works (and is only needed as fallback so far) for smb1.
Use cli_qpathinfo2 in the smb2 case to make it universally usable.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoclient: remove a write only variable
Gregor Beck [Fri, 11 Oct 2013 09:05:06 +0000 (11:05 +0200)]
client: remove a write only variable

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: SMBC_getatr use pathinfo3 for second try
Gregor Beck [Fri, 11 Oct 2013 09:02:24 +0000 (11:02 +0200)]
s3:libsmb: SMBC_getatr use pathinfo3 for second try

The pathinfo2 call might fail against NetApp because it is sending broken
packages.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: SMBC_getatr do not let ino undefined on success
Gregor Beck [Fri, 11 Oct 2013 09:00:48 +0000 (11:00 +0200)]
s3:libsmb: SMBC_getatr do not let ino undefined on success

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: SMBC_getatr try pathinfo2 only once
Gregor Beck [Fri, 11 Oct 2013 08:59:59 +0000 (10:59 +0200)]
s3:libsmb: SMBC_getatr try pathinfo2 only once

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: add function cli_qpathinfo3()
Gregor Beck [Fri, 11 Oct 2013 08:53:45 +0000 (10:53 +0200)]
s3:libsmb: add function cli_qpathinfo3()

This is a reimplemantation of cli_qpathinfo2 without the use of info level
SMB_QFILEINFO_ALL_INFO which leads to broken responses from NetApp.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: add function cli_qpathinfo_standard()
Gregor Beck [Fri, 11 Oct 2013 08:52:21 +0000 (10:52 +0200)]
s3:libsmb: add function cli_qpathinfo_standard()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: pass creation or birth time in cli_qpathinfo_basic()
Gregor Beck [Fri, 11 Oct 2013 08:50:39 +0000 (10:50 +0200)]
s3:libsmb: pass creation or birth time in cli_qpathinfo_basic()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agorpcclient: abort shadow-copy set on commit failure
David Disseldorp [Sat, 29 Mar 2014 01:18:20 +0000 (02:18 +0100)]
rpcclient: abort shadow-copy set on commit failure

Use similar behaviour to the diskshadow.exe FSRVP client, which aborts
the shadow-copy set if it receives a failed commit response.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr  1 00:54:06 CEST 2014 on sn-devel-104

(cherry picked from commit d550acf24a8ec20e3e32891ed702c6cc42bc3dee)

10 years agorpcclient: append a trailing slash to FSRVP request UNCs
David Disseldorp [Sat, 29 Mar 2014 01:18:18 +0000 (02:18 +0100)]
rpcclient: append a trailing slash to FSRVP request UNCs

The Windows Server 2012 FSRVP server exhibits strange behaviour when
exposing hidden shadow copy shares. If the hidden share UNC in the
AddToShadowCopySet request includes a trailing backslash (e.g.
"\\server\share$\"), then the new shadow-copy share will also be hidden
(e.g. "\\server\share$@{ShadowCopy.ShadowCopyId}$").
However, if the UNC does not include a trailing backslash, which until
now was rpcclient's default behaviour, then the exposed shadow-copy
share is not hidden.

Thanks to the MS Open Specifications team for helping me track down this
one.

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

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

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

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Thu Apr  3 14:37:06 CEST 2014 on sn-devel-104

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