]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
8 years agos3/smbd: req is already validated at the beginning of open_file_ntcreate()
Ralph Boehme [Tue, 7 Mar 2017 13:10:39 +0000 (14:10 +0100)] 
s3/smbd: req is already validated at the beginning of open_file_ntcreate()

req can't be NULL because the if condition surrounding this code checks
!(oplock_request & INTERNAL_OPEN_ONLY).

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8580adc1d968304b69237f289d13950972394b48)

8 years agos3/smbd: add comments and some reformatting to open_file_ntcreate()
Ralph Boehme [Mon, 6 Mar 2017 10:43:08 +0000 (11:43 +0100)] 
s3/smbd: add comments and some reformatting to open_file_ntcreate()

No change in behaviour.

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

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

8 years agos3/smbd: add const to get_lease_type() args
Ralph Boehme [Sat, 4 Mar 2017 12:55:55 +0000 (13:55 +0100)] 
s3/smbd: add const to get_lease_type() args

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6924e72ade20e98ac470fcb6ba7120c61b06bb0f)

8 years agos3/wscript: fix Linux kernel oplock detection
Ralph Boehme [Mon, 6 Mar 2017 11:09:53 +0000 (12:09 +0100)] 
s3/wscript: fix Linux kernel oplock detection

Fix a copy/paste error, the Linux kernel oplocks check was copied from
the change notify support check.

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

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

8 years agoreplace: Include sysmacros.h
Andreas Schneider [Thu, 5 Jan 2017 08:34:36 +0000 (09:34 +0100)] 
replace: Include sysmacros.h

In the GNU C Library, "makedev" is defined by <sys/sysmacros.h>. For
historical compatibility, it is currently defined by <sys/types.h> as
well, but it is planned to remove this soon.

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

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

8 years agosmbd: Do an early exit on negprot failure
Volker Lendecke [Tue, 28 Feb 2017 15:03:45 +0000 (15:03 +0000)] 
smbd: Do an early exit on negprot failure

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

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

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Mon Mar 13 13:03:15 CET 2017 on sn-devel-144

8 years agovfs_fruit: enabling AAPL extensions must be a global switch
Ralph Boehme [Tue, 28 Feb 2017 08:39:37 +0000 (09:39 +0100)] 
vfs_fruit: enabling AAPL extensions must be a global switch

Apple's SMB2 AAPL extension is enabled once per SMB2
connection. Unfortunately the (per se correct) fix for bug #12541
results in vfs_fruit checking a per tcon config state variable to
determine whether AAPL has been negotiated. This variable will be false
for all but the first tcon. We must make it a global variable.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Thu Mar  2 04:34:10 CET 2017 on sn-devel-144

(cherry picked from commit 41204a4972ea62b7b656ad81e24bd052990f7e87)

8 years agos3: smbd: Restart reading the incoming SMB2 fd when the send queue is drained.
Jeremy Allison [Thu, 2 Mar 2017 17:13:23 +0000 (09:13 -0800)] 
s3: smbd: Restart reading the incoming SMB2 fd when the send queue is drained.

When the send queue grows greater than xconn->smb2.credits.max/16,
smbd_smb2_request_next_incoming() doesn't allocate a new request in state->req.

After smbd_smb2_io_handler() is called, it marks the fd not readable as
state->req == NULL, and never marks it readable again.

Fix by calling smbd_smb2_request_next_incoming() to restart
reads inside smbd_smb2_flush_send_queue() which drains the
send queue.

Reported by <chen.yehua@h3c.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Mar  3 02:23:20 CET 2017 on sn-devel-144

(cherry picked from commit 1e0c79ddb34be9a2b9fa92d35387c443c4a381ae)

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Mon Mar  6 16:02:16 CET 2017 on sn-devel-144

8 years agos3:winbindd: fix endless forest trust scan
Stefan Metzmacher [Thu, 2 Mar 2017 07:13:57 +0000 (08:13 +0100)] 
s3:winbindd: fix endless forest trust scan

Commit 0392ebcd1d48e9f472f2148b85316a77d9cc953b effectively
disabled the enumeration of trusts in other forests.

The fixes for https://bugzilla.samba.org/show_bug.cgi?id=11691
changed the way we fill domain->domain_flags for domains
in other forests.

Commit fffefe72fcc62d9688b45f53a5327667dc0b2fe6 readded the
ability to enumerate trusts of other forests again, in order to
fix https://bugzilla.samba.org/show_bug.cgi?id=11830

Now we have the problem that multiple domains
(even outside of our forest) are considert to be
our forest root, as they have the following flags:
NETR_TRUST_FLAG_TREEROOT and NETR_TRUST_FLAG_IN_FOREST.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar  2 17:53:14 CET 2017 on sn-devel-144

(cherry picked from commit f9aaddcdd8f9ea648c9c5ea804f56ee3ff6c4c67)

8 years agovfs_fruit: only veto AppleDouble files with fruit:resource=file
Ralph Boehme [Thu, 19 Jan 2017 08:30:45 +0000 (09:30 +0100)] 
vfs_fruit: only veto AppleDouble files with fruit:resource=file

vfs_fruit only creates AppleDouble files itself when "fruit:resource" is
set to "file" (the default). It is only then the these AppleDouble files
should be treated as an internal representation and should be
inaccessible from clients.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 708767da8c366c021d6d15a3ae71d009357c3320)

8 years agoVERSION: Bump version up to 4.4.11...
Karolin Seeger [Wed, 1 Mar 2017 08:46:20 +0000 (09:46 +0100)] 
VERSION: Bump version up to 4.4.11...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoVERSION: Disable GIT_SNAPSHOTS for the 4.4.10 release. samba-4.4.10
Karolin Seeger [Wed, 1 Mar 2017 08:45:09 +0000 (09:45 +0100)] 
VERSION: Disable GIT_SNAPSHOTS for the 4.4.10 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoWHATSNEW: Add release notes for Samba 4.4.10.
Karolin Seeger [Tue, 28 Feb 2017 15:30:38 +0000 (16:30 +0100)] 
WHATSNEW: Add release notes for Samba 4.4.10.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agos3:winbindd: allow a fallback to NTLMSSP for LDAP connections
Stefan Metzmacher [Wed, 22 Feb 2017 20:18:32 +0000 (21:18 +0100)] 
s3:winbindd: allow a fallback to NTLMSSP for LDAP connections

