kai/samba-autobuild/.git
7 years agolib: Avoid includes.h in access.c
Volker Lendecke [Wed, 16 Nov 2016 16:15:27 +0000 (16:15 +0000)]
lib: Avoid includes.h in access.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 16 22:26:14 CET 2016 on sn-devel-144

7 years agolib: memcache.h needs some includes
Volker Lendecke [Wed, 16 Nov 2016 16:13:12 +0000 (16:13 +0000)]
lib: memcache.h needs some includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agosource4: Change to use lib/util/access functions.
Jeremy Allison [Fri, 11 Nov 2016 04:33:17 +0000 (20:33 -0800)]
source4: Change to use lib/util/access functions.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 16 16:35:12 CET 2016 on sn-devel-144

7 years agolib: util: Add allow_access_nolog().
Jeremy Allison [Mon, 14 Nov 2016 19:48:32 +0000 (11:48 -0800)]
lib: util: Add allow_access_nolog().

Make allow_access() call allow_access_nolog(), then log.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoMove source3/lib/access.c to toplevel lib/util/access.c
Jeremy Allison [Fri, 11 Nov 2016 01:15:20 +0000 (17:15 -0800)]
Move source3/lib/access.c to toplevel lib/util/access.c

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: lib: Replace s3 strnequal with top level strncasecmp_m.
Jeremy Allison [Fri, 11 Nov 2016 01:09:33 +0000 (17:09 -0800)]
s3: lib: Replace s3 strnequal with top level strncasecmp_m.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: lib: Use top level function strequal_m not the s3 strequal
Jeremy Allison [Fri, 11 Nov 2016 01:07:11 +0000 (17:07 -0800)]
s3: lib: Use top level function strequal_m not the s3 strequal

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: lib: Change masked_match() from SMB_STRDUP macro to underlying smb_xstrdup function.
Jeremy Allison [Fri, 11 Nov 2016 01:02:08 +0000 (17:02 -0800)]
s3: lib: Change masked_match() from SMB_STRDUP macro to underlying smb_xstrdup function.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolib/util: Move unix_wild_match() from source3/lib/util to lib/util/
Jeremy Allison [Fri, 11 Nov 2016 18:35:01 +0000 (10:35 -0800)]
lib/util: Move unix_wild_match() from source3/lib/util to lib/util/

Use top-level functions instead of source3 specific ones.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: lib: Move from talloc_strdup then lower to strlower_talloc()
Jeremy Allison [Fri, 11 Nov 2016 18:24:40 +0000 (10:24 -0800)]
s3: lib: Move from talloc_strdup then lower to strlower_talloc()

Do things in one go.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: util: Remove unneeded strequal() call. Convert to simple character check.
Jeremy Allison [Fri, 11 Nov 2016 18:22:52 +0000 (10:22 -0800)]
s3: util: Remove unneeded strequal() call. Convert to simple character check.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: lib - Fix formatting of unix_wild_match() sub-function to README.Coding standards.
Jeremy Allison [Fri, 11 Nov 2016 18:21:10 +0000 (10:21 -0800)]
s3: lib - Fix formatting of unix_wild_match() sub-function to README.Coding standards.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agonss_wins: Fix errno values for HOST_NOT_FOUND
Andreas Schneider [Sun, 13 Nov 2016 16:40:21 +0000 (17:40 +0100)]
nss_wins: Fix errno values for HOST_NOT_FOUND

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 16 04:10:55 CET 2016 on sn-devel-144

7 years agos3:net: Use messaging_init_client()
Andreas Schneider [Mon, 14 Nov 2016 08:54:53 +0000 (09:54 +0100)]
s3:net: Use messaging_init_client()

Pair-Programmed-With: Jeremy Allison <jra@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
7 years agos3:rpcclient: Use messaging_init_client()
Andreas Schneider [Mon, 14 Nov 2016 08:51:52 +0000 (09:51 +0100)]
s3:rpcclient: Use messaging_init_client()