This matches the behaviour of pdb_get_trust_credentials() for
our machine account and allows us to fallback to NTLMSSP
when contacting trusted domains.

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

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

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Tue Feb 28 13:13:04 CET 2017 on sn-devel-144

8 years agos3:libads: add more debugging to ads_sasl_spnego_bind()
Stefan Metzmacher [Thu, 23 Feb 2017 10:54:21 +0000 (11:54 +0100)] 
s3:libads: add more debugging to ads_sasl_spnego_bind()

Any fallbacks to other authentication methods should be logged.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(similar to commit ea0bc12ba52166032d5112ee22ab53d831c13e86)

8 years agos3:winbindd: rely on the kerberos_state from pdb_get_trust_credentials()
Stefan Metzmacher [Wed, 22 Feb 2017 19:07:25 +0000 (20:07 +0100)] 
s3:winbindd: rely on the kerberos_state from pdb_get_trust_credentials()

The implementation of pdb_get_trust_credentials() should have all
the details to set the kerberos_state to a useful value.

This should enable the fallback to NTLMSSP again, when using our
machine account against trusted domains.

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

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

8 years agos3:winbindd: add more debugging to cm_prepare_connection()
Stefan Metzmacher [Thu, 23 Feb 2017 10:54:21 +0000 (11:54 +0100)] 
s3:winbindd: add more debugging to cm_prepare_connection()

Any fallbacks to other authentication methods should be logged.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(similar to commit ba9d139ec3d71af184a24daf24356304c2e49144)

8 years agos3:passdb: use cli_credentials_set_kerberos_state() for trusts in pdb_get_trust_crede...
Stefan Metzmacher [Wed, 22 Feb 2017 19:07:25 +0000 (20:07 +0100)] 
s3:passdb: use cli_credentials_set_kerberos_state() for trusts in pdb_get_trust_credentials()

Trust accounts can only use kerberos when contacting other AD domains,
using NTLMSSP will fail.

At the same time it doesn't make sense to try kerberos for NT4 domains,
still NTLMSSP will fail, but the callers has to deal with that
case and just fallback to an anonymous SMB connection.

In all cases we should be able to use NETLOGON SCHANNEL
over any anonymous smb or tcp transport.

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

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

8 years agos3:winbindd: fix the valid usage anonymous smb authentication
Stefan Metzmacher [Wed, 22 Feb 2017 18:18:04 +0000 (19:18 +0100)] 
s3:winbindd: fix the valid usage anonymous smb authentication

If we are in a situation where we don't have credentials to contact the
remote domain or against an NT4 with the following settings:

  workgroup = NT4DOM
  security = domain
  require strong key = no
  client use spnego = no
  client ipc signing = auto

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(similar to commit c97a29bdfdc0020ec0113073580da56f2d35edc1)

8 years agoauth/credentials: try to use kerberos with the machine account unless we're in an...
Stefan Metzmacher [Fri, 24 Feb 2017 15:02:50 +0000 (16:02 +0100)] 
auth/credentials: try to use kerberos with the machine account unless we're in an AD domain

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

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

8 years agos3:winbindd: try a NETLOGON connection with noauth over NCACN_NP against trusted...
Stefan Metzmacher [Fri, 24 Feb 2017 10:37:32 +0000 (10:37 +0000)] 
s3:winbindd: try a NETLOGON connection with noauth over NCACN_NP against trusted domains.

We're using only NCACN_NP here as we rely on the smb signing restrictions
of cm_prepare_connection().

This should fix SMB authentication with a user of a domain
behind a transitive trust.

With this change winbindd is able to call
dcerpc_netr_DsrEnumerateDomainTrusts against the
dc of a trusted domain again. This only works
for two-way trusts.

The main problem is the usage of is_trusted_domain()
which doesn't know about the domain, if winbindd can't
enumerate the domains in the other forest.

is_trusted_domain() is used in make_user_info_map(),
which is called in auth3_check_password() before
auth_check_ntlm_password().

That means we're mapping the user of such a domain
to our own local sam, before calling our auth modules.

A much better fix, which removes the usage of is_trusted_domain()
in planed for master, but this should do the job for current releases.

We should avoid talking to DCs of other domains and always
go via our primary domain. As we should code with one-way trusts
also, we need to avoid relying on a complete list of
domains in future.

For now "wbinfo -m" lists domains behind a two-way transitive
trust again, but that is likely to change in future again!

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit fffefe72fcc62d9688b45f53a5327667dc0b2fe6)

8 years agos3:winbindd: make sure cm_prepare_connection() only returns OK with a valid tree...
Stefan Metzmacher [Tue, 31 Jan 2017 14:19:00 +0000 (15:19 +0100)] 
s3:winbindd: make sure cm_prepare_connection() only returns OK with a valid tree connect

If cm_get_ipc_credentials() returned anonymous creds and signing is required
we were returning the result of cm_get_ipc_credentials() instead of
the original error.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(similar to commit cebcc2adc7e568d492466bb69f21ba2a9630a0d2)

8 years agovfs_streams_xattr: use fsp, not base_fsp
Ralph Boehme [Fri, 17 Feb 2017 07:10:53 +0000 (08:10 +0100)] 
vfs_streams_xattr: use fsp, not base_fsp

The base_fsp's fd is always -1 as it's closed after being openend in
create_file_unixpath().

Additionally in streams_xattr_open force using of SMB_VFS_FSETXATTR() by
sticking the just created fd into the fsp (and removing it afterwards).

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 22 08:25:46 CET 2017 on sn-devel-144

(cherry picked from commit 021189e32ba507832b5e821e5cda8a2889225955)

Autobuild-User(v4-4-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-4-test): Sat Feb 25 05:08:00 CET 2017 on sn-devel-144

8 years agolibcli/auth: use the correct creds value against servers without LogonSamLogonEx
Stefan Metzmacher [Wed, 15 Feb 2017 07:58:20 +0000 (08:58 +0100)] 
libcli/auth: use the correct creds value against servers without LogonSamLogonEx

If we use the credential chain we need to use the value from
netlogon_creds_client_authenticator() to make sure we have the current
value to encrypt in logon info.

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

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

8 years agolibrpc/rpc: fix regression in NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE error mapping
Stefan Metzmacher [Wed, 15 Feb 2017 07:07:06 +0000 (08:07 +0100)] 
librpc/rpc: fix regression in NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE error mapping

Commit 1eef70872930fa4f9d3dedd23476b34cae638428 changed the mapping for
DCERPC_NCA_S_FAULT_INVALID_TAG from NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE
to NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE.

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

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

8 years agokrb5_wrap: use our own code to calculate the ENCTYPE_ARCFOUR_HMAC key
Stefan Metzmacher [Tue, 21 Feb 2017 11:15:07 +0000 (12:15 +0100)] 
krb5_wrap: use our own code to calculate the ENCTYPE_ARCFOUR_HMAC key

Our own convert_string_talloc() function handles a wider range
of unicode code points than the MIT krb5 or heimdal code.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Feb 21 20:08:16 CET 2017 on sn-devel-144
(similar to commit 10e1b92c288ae27f775debb16c3e122b6063fa21)

8 years agos4:libcli/raw: remove unused DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH
Stefan Metzmacher [Tue, 23 Aug 2016 10:41:48 +0000 (12:41 +0200)] 
s4:libcli/raw: remove unused DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH

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

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

8 years agos3:include: remove unused DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH
Stefan Metzmacher [Tue, 23 Aug 2016 10:41:48 +0000 (12:41 +0200)] 
s3:include: remove unused DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH

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

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

8 years agos3:net_rpc_trust: make use of trust_pw_new_value()
Stefan Metzmacher [Tue, 23 Aug 2016 08:42:30 +0000 (10:42 +0200)] 
s3:net_rpc_trust: make use of trust_pw_new_value()

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

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

8 years agos3:libnet_join: make use of trust_pw_new_value()
Stefan Metzmacher [Tue, 23 Aug 2016 10:09:57 +0000 (12:09 +0200)] 
s3:libnet_join: make use of trust_pw_new_value()

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

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

8 years agos3:libads: use trust_pw_new_value() for krb5 machine passwords
Stefan Metzmacher [Tue, 23 Aug 2016 08:38:58 +0000 (10:38 +0200)] 
s3:libads: use trust_pw_new_value() for krb5 machine passwords

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(similar to commit 00136940757ea6947f97c9c92b25207d9413727b)

8 years agos3:libsmb: use trust_pw_new_value() in trust_pw_change()
Stefan Metzmacher [Tue, 23 Aug 2016 10:12:35 +0000 (12:12 +0200)] 
s3:libsmb: use trust_pw_new_value() in trust_pw_change()

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

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

8 years agos3:libsmb: add trust_pw_new_value() helper function
Stefan Metzmacher [Tue, 23 Aug 2016 10:12:35 +0000 (12:12 +0200)] 
s3:libsmb: add trust_pw_new_value() helper function

This generates a new trust password based on the secure channel type
and lp_security().

NT4 really has a limit of 28 UTF16 bytes.

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

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

8 years agos3:libsmb: let trust_pw_change() verify the new password at the end.
Stefan Metzmacher [Thu, 9 Feb 2017 21:53:52 +0000 (22:53 +0100)] 
s3:libsmb: let trust_pw_change() verify the new password at the end.

We should notice problems as early as possible, it makes no
sense to keep things working for a while and later find out
the we lost our trust relationship with our domain.

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

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

8 years agos3:libsmb: let trust_pw_change() debug more verbose information
Stefan Metzmacher [Wed, 18 Jan 2017 18:57:30 +0000 (19:57 +0100)] 
s3:libsmb: let trust_pw_change() debug more verbose information

Password changes caused much trouble in the past, so we better debug
them at log level 0 and may see them also in the syslog.

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

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

8 years agolib/util: add generate_random_machine_password() function
Stefan Metzmacher [Tue, 23 Aug 2016 07:30:05 +0000 (09:30 +0200)] 
lib/util: add generate_random_machine_password() function

It generates more random password for the use as machine password,
restricted to codepoints <= 0xFFFF in order to be compatible
with MIT krb5 and Heimdal.

Note: the fallback to ascii if 'unix charset' is not 'utf8'.

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

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

8 years agolibcli/auth: add netlogon_creds_cli_debug_string()
Stefan Metzmacher [Thu, 9 Feb 2017 20:47:52 +0000 (21:47 +0100)] 
libcli/auth: add netlogon_creds_cli_debug_string()

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

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

8 years agolibcli/auth: check E_md4hash() result in netlogon_creds_cli_ServerPasswordSet_send()
Stefan Metzmacher [Wed, 18 Jan 2017 19:02:21 +0000 (19:02 +0000)] 
libcli/auth: check E_md4hash() result in netlogon_creds_cli_ServerPasswordSet_send()

We need to make sure we can convert the given string to an nthash.

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

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

8 years agoctdb-scripts: Initialise CTDB_NFS_CALLOUT in statd-callout
Martin Schwenke [Mon, 13 Feb 2017 22:04:41 +0000 (09:04 +1100)] 
ctdb-scripts: Initialise CTDB_NFS_CALLOUT in statd-callout

Some configurations may set CTDB_NFS_CALLOUT to the empty string.
They may do this if they allow a choice of NFS implementations.  In
this case the default call-out for Linux kernel NFS should be used.
However, statd-callout does not call nfs_callout_init() to set the
default.  Therefore, statd-callout is unable to restart the lock
manager, so the grace period is never entered.

statd-callout must call nfs_callout_init() before trying to restart
the lock manager.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Feb 16 09:21:03 CET 2017 on sn-devel-144

(cherry picked from commit 5e7ae1b1e2fa8137aaa6a2a2f446156ae61f4c84)

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Fri Feb 17 16:02:00 CET 2017 on sn-devel-144