Pair-Programmed-With: Jeremy Allison <jra@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
7 years agos3:messaging: Add messaging_init_client() function
Andreas Schneider [Mon, 14 Nov 2016 08:49:20 +0000 (09:49 +0100)]
s3:messaging: Add messaging_init_client() function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3:messaging: Create an messaging_init_internal() returning NTSTATUS
Andreas Schneider [Mon, 14 Nov 2016 08:42:51 +0000 (09:42 +0100)]
s3:messaging: Create an messaging_init_internal() returning NTSTATUS

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3:rpcclient: Print a new line on exit
Andreas Schneider [Mon, 14 Nov 2016 10:36:03 +0000 (11:36 +0100)]
s3:rpcclient: Print a new line on exit

If you press 'ctrl+d' print a new line for the shell.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolib:util: Don't print lstat warning on ERROR debug level
Andreas Schneider [Mon, 14 Nov 2016 10:31:20 +0000 (11:31 +0100)]
lib:util: Don't print lstat warning on ERROR debug level

If we are a client and can't access the lock directory don't confuse a
user.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3:tests: Set missing directories for test_registry_upgrade.sh
Andreas Schneider [Tue, 15 Nov 2016 09:58:48 +0000 (10:58 +0100)]
s3:tests: Set missing directories for test_registry_upgrade.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-winbind: Directly pass creds with cli_session_setup_creds()
Andreas Schneider [Wed, 14 Sep 2016 07:19:42 +0000 (09:19 +0200)]
s3-winbind: Directly pass creds with cli_session_setup_creds()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Nov 15 14:51:02 CET 2016 on sn-devel-144

7 years agos3:libsmb: make use of cli_{session_setup,rpc_pipe_open_with}_creds() in passchange.c
Stefan Metzmacher [Fri, 28 Oct 2016 11:48:23 +0000 (13:48 +0200)]
s3:libsmb: make use of cli_{session_setup,rpc_pipe_open_with}_creds() in passchange.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:client: use cli_session_setup_creds() in smbspool.c
Stefan Metzmacher [Fri, 28 Oct 2016 11:33:58 +0000 (13:33 +0200)]
s3:client: use cli_session_setup_creds() in smbspool.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:client: use cli_session_setup_creds() in client.c cmd_logon()
Stefan Metzmacher [Fri, 28 Oct 2016 11:33:58 +0000 (13:33 +0200)]
s3:client: use cli_session_setup_creds() in client.c cmd_logon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: make use of auth_generic_set_creds() in test_smb2.c
Stefan Metzmacher [Fri, 28 Oct 2016 10:44:51 +0000 (12:44 +0200)]
s3:torture: make use of auth_generic_set_creds() in test_smb2.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: make use of cli_session_setup_creds() in test_smb2.c
Stefan Metzmacher [Fri, 28 Oct 2016 10:44:51 +0000 (12:44 +0200)]
s3:torture: make use of cli_session_setup_creds() in test_smb2.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: make use of cli_session_setup_creds() in torture.c
Stefan Metzmacher [Fri, 28 Oct 2016 10:44:51 +0000 (12:44 +0200)]
s3:torture: make use of cli_session_setup_creds() in torture.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: create a global 'torture_creds' cli_credentials structure
Stefan Metzmacher [Fri, 28 Oct 2016 10:43:44 +0000 (12:43 +0200)]
s3:torture: create a global 'torture_creds' cli_credentials structure

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: make use of cli_session_creds_init() in masktest.c
Stefan Metzmacher [Fri, 28 Oct 2016 10:42:01 +0000 (12:42 +0200)]
s3:torture: make use of cli_session_creds_init() in masktest.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:torture: make use of cli_session_setup_anon()
Stefan Metzmacher [Fri, 28 Oct 2016 10:15:20 +0000 (12:15 +0200)]
s3:torture: make use of cli_session_setup_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:nmbd: make use of cli_session_setup_anon()
Stefan Metzmacher [Fri, 28 Oct 2016 10:15:20 +0000 (12:15 +0200)]
s3:nmbd: make use of cli_session_setup_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: make use of cli_session_setup_anon()
Stefan Metzmacher [Fri, 28 Oct 2016 10:15:20 +0000 (12:15 +0200)]
s3:libsmb: make use of cli_session_setup_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: make cli_session_creds_init() non-static
Stefan Metzmacher [Fri, 28 Oct 2016 10:09:05 +0000 (12:09 +0200)]
s3:libsmb: make cli_session_creds_init() non-static

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: add cli_session_setup_anon()
Stefan Metzmacher [Fri, 28 Oct 2016 10:01:50 +0000 (12:01 +0200)]
s3:libsmb: add cli_session_setup_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: change cli_session_setup_send/recv into cli_session_setup_creds_send/recv
Stefan Metzmacher [Wed, 26 Oct 2016 11:17:59 +0000 (13:17 +0200)]
s3:libsmb: change cli_session_setup_send/recv into cli_session_setup_creds_send/recv

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: move domain\\username magic to cli_session_creds_init()
Stefan Metzmacher [Wed, 26 Oct 2016 10:41:10 +0000 (12:41 +0200)]
s3:libsmb: move domain\\username magic to cli_session_creds_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: get the plaintext and NTLM authentication details out of cli_credentials
Stefan Metzmacher [Wed, 26 Oct 2016 10:01:45 +0000 (12:01 +0200)]
s3:libsmb: get the plaintext and NTLM authentication details out of cli_credentials

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: move cli_session_creds_init() to cli_session_setup_send()
Stefan Metzmacher [Sat, 22 Oct 2016 09:24:48 +0000 (11:24 +0200)]
s3:libsmb: move cli_session_creds_init() to cli_session_setup_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: move cli_session_setup_get_account into cli_session_creds_init()
Stefan Metzmacher [Sat, 22 Oct 2016 09:00:39 +0000 (11:00 +0200)]
s3:libsmb: move cli_session_setup_get_account into cli_session_creds_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: pass cli_credentials to cli_session_setup_gensec_send()
Stefan Metzmacher [Fri, 21 Oct 2016 18:35:01 +0000 (20:35 +0200)]
s3:libsmb: pass cli_credentials to cli_session_setup_gensec_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: split out a cli_session_creds_init() function
Andreas Schneider [Tue, 13 Sep 2016 12:40:36 +0000 (14:40 +0200)]
s3:libsmb: split out a cli_session_creds_init() function

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:libsmb: pass the optional dest_realm via the cli_credentials
Stefan Metzmacher [Fri, 28 Oct 2016 07:00:46 +0000 (09:00 +0200)]
s3:libsmb: pass the optional dest_realm via the cli_credentials