8 years agoctdb-tests: Add more comm tests
Amitay Isaacs [Tue, 7 Feb 2017 04:18:02 +0000 (15:18 +1100)] 
ctdb-tests: Add more comm tests

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 024a2c20d2bcdbcc43d16d492c7cd2d09b93c8f0)

8 years agoctdb-common: Fix use-after-free error in comm_fd_handler()
Amitay Isaacs [Mon, 6 Feb 2017 04:54:55 +0000 (15:54 +1100)] 
ctdb-common: Fix use-after-free error in comm_fd_handler()

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

comm_write_send() creates a new tevent_req and adds it to the queue
of requests to be processed.  If this tevent_req is freed, then the
queue entry is not removed causing use-after-free error.

If the tevent_req returned by comm_write_send() is freed, then that
request should be removed from the queue and any pending actions based
on that request should also be removed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 9db7785fc6ffbaad434ee189c0f46c488358aab5)

8 years agos3: smbd: Don't loop infinitely on bad-symlink resolution.
Jeremy Allison [Wed, 15 Feb 2017 23:42:52 +0000 (15:42 -0800)] 
s3: smbd: Don't loop infinitely on bad-symlink resolution.

In the FILE_OPEN_IF case we have O_CREAT, but not
O_EXCL. Previously we went into a loop trying first
~(O_CREAT|O_EXCL), and if that returned ENOENT
try (O_CREAT|O_EXCL). We kept looping indefinately
until we got an error, or the file was created or
opened.

The big problem here is dangling symlinks. Opening
without O_NOFOLLOW means both bad symlink
and missing path return -1, ENOENT from open(). As POSIX
is pathname based it's not possible to tell
the difference between these two cases in a
non-racy way, so change to try only two attempts before
giving up.

We don't have this problem for the O_NOFOLLOW
case as we just return NT_STATUS_OBJECT_PATH_NOT_FOUND
mapped from the ELOOP POSIX error and immediately
returned.

Unroll the loop logic to two tries instead.

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

Pair-programmed-with: Ralph Boehme <slow@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 10c3e3923022485c720f322ca4f0aca5d7501310)

8 years agos3-vfs: Only walk the directory once in open_and_sort_dir()
Andreas Schneider [Thu, 9 Feb 2017 14:05:01 +0000 (15:05 +0100)] 
s3-vfs: Only walk the directory once in open_and_sort_dir()

On a slow filesystem or network filesystem this can make a huge
difference.

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

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

8 years agos3/rpc_server/mdssvc: add attribute "kMDItemContentType"
Ralph Boehme [Tue, 31 Jan 2017 15:09:55 +0000 (16:09 +0100)] 
s3/rpc_server/mdssvc: add attribute "kMDItemContentType"

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 15 06:20:52 CET 2017 on sn-devel-144

(cherry picked from commit e08110ece699eeb1b9ef688c92bf84c69a6fa5fc)

8 years agos3/smbd: check for invalid access_mask smbd_calculate_access_mask()
Ralph Boehme [Mon, 23 Jan 2017 15:19:06 +0000 (16:19 +0100)] 
s3/smbd: check for invalid access_mask smbd_calculate_access_mask()

This makes us pass "base.createx_access".

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 326765923f1d384e5cd8b7fda048b459c67a4bf5)

8 years agoselftest: also run test base.createx_access against ad_dc
Ralph Boehme [Mon, 23 Jan 2017 16:35:51 +0000 (17:35 +0100)] 
selftest: also run test base.createx_access against ad_dc

Fails currently, will be made to work in the next commit.

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

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

8 years agos3:librpc: remove bigendian argument from dcerpc_pull_ncacn_packet()
Stefan Metzmacher [Wed, 28 Oct 2015 11:16:05 +0000 (12:16 +0100)] 
s3:librpc: remove bigendian argument from dcerpc_pull_ncacn_packet()

We should get this from the packet itself.

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

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12581
smbclient fails on bad endianess when listing shares from Solaris kernel SMB
server on SPARC

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Wed Feb 15 15:14:04 CET 2017 on sn-devel-144

8 years agos3: VFS: Don't allow symlink, link or rename on already converted paths.
Jeremy Allison [Fri, 27 Jan 2017 01:19:24 +0000 (17:19 -0800)] 
s3: VFS: Don't allow symlink, link or rename on already converted paths.

Snapshot paths are a read-only filesystem.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan 30 22:26:29 CET 2017 on sn-devel-144

(backported from commit 0e1deb77f2b310ad7e5dd784174207adacf1c981)

8 years agos3: VFS: shadow_copy2: Fix usage of saved_errno to only set errno on error.
Jeremy Allison [Mon, 23 Jan 2017 18:20:13 +0000 (10:20 -0800)] 
s3: VFS: shadow_copy2: Fix usage of saved_errno to only set errno on error.

Rationale:

VFS calls must act like their POSIX equivalents, and the POSIX versions
*only* set errno on a failure. There is actually code in the upper smbd
layers that depends on errno being correct on a fail return from a VFS call.

For a compound VFS module like this, a common pattern is :

SMB_VFS_CALL_X()
{
      int ret;

      syscall1();
      ret = syscall2();
      syscall3();

      return ret;
}

Where if *any* of the contained syscallX()'s fail, they'll set errno.
However, the actual errno we should return is *only* the one returned
if syscall2() fails (the others are lstat's checking for existence etc.).

So what we should do to correctly return only the errno from syscall2() is:

SMB_VFS_CALL_X()
{
      int ret;
      int saved_errno = 0;

      syscall1()

      ret = syscall2();
      if (ret == -1) {
            saved_errno = errno;
      }
      syscall3()

      if (saved_errno != 0) {
           errno = saved_errno;
      }
      return ret;
}

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit cda6764f1a8db96182bfd1855440bc6a1ba1abee)

8 years agos3: VFS: shadow_copy2: Fix a memory leak in the connectpath function.
Jeremy Allison [Mon, 23 Jan 2017 18:06:44 +0000 (10:06 -0800)] 
s3: VFS: shadow_copy2: Fix a memory leak in the connectpath function.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 4d339a88851f601fae195ac8ff0691cbd3504f41)

8 years agos3: VFS: shadow_copy2: Fix module to work with variable current working directory.
Jeremy Allison [Thu, 26 Jan 2017 18:49:51 +0000 (10:49 -0800)] 
s3: VFS: shadow_copy2: Fix module to work with variable current working directory.

Completely cleans up the horrible shadow_copy2_strip_snapshot()
and adds an explaination of what it's actually trying to do.

* This function does two things.
*
* 1). Checks if an incoming filename is already a
* snapshot converted pathname.
*     If so, it returns the pathname truncated
*     at the snapshot point which will be used
*     as the connectpath, and then does an early return.
*
* 2). Checks if an incoming filename contains an
* SMB-layer @GMT- style timestamp.
*     If so, it strips the timestamp, and returns
*     both the timestamp and the stripped path
*     (making it cwd-relative).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 128d5f27cd42b0c7efcbe3d28fe3eee881e0734b)

8 years agos3: VFS: Add utility function check_for_converted_path().
Jeremy Allison [Thu, 26 Jan 2017 18:35:50 +0000 (10:35 -0800)] 
s3: VFS: Add utility function check_for_converted_path().

Detects an already converted path. Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit b94dc85d339c9a10496edd07b85bdd7808d2e332)

8 years agos3: VFS: Ensure shadow:format cannot contain a / path separator.
Jeremy Allison [Thu, 26 Jan 2017 18:24:52 +0000 (10:24 -0800)] 
s3: VFS: Ensure shadow:format cannot contain a / path separator.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit cd4f940162b17e4f7345d392326a31ae478230fa)

8 years agos3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from...
Jeremy Allison [Fri, 20 Jan 2017 20:09:08 +0000 (12:09 -0800)] 
s3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 42bd1acad75a6b5ea81fe4b30c067dd82623c042)

8 years agos3: VFS: shadow_copy2: Fix chdir to store off the needed private variables.
Jeremy Allison [Fri, 20 Jan 2017 20:06:55 +0000 (12:06 -0800)] 
s3: VFS: shadow_copy2: Fix chdir to store off the needed private variables.

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

This is not yet used, the users of this will be added later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 27340df4b52e4341f134667c59d71656a7a1fdae)

8 years agos3: VFS: shadow_copy2: Add two currently unused functions to make pathnames absolute...
Jeremy Allison [Fri, 20 Jan 2017 20:00:08 +0000 (12:00 -0800)] 
s3: VFS: shadow_copy2: Add two currently unused functions to make pathnames absolute or relative to $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 9d65107b8f2864dba8d41b3316c483b3f36d0697)

8 years agos3: VFS: shadow_copy2: Change a parameter name.
Jeremy Allison [Fri, 20 Jan 2017 19:56:21 +0000 (11:56 -0800)] 
s3: VFS: shadow_copy2: Change a parameter name.

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

Allows easy substitution later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 2887465108aef5e2e7c64417437ecb86c7460e16)

8 years agos3: VFS: shadow_copy2: Add a wrapper function to call the original shadow_copy2_strip...
Jeremy Allison [Fri, 20 Jan 2017 19:54:56 +0000 (11:54 -0800)] 
s3: VFS: shadow_copy2: Add a wrapper function to call the original shadow_copy2_strip_snapshot().

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

Allows an extra (currently unused) parameter to be added.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 5aa1ea95157475dfd2d056f0158b14b2b90895a9)

8 years agos3: VFS: shadow_copy2: Add two new variables to the config data. Not yet used.
Jeremy Allison [Fri, 20 Jan 2017 19:50:49 +0000 (11:50 -0800)] 
s3: VFS: shadow_copy2: Add two new variables to the config data. Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 72fe2b62e3ee7462e5be855b01943f28b26c36c1)

8 years agos3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length.
Jeremy Allison [Fri, 20 Jan 2017 19:48:40 +0000 (11:48 -0800)] 
s3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 37ef8d3f65bd1215717eb51b2e1cdb84a7bed348)

8 years agos3: VFS: shadow_copy2: Ensure pathnames for parameters are correctly relative and...
Jeremy Allison [Fri, 20 Jan 2017 19:45:54 +0000 (11:45 -0800)] 
s3: VFS: shadow_copy2: Ensure pathnames for parameters are correctly relative and terminated.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 979e39252bcc88e8aacb543b8bf322dd6f17fe7f)

8 years agos3: VFS: shadow_copy2: Correctly initialize timestamp and stripped variables.
Jeremy Allison [Fri, 20 Jan 2017 19:42:39 +0000 (11:42 -0800)] 
s3: VFS: shadow_copy2: Correctly initialize timestamp and stripped variables.

Allow the called functions to be fixed to not touch them on error.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 0a190f4dd950c947d47c42163d11ea4bd6e6e508)

8 years agos3: smbd: Make set_conn_connectpath() call canonicalize_absolute_path().
Jeremy Allison [Tue, 17 Jan 2017 19:35:52 +0000 (11:35 -0800)] 
s3: smbd: Make set_conn_connectpath() call canonicalize_absolute_path().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit d650d65488761b30fa34d42cb1ab400618a78c33)

8 years agos3: smbtorture: Add new local test LOCAL-CANONICALIZE-PATH
Jeremy Allison [Fri, 27 Jan 2017 00:08:42 +0000 (16:08 -0800)] 
s3: smbtorture: Add new local test LOCAL-CANONICALIZE-PATH

Tests new canonicalize_absolute_path() function.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit a51363309a4330b65e34ae941ec99d180bdbab56)

8 years agos3: lib: Fix two old, old bugs in set_conn_connectpath(), now in canonicalize_absolut...
Jeremy Allison [Thu, 19 Jan 2017 23:18:41 +0000 (15:18 -0800)] 
s3: lib: Fix two old, old bugs in set_conn_connectpath(), now in canonicalize_absolute_path().

Canonicalizing a path of /foo/bar/../baz would return /foo/barbaz
as moving forward 3 characters would delete the / character.