'dest_realm' is only valid in the winbindd use case, where we also have
the account in that realm.

We need to ask the DC to which KDC the principal belongs to, in order to
get the potential trust referrals right.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: let gensec handle the fallback from krb5 to ntlmssp
Stefan Metzmacher [Sat, 22 Oct 2016 07:52:48 +0000 (09:52 +0200)]
s3:libsmb: let gensec handle the fallback from krb5 to ntlmssp

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: remove target_principal argument from cli_session_setup_gensec_send()
Stefan Metzmacher [Thu, 27 Oct 2016 13:03:07 +0000 (15:03 +0200)]
s3:libsmb: remove target_principal argument from cli_session_setup_gensec_send()

It's enough to pass down target_service and target_hostname, that's all we
have at the smb layer. The kerberos layer should figure out what
the final target_principals is based on the users realm.

The gse_krb5 backend doesn't use it currently, so it's also unused.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: always pass the servers gss blob to gensec
Stefan Metzmacher [Thu, 27 Oct 2016 13:00:47 +0000 (15:00 +0200)]
s3:libsmb: always pass the servers gss blob to gensec

The spnego backend will take the "client use spnego principal" option.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: remove unused cli_session_setup_{lanman2,plain,nt1}*
Stefan Metzmacher [Wed, 26 Oct 2016 10:04:41 +0000 (12:04 +0200)]
s3:libsmb: remove unused cli_session_setup_{lanman2,plain,nt1}*

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: make use of smb1cli_session_setup_{nt1,lm21}_send/recv()
Stefan Metzmacher [Wed, 26 Oct 2016 10:01:45 +0000 (12:01 +0200)]
s3:libsmb: make use of smb1cli_session_setup_{nt1,lm21}_send/recv()

This separates the construction of the ASCII-Password (lm_response)
and UNICODE-Password (nt_response) values from the marshalling logic.

We don't need the NT1 marshalling logic 3 times (guest, plain, nt1),
we just need it once now in smb1cli_session_setup_nt1*.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: make use of smb1cli_session_setup_ext_send/recv()
Stefan Metzmacher [Tue, 25 Oct 2016 19:50:44 +0000 (21:50 +0200)]
s3:libsmb: make use of smb1cli_session_setup_ext_send/recv()