Canonicalizing /foo/.. would end up as '\0'.

Test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 82979afc46cc5e466bdd999a94080e7a5df95518)

8 years agos3: lib: Add canonicalize_absolute_path().
Jeremy Allison [Tue, 17 Jan 2017 19:33:18 +0000 (11:33 -0800)] 
s3: lib: Add canonicalize_absolute_path().

Resolves any invalid path components (.) (..)
in an absolute POSIX path.

We will be re-using this in several places.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 02599c39337c3049762a6b0bd6290577817ee5a5)

8 years agos3: smbd: Correctly canonicalize any incoming shadow copy path.
Jeremy Allison [Thu, 12 Jan 2017 00:30:38 +0000 (16:30 -0800)] 
s3: smbd: Correctly canonicalize any incoming shadow copy path.

Converts to:

@GMT-token/path/last_component

from all incoming path types. Allows shadow_copy modules
to work when current directory is changed after removing
last component.

Ultimately when the VFS ABI is changed to add a timestamp
to struct smb_filename, this is where the parsing will be
done.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 39678ed6af708fb6f2760bfb51051add11e3c498)

8 years agowaf: backport finding of pkg-config
Uri Simchoni [Thu, 19 Jan 2017 05:46:57 +0000 (07:46 +0200)] 
waf: backport finding of pkg-config

Allow the builder to customize the location of pkg-config
utility by setting PKGCONFIG environment variable.

This is backported from upstream waf.

Thanks to Zentaro Kavanagh <zentaro@google.com> for
pointing that out and proposing the fix.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 25 04:23:00 CET 2017 on sn-devel-144

(cherry picked from commit 2cf141ed45b4f7b7754cb9525d987ff38495d789)

8 years agos3: VFS: vfs_streams_xattr.c: Make streams_xattr_open() store the same path as stream...
Jeremy Allison [Wed, 1 Feb 2017 19:36:25 +0000 (11:36 -0800)] 
s3: VFS: vfs_streams_xattr.c: Make streams_xattr_open() store the same path as streams_xattr_recheck().

If the open is changing directories, fsp->fsp_name->base_name
will be the full path from the share root, whilst
smb_fname will be relative to the $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb  2 01:55:42 CET 2017 on sn-devel-144

(cherry picked from commit a24ba3e4083200ec9885363efc5769f43183fb6b)

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Tue Feb  7 13:05:34 CET 2017 on sn-devel-144

8 years agosmbd: Fix "map acl inherit" = yes
Volker Lendecke [Wed, 1 Feb 2017 14:41:43 +0000 (14:41 +0000)] 
smbd: Fix "map acl inherit" = yes

Brown-Paper-Bag bug in f85c2a6852a. The assignment contains a self-reference
in get_pai_flags which I missed.

Fix an uninitialized read.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12551
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb  1 22:06:50 CET 2017 on sn-devel-144

(cherry picked from commit 129bc58eee4b1868b1aaec6194808752520517b4)

8 years agos3: vfs: dirsort doesn't handle opendir of "." correctly.
Jeremy Allison [Fri, 27 Jan 2017 17:09:56 +0000 (09:09 -0800)] 
s3: vfs: dirsort doesn't handle opendir of "." correctly.

Needs to store $cwd path for correct sorting.

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

Back-port from commit e2f34116ab6328e2b872999dc7c4bcda69c03ab2.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
8 years agovfs_fruit: checks wrong AAPL config state and so always uses readdirattr
Ralph Boehme [Thu, 26 Jan 2017 10:49:55 +0000 (11:49 +0100)] 
vfs_fruit: checks wrong AAPL config state and so always uses readdirattr

readdirattr should only be enabled if the client enables it via AAPL
negotitiation, not for all clients when vfs_fruit is loaded.

Unfortunately the check in fruit_readdir_attr() is

  if (!config->use_aapl) {
    return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
  }

This uses the wrong config state "use_aapl" which is always true by
default (config option "fruit:aapl").

We must use "nego_aapl" instead which is only true if the client
really negotiated this feature.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan 28 01:49:11 CET 2017 on sn-devel-144

(cherry picked from commit 9a3b64a24cc21124485b423c9b70b67ff5a96f10)

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Wed Feb  1 16:27:14 CET 2017 on sn-devel-144

8 years agoselftest/Samba3: use "server min protocol = SMB3_00" for "ktest"
Stefan Metzmacher [Wed, 25 Jan 2017 20:15:44 +0000 (21:15 +0100)] 
selftest/Samba3: use "server min protocol = SMB3_00" for "ktest"

This verifies that clients can still connect with that setting.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jan 27 12:03:39 CET 2017 on sn-devel-144

(cherry picked from commit 348bcca76855798d60c04ddb30f1e13b2ac2d7cd)

8 years agos3:smbd: allow "server min protocol = SMB3_00" to go via "SMB 2.???" negprot
Stefan Metzmacher [Wed, 18 Jan 2017 07:37:30 +0000 (08:37 +0100)] 
s3:smbd: allow "server min protocol = SMB3_00" to go via "SMB 2.???" negprot

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

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

8 years agoselftest: add test for global "smb encrypt=off"
Ralph Boehme [Wed, 18 Jan 2017 15:23:40 +0000 (16:23 +0100)] 
selftest: add test for global "smb encrypt=off"

Test various combinations of having encryption globally turned off and
enabled (desired/required) on a share, with SMB1 UNIX Extensions and SMB3.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 21d030e5bdf7dc6ef8d5f4e70bed7e70b731cd15)

8 years agoselftest: disable SMB encryption in simpleserver environment
Ralph Boehme [Tue, 17 Jan 2017 16:23:51 +0000 (17:23 +0100)] 
selftest: disable SMB encryption in simpleserver environment

Encryption is currently not tested in this env so we can safely turn it
off. The next commit will add a blackbox tests that test combinations of
having encryption globally turned off and enabled (desired/required) on
a share.

This also adds a new share "enc_desired" with "smb encrypt = desired"
which will be used by the test in the next commit.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 573e8e15b3ed27d6b593e635e9c24eea3fdf4fb9)

8 years agodocs: impact of a global "smb encrypt=off" on a share with "smb encrypt=required"
Ralph Boehme [Mon, 16 Jan 2017 14:45:32 +0000 (15:45 +0100)] 
docs: impact of a global "smb encrypt=off" on a share with "smb encrypt=required"

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

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

8 years agos3/smbd: ensure global "smb encrypt = off" is effective for share with "smb encrypt...
Ralph Boehme [Mon, 16 Jan 2017 11:56:10 +0000 (12:56 +0100)] 
s3/smbd: ensure global "smb encrypt = off" is effective for share with "smb encrypt = desired"

If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of specifying

[Global]
  smb encrypt = off

[share]
  smb encrypt = desired

must be an unecrypted tree connect to the share "share".

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

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

8 years agos3/smbd: ensure global "smb encrypt = off" is effective for SMB 3.1.1 clients
Ralph Boehme [Thu, 5 Jan 2017 11:14:35 +0000 (12:14 +0100)] 
s3/smbd: ensure global "smb encrypt = off" is effective for SMB 3.1.1 clients

If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of setting

[Global]
  smb encrypt = off

[share]
  smb encrypt = required

must be to completely deny access to the share "share".

This was working correctly for clients when using SMB 3 dialects <
3.1.1, but not for 3.1.1 with a negprot encryption context.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6ae63d42f5aacddf5b7b6dbdfbe620344989e4e5)

8 years agos3/smbd: ensure global "smb encrypt = off" is effective for SMB 1 clients
Ralph Boehme [Wed, 18 Jan 2017 15:19:15 +0000 (16:19 +0100)] 
s3/smbd: ensure global "smb encrypt = off" is effective for SMB 1 clients

If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of setting

[Global]
  smb encrypt = off

[share_required]
  smb encrypt = required

[share_desired]
  smb encrypt = desired

must be to completely deny access to the share "share_required" and an
unencrypted connection to "share_desired".

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 43a90cee46bb7a70f7973c4fc51eee7634e43145)

8 years agoMerge tag 'samba-4.4.9' into v4-4-test
Stefan Metzmacher [Mon, 30 Jan 2017 12:35:22 +0000 (13:35 +0100)] 
Merge tag 'samba-4.4.9' into v4-4-test

samba: tag release samba-4.4.9

8 years agoscript/release.sh: fix off by 1 error in announce.${tagname}.mail.txt creation
Stefan Metzmacher [Thu, 12 Jan 2017 09:40:37 +0000 (10:40 +0100)] 
script/release.sh: fix off by 1 error in announce.${tagname}.mail.txt creation

Pair-Programmed-With: Karolin Seeger <kseeger@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Thu Jan 12 15:34:25 CET 2017 on sn-devel-144

(cherry picked from commit 7870c645b79da647bae45b4dc95e7d6e9abcd91a)

Autobuild-User(v4-4-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-4-test): Fri Jan 27 11:52:07 CET 2017 on sn-devel-144

8 years agovfs_default: unlock the right file in copy chunk
Björn Jacke [Thu, 19 Jan 2017 20:51:41 +0000 (21:51 +0100)] 
vfs_default: unlock the right file in copy chunk

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Jan 21 17:00:54 CET 2017 on sn-devel-144

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

(cherry picked from commit 5059c8e2e3a6159bc2917ddd80d09fab35b39e66)

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Thu Jan 26 12:41:13 CET 2017 on sn-devel-144

8 years agomessaging: Fix dead but not cleaned-up-yet destination sockets
Volker Lendecke [Tue, 10 Jan 2017 12:30:54 +0000 (12:30 +0000)] 
messaging: Fix dead but not cleaned-up-yet destination sockets

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 10 17:40:58 CET 2017 on sn-devel-144

(cherry picked from commit e84e44ce923e5dc7529bb813e10a2890528a4ab0)

Autobuild-User(v4-4-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-4-test): Sat Jan 14 13:55:25 CET 2017 on sn-devel-144

8 years agos3:librpc/gse: make use of gss_krb5_import_cred() instead of gss_acquire_cred()
Stefan Metzmacher [Thu, 22 Dec 2016 07:49:38 +0000 (08:49 +0100)] 
s3:librpc/gse: make use of gss_krb5_import_cred() instead of gss_acquire_cred()

This avoids the usage of the ccselect_realm logic in MIT krb5,
which leads to unpredictable results.

The problem is the usage of gss_acquire_cred(), that just creates
a credential handle without ccache.

As result gss_init_sec_context() will trigger a code path
where it use "ccselect" plugins. And the ccselect_realm
module just chooses a random ccache from a global list
where the realm of the provides target principal matches
the realm of the ccache user principal.

In the winbindd case we're using MEMORY:cliconnect to setup
the smb connection to the DC. For ldap connections we use
MEMORY:winbind_ccache.

The typical case is that we do the smb connection first.
If we try to create a new ldap connection, while the
credentials in MEMORY:cliconnect are expired,
we'll do the required kinit into MEMORY:winbind_ccache,
but the ccselect_realm module will select MEMORY:cliconnect
and tries to get a service ticket for the ldap server
using the already expired TGT from MEMORY:cliconnect.

The solution will be to use gss_krb5_import_cred() and explicitly
pass the desired ccache, which avoids the ccselect logic.

We could also use gss_acquire_cred_from(), but that's only available
in modern MIT krb5 versions, while gss_krb5_import_cred() is available
in heimdal and all supported MIT versions (>=1.9).
As far as I can see both call the same internal function in MIT
(at least for the ccache case).

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

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

8 years agos3:librpc/gse: remove unused #ifdef HAVE_GSS_KRB5_IMPORT_CRED
Stefan Metzmacher [Thu, 22 Dec 2016 07:47:32 +0000 (08:47 +0100)] 
s3:librpc/gse: remove unused #ifdef HAVE_GSS_KRB5_IMPORT_CRED

We always have gss_krb5_import_cred(), it available in heimdal
and also the oldest version (1.9) of MIT krb5 that we support.

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

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