This separates the spnego authentication logic from the
marshalling logic.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: handle the spnego as a first action in cli_session_setup_send()
Andreas Schneider [Mon, 7 Nov 2016 14:06:09 +0000 (15:06 +0100)]
s3:libsmb: handle the spnego as a first action in cli_session_setup_send()

This will make further restructuring easier.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: add some comments to the noop case for < PROTOCOL_LANMAN1 in cli_session_s...
Stefan Metzmacher [Wed, 26 Oct 2016 00:03:17 +0000 (02:03 +0200)]
s3:libsmb: add some comments to the noop case for < PROTOCOL_LANMAN1 in cli_session_setup_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibcli/smb: add smb1cli_session_setup_ext_send/recv()
Stefan Metzmacher [Tue, 25 Oct 2016 19:01:37 +0000 (21:01 +0200)]
libcli/smb: add smb1cli_session_setup_ext_send/recv()

This does a session setup for the NT1 protocol with CAP_EXTENDED_SECURITY.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibcli/smb: add smb1cli_session_setup_nt1_send/recv()
Stefan Metzmacher [Tue, 25 Oct 2016 13:40:59 +0000 (15:40 +0200)]
libcli/smb: add smb1cli_session_setup_nt1_send/recv()

This does a session setup for the NT1 protocol (without CAP_EXTENDED_SECURITY).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibcli/smb: add smb1cli_session_setup_lm21_send/recv()
Andreas Schneider [Thu, 3 Nov 2016 15:28:12 +0000 (16:28 +0100)]
libcli/smb: add smb1cli_session_setup_lm21_send/recv()

This does a session setup for the LANMAN 2(.1) protocol.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibcli/smb: reformat wscript
Stefan Metzmacher [Tue, 25 Oct 2016 11:27:54 +0000 (13:27 +0200)]
libcli/smb: reformat wscript

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibcli/smb: Add smb_bytes_pull_str() helper function
Stefan Metzmacher [Tue, 25 Oct 2016 12:50:41 +0000 (14:50 +0200)]
libcli/smb: Add smb_bytes_pull_str() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibcli/smb: move {smb,trans2}_bytes_push_{str,bytes}() to common code
Stefan Metzmacher [Tue, 25 Oct 2016 11:31:08 +0000 (13:31 +0200)]
libcli/smb: move {smb,trans2}_bytes_push_{str,bytes}() to common code

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:libsmb: let the callers only pass the password string to cli_session_setup[_send]()
Stefan Metzmacher [Tue, 25 Oct 2016 09:31:07 +0000 (11:31 +0200)]
s3:libsmb: let the callers only pass the password string to cli_session_setup[_send]()

There're no callers which tried to pass raw {lm,nt}_response any more.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:popt_common: simplify popt_common_credentials handling
Stefan Metzmacher [Fri, 21 Oct 2016 15:22:03 +0000 (17:22 +0200)]
s3:popt_common: simplify popt_common_credentials handling

This offers a global 'struct user_auth_info *cmdline_auth_info',
similar to the 'cmdline_credentials' we have in
source4/lib/cmdline/popt_common.c.

And we create that in the POPT_CALLBACK_REASON_PRE stage
and finalize it in the POPT_CALLBACK_REASON_POST stage.

That means much less boring work for the callers
and more freedom to change the user_auth_info internals
in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:gse: We need to use the users realm in the target_principal
Stefan Metzmacher [Mon, 24 Oct 2016 09:26:12 +0000 (11:26 +0200)]
s3:gse: We need to use the users realm in the target_principal

This is important in order to let the kdc of the users realm start with
the trust referral routing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:gensec_gssapi: We need to use the users realm in the target_principal
Stefan Metzmacher [Mon, 24 Oct 2016 09:26:12 +0000 (11:26 +0200)]
s4:gensec_gssapi: We need to use the users realm in the target_principal

This is important in order to let the kdc of the users realm start with
the trust referral routing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoauth/credentials: make cli_credentials_get_ntlm_response() more robust
Stefan Metzmacher [Thu, 27 Oct 2016 11:32:31 +0000 (13:32 +0200)]
auth/credentials: make cli_credentials_get_ntlm_response() more robust

We always provide each output blob as it's own talloc memory
and also check for talloc failures.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoauth/credentials: anonymous should not have a user principal
Stefan Metzmacher [Sat, 22 Oct 2016 09:19:05 +0000 (11:19 +0200)]
auth/credentials: anonymous should not have a user principal

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4-torture: add test for winspool_AsyncGetPrinterDriverDirectory()
Günther Deschner [Tue, 8 Nov 2016 10:32:20 +0000 (11:32 +0100)]
s4-torture: add test for winspool_AsyncGetPrinterDriverDirectory()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 15 05:09:31 CET 2016 on sn-devel-144

7 years agos4-torture: add test for winspool_AsyncDeletePrintDriverPackage
Günther Deschner [Wed, 2 Nov 2016 11:30:58 +0000 (12:30 +0100)]
s4-torture: add test for winspool_AsyncDeletePrintDriverPackage

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for winspool_AsyncCorePrinterDriverInstalled
Günther Deschner [Fri, 28 Oct 2016 20:49:21 +0000 (22:49 +0200)]
s4-torture: add test for winspool_AsyncCorePrinterDriverInstalled

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for spoolss vs. iremotewinspool context handles
Günther Deschner [Mon, 5 Sep 2016 20:49:39 +0000 (22:49 +0200)]
s4-torture: add test for spoolss vs. iremotewinspool context handles

This test demonstrates that one cannot use a handle retrieved via
iremotewinspool in a spoolss context.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for winspool_AsyncGetPrinterData
Günther Deschner [Thu, 1 Sep 2016 11:57:50 +0000 (13:57 +0200)]
s4-torture: add test for winspool_AsyncGetPrinterData

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for winspool_AsyncEnumPrinters
Günther Deschner [Thu, 25 Aug 2016 15:31:47 +0000 (17:31 +0200)]
s4-torture: add test for winspool_AsyncEnumPrinters

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for winspool_AsyncUploadPrinterDriverPackage
Günther Deschner [Tue, 23 Aug 2016 20:58:26 +0000 (22:58 +0200)]
s4-torture: add test for winspool_AsyncUploadPrinterDriverPackage

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for winspool_SyncUnRegisterForRemoteNotifications.
Günther Deschner [Tue, 23 Aug 2016 16:39:48 +0000 (18:39 +0200)]
s4-torture: add test for winspool_SyncUnRegisterForRemoteNotifications.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for winspool_SyncRegisterForRemoteNotifications.
Günther Deschner [Thu, 16 May 2013 16:21:30 +0000 (18:21 +0200)]
s4-torture: add test for winspool_SyncRegisterForRemoteNotifications.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add IRemoteWinspool rpc testsuite.
Günther Deschner [Tue, 15 Jan 2013 14:23:58 +0000 (15:23 +0100)]
s4-torture: add IRemoteWinspool rpc testsuite.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add torture_rpc_connection_with_binding()
Günther Deschner [Thu, 27 Oct 2016 12:12:35 +0000 (14:12 +0200)]
s4-torture: add torture_rpc_connection_with_binding()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agowbinfo: Use ntlmv2 by default for wbinfo -a
Volker Lendecke [Mon, 14 Nov 2016 15:38:29 +0000 (16:38 +0100)]
wbinfo: Use ntlmv2 by default for wbinfo -a

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3/client: obey 'disable netbios' smb.conf param, don't connect via NBT port.
Noel Power [Thu, 10 Nov 2016 08:27:57 +0000 (08:27 +0000)]
s3/client: obey 'disable netbios' smb.conf param, don't connect via NBT port.

If 'disable netbios' is true 'smbclient -L //server' will try use the NBT
port to list the servers and 'smbclient -M //server' use the netbios
messaging WinPopup facility, we should honour the config and not do that.

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-epmapper: Ignore epm_Map object guid
Andreas Schneider [Wed, 26 Oct 2016 16:06:36 +0000 (18:06 +0200)]
s3-epmapper: Ignore epm_Map object guid

Tests revealed that you can pass random GUIDs to epm_Map and Windows will
happily answer the query.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 12 02:49:23 CET 2016 on sn-devel-144