8 years agos3:librpc/gse: include ccache_name in DEBUG message if krb5_cc_resolve() fails
Stefan Metzmacher [Thu, 22 Dec 2016 07:46:21 +0000 (08:46 +0100)] 
s3:librpc/gse: include ccache_name in DEBUG message if krb5_cc_resolve() fails

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

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

8 years agosmbd/ioctl: match WS2016 ReFS set compression behaviour
David Disseldorp [Thu, 5 Jan 2017 16:36:02 +0000 (17:36 +0100)] 
smbd/ioctl: match WS2016 ReFS set compression behaviour

ReFS doesn't support compression, but responds to set-compression FSCTLs
with NT_STATUS_OK if (and only if) the requested compression format is
COMPRESSION_FORMAT_NONE.

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

Reported-by: Nick Barrett <nick@barrett.org.nz>
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): Mon Jan  9 23:14:28 CET 2017 on sn-devel-144

(cherry picked from commit 28cc347876b97b7409d6efd377f031fc6df0c5f3)

8 years agotorture/ioctl: test set_compression(format_none)
David Disseldorp [Thu, 5 Jan 2017 16:10:42 +0000 (17:10 +0100)] 
torture/ioctl: test set_compression(format_none)

This test case was overlooked in the previous bso#12144 update -
set compression requests with format=COMPRESSION_FORMAT_NONE should
succeed if the server / backing storage doesn't offer compression
support.
Confirm that Samba matches Windows Server 2016 ReFS behaviour here.

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

Reported-by: Nick Barrett <nick@barrett.org.nz>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6fde123176409e261d955e24b3d28e5124f33bed)

8 years agopam: map more NT password errors to PAM errors
Björn Jacke [Wed, 25 Nov 2015 13:04:24 +0000 (14:04 +0100)] 
pam: map more NT password errors to PAM errors

NT_STATUS_ACCOUNT_DISABLED,
NT_STATUS_PASSWORD_RESTRICTION,
NT_STATUS_PWD_HISTORY_CONFLICT,
NT_STATUS_PWD_TOO_RECENT,
NT_STATUS_PWD_TOO_SHORT

now map to PAM_AUTHTOK_ERR (Authentication token manipulation error), which is
the closest match.

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed by: Jeremy Allison <jra@samba.org>

(cherry picked from commit 69f10080c3765a9b139fbad7f3dc633066fdded2)

8 years agos3: torture: Add test for cli_ftruncate calling cli_smb2_ftruncate.
Jeremy Allison [Tue, 3 Jan 2017 23:37:03 +0000 (15:37 -0800)] 
s3: torture: Add test for cli_ftruncate calling cli_smb2_ftruncate.

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

Back-port from cherry pick from commit b92cac857823ac2d29133fba2fde57cf58805b45)

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Mon Jan  9 14:18:47 CET 2017 on sn-devel-144

8 years agos3: libsmb: Add cli_smb2_ftruncate(), plumb into cli_ftruncate().
Jeremy Allison [Wed, 21 Dec 2016 21:55:50 +0000 (13:55 -0800)] 
s3: libsmb: Add cli_smb2_ftruncate(), plumb into cli_ftruncate().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit e0f1ed9f450851bf5b7fec84577b50047309db3f)

8 years agoselftest: Do not include system krb5.conf in selftest
Andreas Schneider [Thu, 1 Dec 2016 07:18:58 +0000 (08:18 +0100)] 
selftest: Do not include system krb5.conf in selftest

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 years agos3:libads: Include system /etc/krb5.conf if we use MIT Kerberos
Andreas Schneider [Wed, 23 Nov 2016 13:40:42 +0000 (14:40 +0100)] 
s3:libads: Include system /etc/krb5.conf if we use MIT Kerberos

The system /etc/krb5.conf defines some defaults like:

    default_ccache_name = KEYRING:persistent:%{uid}

We need to respect that so should include it in our own created
krb5.conf file.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 4ef772be3a7259b48253643392574fab28c37916)

8 years agos3:param: Add an 'include system krb5 conf' option
Andreas Schneider [Wed, 23 Nov 2016 13:39:47 +0000 (14:39 +0100)] 
s3:param: Add an 'include system krb5 conf' option

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit f464f69b33b40c81d6ee57bebf9d59837431739b)

8 years agoVERSION: Disable GIT_SNAPSHOTS for the 4.4.9 release. samba-4.4.9
Karolin Seeger [Mon, 2 Jan 2017 09:18:13 +0000 (10:18 +0100)] 
VERSION: Disable GIT_SNAPSHOTS for the 4.4.9 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoWHATSNEW: Add release notes for Samba 4.4.9.
Karolin Seeger [Mon, 2 Jan 2017 09:17:14 +0000 (10:17 +0100)] 
WHATSNEW: Add release notes for Samba 4.4.9.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agokrb5_wrap: provide CKSUMTYPE_HMAC_SHA1_96_AES_*
Stefan Metzmacher [Tue, 19 Jul 2016 14:31:01 +0000 (16:31 +0200)] 
krb5_wrap: provide CKSUMTYPE_HMAC_SHA1_96_AES_*

MIT only defined this as CKSUMTYPE_HMAC_SHA1_96_AES128,
while Heimdal has CKSUMTYPE_HMAC_SHA1_96_AES_128.

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

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12471
Patches for CVE-2016-2126 break build with MIT Kerberos

Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Tue Dec 20 15:58:07 CET 2016 on sn-devel-144

8 years agoVERSION: Bump version up to 4.4.9...
Stefan Metzmacher [Tue, 20 Dec 2016 07:36:09 +0000 (08:36 +0100)] 
VERSION: Bump version up to 4.4.9...

and re-enable git snapshots.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agoVERSION: Disable GIT_SNAPSHOTS for the 4.4.8 release.
Karolin Seeger [Fri, 9 Dec 2016 09:59:57 +0000 (10:59 +0100)] 
VERSION: Disable GIT_SNAPSHOTS for the 4.4.8 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-4-test): Mon Dec 19 14:32:43 CET 2016 on sn-devel-144