7 years agos4-torture: Fix test_EnumPrinterDrivers for level 8 printer drivers.
Günther Deschner [Fri, 11 Nov 2016 15:32:20 +0000 (16:32 +0100)]
s4-torture: Fix test_EnumPrinterDrivers for level 8 printer drivers.

Guenther

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-rpcclient: add object_uuid argument to cmd_epmapper_map()
Günther Deschner [Fri, 11 Nov 2016 10:47:20 +0000 (11:47 +0100)]
s3-rpcclient: add object_uuid argument to cmd_epmapper_map()

This allows to test how an epmap-server deals with object_uuid during the
epm_Map call. On windows the object_uuid is always ignored expect for the case
when the first abstract_syntax in the tower is the mgmt service. Even in that
case, the role of the object_uuid is still unclear.

Guenther

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add spoolss_SetPrinter ndr test to validate secdesc_ptr
Günther Deschner [Fri, 11 Nov 2016 18:17:55 +0000 (19:17 +0100)]
s4-torture: add spoolss_SetPrinter ndr test to validate secdesc_ptr

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agospoolss: Use correct values for secdesc and devmode pointers
Günther Deschner [Fri, 11 Nov 2016 15:29:20 +0000 (16:29 +0100)]
spoolss: Use correct values for secdesc and devmode pointers

ULONG_PTR needs to be decoded as a uint3264 and not as a 'uint32 *'.

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

Guenther

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

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-printing: Allow printer names longer than 16 chars
Andreas Schneider [Thu, 10 Nov 2016 10:47:54 +0000 (11:47 +0100)]
s3-printing: Allow printer names longer than 16 chars

Printers with long names are supported in the meantime. However we issue
a warning that if one printer exceeeds 15 chars we warn about it.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov 11 00:02:10 CET 2016 on sn-devel-144

7 years agos3-printing: Correctly encode CUPS printer URIs
Andreas Schneider [Wed, 9 Nov 2016 18:05:49 +0000 (19:05 +0100)]
s3-printing: Correctly encode CUPS printer URIs

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3-client: Sync in tool cmdline help with smbclient manpage
Andreas Schneider [Fri, 4 Nov 2016 15:00:05 +0000 (16:00 +0100)]
s3-client: Sync in tool cmdline help with smbclient manpage

From smbclient manpage:
notify <dir name>
    Query a directory for change notifications. This command issues a
    recursive filechangenotify call for all possible changes.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  9 06:12:23 CET 2016 on sn-devel-144

7 years agos3-spoolss: Remove printer from registry if it is unpublished
Andreas Schneider [Tue, 8 Nov 2016 11:20:41 +0000 (12:20 +0100)]
s3-spoolss: Remove printer from registry if it is unpublished

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Nov  8 18:05:10 CET 2016 on sn-devel-144

7 years agos3-printing: Improve debug message
Andreas Schneider [Tue, 8 Nov 2016 11:20:25 +0000 (12:20 +0100)]
s3-printing: Improve debug message

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
7 years agoctdb-tests: Add tests for updated Debian style Samba start/stop
Martin Schwenke [Fri, 4 Nov 2016 00:47:18 +0000 (11:47 +1100)]
ctdb-tests: Add tests for updated Debian style Samba start/stop

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Nov  7 08:01:28 CET 2016 on sn-devel-144

7 years agoctdb-scripts: Fix Debian init in samba eventscript
Mathieu Parent [Mon, 31 Oct 2016 14:17:34 +0000 (15:17 +0100)]
ctdb-scripts: Fix Debian init in samba eventscript

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

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Signed-off-by: Stefan Kania <stefan@kania-online.de>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agocredentials: Add test for credentials behaviour
Andrew Bartlett [Tue, 11 Oct 2016 22:28:26 +0000 (11:28 +1300)]
credentials: Add test for credentials behaviour

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Nov  7 03:51:11 CET 2016 on sn-devel-144

7 years agopycredentials: Add bindings for {get,set}_principal, get_ntlm_username_domain
Andrew Bartlett [Tue, 11 Oct 2016 22:27:54 +0000 (11:27 +1300)]
pycredentials: Add bindings for {get,set}_principal, get_ntlm_username_domain

These will be used in testsuite for the credentials code

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopython: samba.tests.credentials: Add tests
Lumir Balhar [Wed, 19 Oct 2016 10:11:31 +0000 (12:11 +0200)]
python: samba.tests.credentials: Add tests

Newly tested functions:
- set_utf16_password
- set_old_password
- get_old_password
- set_old_utf16_password

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agopython: samba.tests.credentials: Fix DeprecationWarning
Lumir Balhar [Tue, 18 Oct 2016 12:30:28 +0000 (14:30 +0200)]
python: samba.tests.credentials: Fix DeprecationWarning

For historical reasons, TestCase methods have some aliases
which are deprecated since Python 2.7.
Change "assertEquals" to the preferred name, "assertEqual".

Deprecation notice: https://docs.python.org/2/library/unittest.html#deprecated-aliases

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agosamba_tool/fsmo: Allocate RID Set when seizing RID manager
Garming Sam [Tue, 1 Nov 2016 03:29:53 +0000 (16:29 +1300)]
samba_tool/fsmo: Allocate RID Set when seizing RID manager

Seizing the role without allocating a RID set for itself is likely prone
to cause issues.

Pair-programmed-with: Clive Ferreira <cliveferreira@catalyst.net.nz>

Signed-off-by: Clive Ferreira <cliveferreira@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9954

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Nov  4 08:37:05 CET 2016 on sn-devel-144

7 years agopython-libnet: Use new NTSTATUSError, WERRORError and DsExtendedError exceptions
Andrew Bartlett [Mon, 31 Oct 2016 23:38:48 +0000 (12:38 +1300)]
python-libnet: Use new NTSTATUSError, WERRORError and DsExtendedError exceptions

This will allow callers to catch specific errors rather than RuntimeException

As this slightly changes the exception, the timecmd test must be updated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398

7 years agopython: Add DsExtendedError Exception
Andrew Bartlett [Tue, 1 Nov 2016 03:09:20 +0000 (16:09 +1300)]
python: Add DsExtendedError Exception

This will be used for checking errors during a GetNCChanges EXOP like
RID Set allocation.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398

7 years agopyerrors: Add PyErr_Set{WERROR,HRESULT,NTSTATUS}_and_string()
Andrew Bartlett [Tue, 1 Nov 2016 03:03:09 +0000 (16:03 +1300)]
pyerrors: Add PyErr_Set{WERROR,HRESULT,NTSTATUS}_and_string()

This varient allows control of the text explaination string

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398

7 years agopython: create NTSTATUSError, HRESULTError and WERRORError
Andrew Bartlett [Tue, 1 Nov 2016 02:23:58 +0000 (15:23 +1300)]
python: create NTSTATUSError, HRESULTError and WERRORError

The advantage of these over the previous use of just RuntimeError is that we can
catch just the errors we want, without having to catch all possible RuntimeError
cases and assume they decode to a tuple

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398

7 years agodsdb: Catch errors in extended operations (like allocating a RID Set)
Andrew Bartlett [Mon, 31 Oct 2016 03:25:51 +0000 (16:25 +1300)]
dsdb: Catch errors in extended operations (like allocating a RID Set)

There are cases where allocating a RID Set can reasonably fail.  Catch those nicely.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398

7 years agodsdb: Rework DSDB code to use WERROR
Andrew Bartlett [Mon, 31 Oct 2016 03:19:37 +0000 (16:19 +1300)]
dsdb: Rework DSDB code to use WERROR

The WERROR codes are more descriptive for DSDB issues, and almost all the code was
converting from WERROR to NTSTATUS.  This will allow us to better catch specific
errors like WERR_DS_DRA_MISSING_PARENT

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398

7 years agodsdb: Create RID Set as SYSTEM
Andrew Bartlett [Sun, 30 Oct 2016 21:41:39 +0000 (10:41 +1300)]
dsdb: Create RID Set as SYSTEM

We do not want random users with add-user rights to own the new RID Set for this
server, and the ridSet class is thankfully system-only.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodbcheck: Correctly initialise keep_transaction in missing_parent test
Andrew Bartlett [Thu, 3 Nov 2016 00:30:56 +0000 (13:30 +1300)]
dbcheck: Correctly initialise keep_transaction in missing_parent test

Otherwise there is no point to this variable, we are trying to work out
if the subsequent modify succeded

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9954