mat/samba.git
10 years agolibcli/smb: calculate the credit charge on the input and output dyn_len
Stefan Metzmacher [Tue, 13 Aug 2013 07:50:29 +0000 (09:50 +0200)]
libcli/smb: calculate the credit charge on the input and output dyn_len

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolibcli/smb: Change smb2cli_create() and smb2cli_create_recv() to return a parameter...
Jeremy Allison [Wed, 7 Aug 2013 22:01:50 +0000 (15:01 -0700)]
libcli/smb: Change smb2cli_create() and smb2cli_create_recv() to return a parameter blob of the newly opened/created file.

Will use in the smb2 client code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agolibcli/smb: Fix smb2cli_write_recv() and smb2cli_write() to return the bytes written.
Jeremy Allison [Wed, 7 Aug 2013 21:41:24 +0000 (14:41 -0700)]
libcli/smb: Fix smb2cli_write_recv() and smb2cli_write() to return the bytes written.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agolibcli/smb: fix the credit handling on a SMB1 => SMB2 negotiate
Stefan Metzmacher [Wed, 14 Aug 2013 06:12:08 +0000 (08:12 +0200)]
libcli/smb: fix the credit handling on a SMB1 => SMB2 negotiate

Our cur_credit value had 1 credit too many in the case of
an SMB1 => SMB2 upgrade. When we max out the credits the server
disconnected the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smbcacls: Add -m<MAX PROTOCOL> option to smbcacls.
Jeremy Allison [Thu, 8 Aug 2013 18:43:16 +0000 (11:43 -0700)]
s3:smbcacls: Add -m<MAX PROTOCOL> option to smbcacls.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3:libsmb: make use of lp_cli_{min,max}protocol() in SMBC_server_internal()
Stefan Metzmacher [Sun, 11 Aug 2013 12:01:36 +0000 (14:01 +0200)]
s3:libsmb: make use of lp_cli_{min,max}protocol() in SMBC_server_internal()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: use lp_cli_minprotocol() in do_connect()
Stefan Metzmacher [Sun, 11 Aug 2013 12:00:45 +0000 (14:00 +0200)]
s3:libsmb: use lp_cli_minprotocol() in do_connect()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:winbindd: make use of lp_cli_{min,max}protocol()
Stefan Metzmacher [Sun, 11 Aug 2013 11:48:31 +0000 (13:48 +0200)]
s3:winbindd: make use of lp_cli_{min,max}protocol()

This changes winbindd back to use NT1 as defeault.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:lib/netapi: make use of lp_cli_maxprotocol()
Stefan Metzmacher [Sun, 11 Aug 2013 11:46:34 +0000 (13:46 +0200)]
s3:lib/netapi: make use of lp_cli_maxprotocol()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: Ensure we ask for DEFAULT_SMB2_MAX_CREDITS on successful negprot.
Jeremy Allison [Fri, 9 Aug 2013 18:15:48 +0000 (11:15 -0700)]
s3:libsmb: Ensure we ask for DEFAULT_SMB2_MAX_CREDITS on successful negprot.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:libsmb: Modify cli_start_connection_connected() to use lp_cli_minprotocol()/lp_cli...
Jeremy Allison [Thu, 8 Aug 2013 18:35:44 +0000 (11:35 -0700)]
s3:libsmb: Modify cli_start_connection_connected() to use lp_cli_minprotocol()/lp_cli_maxprotocol() instead of hard coding PROTOCOL_CORE, PROTOCOL_NT1.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3:lib: remove unused interpret_protocol()
Stefan Metzmacher [Sun, 11 Aug 2013 11:11:41 +0000 (13:11 +0200)]
s3:lib: remove unused interpret_protocol()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:torture: avoid interpret_protocol()
Stefan Metzmacher [Sun, 11 Aug 2013 11:10:13 +0000 (13:10 +0200)]
s3:torture: avoid interpret_protocol()

lp_set_cmdline("client max protocol",...) and
lp_cli_maxprotocol() are the more generic solution.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:client: avoid interpret_protocol()
Stefan Metzmacher [Sun, 11 Aug 2013 11:08:49 +0000 (13:08 +0200)]
s3:client: avoid interpret_protocol()

lp_set_cmdline("client max protocol",...) and
lp_cli_maxprotocol() are the more generic solution.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:param: Correctly set up cli_maxprotocol, cli_minprotocol in our parameter block.
Jeremy Allison [Wed, 7 Aug 2013 22:17:01 +0000 (15:17 -0700)]
s3:param: Correctly set up cli_maxprotocol, cli_minprotocol in our parameter block.

Set to PROTOCOL_NT1, PROTOCOL_CORE by default.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoFollowup patch for BUG: https://bugzilla.samba.org/show_bug.cgi?id=10082
Andreas Schneider [Wed, 14 Aug 2013 23:50:13 +0000 (16:50 -0700)]
Followup patch for BUG: https://bugzilla.samba.org/show_bug.cgi?id=10082

Thanks to Jim Brown <jim.brown@rsmas.miami.edu>

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 15 03:46:20 CEST 2013 on sn-devel-104

10 years agosmbd: Fix async echo handler forking (Bug 10086)
Volker Lendecke [Wed, 14 Aug 2013 10:46:46 +0000 (10:46 +0000)]
smbd: Fix async echo handler forking (Bug 10086)

If SMB3 is chosen via an SMB1 negprot, we forked the echo handler because
set_Protocol is called later, after the full protocol negotiation is done.

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 Aug 14 15:54:43 CEST 2013 on sn-devel-104

10 years agowinbind3: Fix an invalid free
Volker Lendecke [Wed, 14 Aug 2013 09:27:59 +0000 (09:27 +0000)]
winbind3: Fix an invalid free

This fixes a warning I've never seen before :-)

../source3/winbindd/winbindd_cm.c:781:59: warning: attempt to free a non-heap object ‘machine_krb5_principal’ [-Wfree-nonheap-object]

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): Wed Aug 14 14:04:16 CEST 2013 on sn-devel-104

10 years agos3-winbindd: fix fallback to ncacn_np in cm_connect_lsat().
Günther Deschner [Mon, 12 Aug 2013 15:23:12 +0000 (17:23 +0200)]
s3-winbindd: fix fallback to ncacn_np in cm_connect_lsat().

Fallback to lsa named-pipe connection when tcp connection has failed twice (it
could be a trusted domain connection where we cannot setup a secure channel).

Guenther

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

Signed-off-by: Günther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Tested-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 13 20:55:33 CEST 2013 on sn-devel-104

10 years agos3-winbind: Fix a segfault passing NULL to a fstring argument.
Andreas Schneider [Mon, 12 Aug 2013 18:22:04 +0000 (20:22 +0200)]
s3-winbind: Fix a segfault passing NULL to a fstring argument.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Aug 13 13:58:26 CEST 2013 on sn-devel-104

10 years agodocs: Add man vfs_syncops.8 to waf build.
Karolin Seeger [Mon, 12 Aug 2013 07:02:07 +0000 (09:02 +0200)]
docs: Add man vfs_syncops.8 to waf build.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Part of a fix for bug #7364 - man vfs_syncops missing.

Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Aug 13 12:09:45 CEST 2013 on sn-devel-104

10 years agos3: smbd/connection: added routines to compute share connections
Shekhar Amlekar [Sun, 23 Jun 2013 14:14:34 +0000 (19:44 +0530)]
s3: smbd/connection: added routines to compute share connections

Added routines to compute share connections and used it
in srvsvc NetShareEnum call.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 13 07:42:23 CEST 2013 on sn-devel-104

10 years agodocs: Add man page for vfs_linux_xfs_sgid.
Karolin Seeger [Mon, 12 Aug 2013 08:02:31 +0000 (10:02 +0200)]
docs: Add man page for vfs_linux_xfs_sgid.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 13 02:06:30 CEST 2013 on sn-devel-104

10 years agorpc_server3: Fix two const warnings
Volker Lendecke [Tue, 11 Jun 2013 17:37:47 +0000 (19:37 +0200)]
rpc_server3: Fix two const warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolibrpc: Use tevent_req_simple_recv_ntstatus
Volker Lendecke [Thu, 6 Jun 2013 09:42:55 +0000 (11:42 +0200)]
librpc: Use tevent_req_simple_recv_ntstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agotevent: Add tevent_received to tevent_req_simple_recv_ntstatus
Volker Lendecke [Thu, 6 Jun 2013 09:42:15 +0000 (11:42 +0200)]
tevent: Add tevent_received to tevent_req_simple_recv_ntstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agotevent: Fix tutorial reference
Volker Lendecke [Tue, 30 Jul 2013 12:37:16 +0000 (14:37 +0200)]
tevent: Fix tutorial reference

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Aug 12 09:17:10 CEST 2013 on sn-devel-104

10 years agolibcli: Fix improper use of tevent_req_simple_recv_ntstatus
Volker Lendecke [Sat, 15 Jun 2013 18:39:53 +0000 (20:39 +0200)]
libcli: Fix improper use of tevent_req_simple_recv_ntstatus

tevent_req_simple_recv_ntstatus is just for the simple return without
anything to do after it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibsmb: Remove an unnecessary variable assignment
Volker Lendecke [Sun, 9 Jun 2013 16:02:27 +0000 (18:02 +0200)]
libsmb: Remove an unnecessary variable assignment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibsmb: Avoid an unnecessary "else"
Volker Lendecke [Sun, 9 Jun 2013 09:41:32 +0000 (11:41 +0200)]
libsmb: Avoid an unnecessary "else"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agosmbd: Fix CID 1035550 Structurally dead code
Volker Lendecke [Sat, 22 Jun 2013 16:43:00 +0000 (18:43 +0200)]
smbd: Fix CID 1035550 Structurally dead code

Just a single ctl_code from my point of view is okay with an if(). All
other cases are handled behind the VFS these days.

The dead code was the last tevent_req_nterror and post routines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agosmbd: Fix nonblank line endings
Volker Lendecke [Sat, 22 Jun 2013 16:40:31 +0000 (18:40 +0200)]
smbd: Fix nonblank line endings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolib: Remove unused "get_peer_name"
Volker Lendecke [Fri, 21 Jun 2013 16:33:56 +0000 (18:33 +0200)]
lib: Remove unused "get_peer_name"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolib: Remove unused "client_name"
Volker Lendecke [Thu, 20 Jun 2013 11:49:45 +0000 (13:49 +0200)]
lib: Remove unused "client_name"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolsa4: Fix an set but unused variable warning
Volker Lendecke [Fri, 21 Jun 2013 16:11:30 +0000 (18:11 +0200)]
lsa4: Fix an set but unused variable warning

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolsa4: Remove an unused variable
Volker Lendecke [Fri, 21 Jun 2013 16:11:07 +0000 (18:11 +0200)]
lsa4: Remove an unused variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpcclient: fix compiler warnings
Stefan Metzmacher [Fri, 9 Aug 2013 08:23:12 +0000 (10:23 +0200)]
s3:rpcclient: fix compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:pylibsmb: remove compiler warnings
Stefan Metzmacher [Fri, 9 Aug 2013 08:15:48 +0000 (10:15 +0200)]
s3:pylibsmb: remove compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:wrepl_out_helpers.c: avoid talloc_reference() in most cases
Stefan Metzmacher [Thu, 8 Aug 2013 17:16:26 +0000 (19:16 +0200)]
s4:wrepl_out_helpers.c: avoid talloc_reference() in most cases

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: s/getgroups/getgr to avoid compiler warnings
Stefan Metzmacher [Thu, 8 Aug 2013 17:10:29 +0000 (19:10 +0200)]
s4:torture/rpc: s/getgroups/getgr to avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:nbt_server: avoid talloc_reference()
Stefan Metzmacher [Thu, 8 Aug 2013 16:38:12 +0000 (18:38 +0200)]
s4:nbt_server: avoid talloc_reference()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc/samsync: avoid talloc_reference()
Stefan Metzmacher [Thu, 8 Aug 2013 16:33:54 +0000 (18:33 +0200)]
s4:torture/rpc/samsync: avoid talloc_reference()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:libcli: avoid talloc_reference() in finddcs_nbt_send()
Stefan Metzmacher [Thu, 8 Aug 2013 16:21:13 +0000 (18:21 +0200)]
s4:libcli: avoid talloc_reference() in finddcs_nbt_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:librpc: avoid talloc_reference() in dcerpc_epm_map_binding_send()
Stefan Metzmacher [Thu, 8 Aug 2013 11:56:51 +0000 (13:56 +0200)]
s4:librpc: avoid talloc_reference() in dcerpc_epm_map_binding_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/credentials: make sure cli_credentials_get_nt_hash() always returns a talloc...
Stefan Metzmacher [Fri, 9 Aug 2013 08:15:05 +0000 (10:15 +0200)]
auth/credentials: make sure cli_credentials_get_nt_hash() always returns a talloc object

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agowaf: replace dependency to libintl with samba_intl
Christian Ambach [Thu, 1 Aug 2013 21:00:21 +0000 (23:00 +0200)]
waf: replace dependency to libintl with samba_intl

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Aug 12 00:46:34 CEST 2013 on sn-devel-104

10 years agowaf: consolidate libintl related checks
Christian Ambach [Thu, 1 Aug 2013 20:28:05 +0000 (22:28 +0200)]
waf: consolidate libintl related checks

consolidate the dealing with functions from libintl and the
handling of checking if libiconv is required or not
to a common place in lib/replace

also add a new samba_intl subsystem that has dependencies
on the appropriate set of libraries (libintl, libintl+libiconv or none)
that can be used as a general dependency by code that depends
on the internationalization libraries

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agowaf: add --without-gettext option
Christian Ambach [Tue, 25 Jun 2013 16:37:35 +0000 (18:37 +0200)]
waf: add --without-gettext option

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agowaf: fix build on AIX7
Christian Ambach [Thu, 20 Jun 2013 16:26:04 +0000 (18:26 +0200)]
waf: fix build on AIX7

the same works for AIX 5,6,7 so leave away the version specifics (as autoconf build did)

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/auth: add more const to spnego_negTokenInit->mechTypes
Stefan Metzmacher [Mon, 5 Aug 2013 08:46:47 +0000 (10:46 +0200)]
libcli/auth: add more const to spnego_negTokenInit->mechTypes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Aug 10 11:11:54 CEST 2013 on sn-devel-104

10 years agolibcli/auth: avoid possible mem leak in read_negTokenInit()
Stefan Metzmacher [Mon, 5 Aug 2013 08:43:38 +0000 (10:43 +0200)]
libcli/auth: avoid possible mem leak in read_negTokenInit()

Also add error checks.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: treat struct gensec_security_ops as const if possible.
Stefan Metzmacher [Mon, 5 Aug 2013 09:20:21 +0000 (11:20 +0200)]
auth/gensec: treat struct gensec_security_ops as const if possible.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: use 'const char * const *' for function parameters
Stefan Metzmacher [Mon, 5 Aug 2013 09:10:55 +0000 (11:10 +0200)]
auth/gensec: use 'const char * const *' for function parameters

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: make it possible to implement async backends
Stefan Metzmacher [Mon, 5 Aug 2013 14:12:13 +0000 (16:12 +0200)]
auth/gensec: make it possible to implement async backends

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: avoid talloc_reference in gensec_security_mechs()
Stefan Metzmacher [Mon, 5 Aug 2013 08:39:16 +0000 (10:39 +0200)]
auth/gensec: avoid talloc_reference in gensec_security_mechs()

We now always copy.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: avoid talloc_reference in gensec_use_kerberos_mechs()
Stefan Metzmacher [Mon, 5 Aug 2013 08:37:26 +0000 (10:37 +0200)]
auth/gensec: avoid talloc_reference in gensec_use_kerberos_mechs()

We now always copy.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: introduce gensec_internal.h
Stefan Metzmacher [Mon, 5 Aug 2013 05:12:01 +0000 (07:12 +0200)]
auth/gensec: introduce gensec_internal.h

We should treat most gensec related structures private.

It's a long way, but this is a start.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/auth/schannel: remove unused schannel_position
Stefan Metzmacher [Fri, 2 Aug 2013 13:42:21 +0000 (15:42 +0200)]
libcli/auth/schannel: remove unused schannel_position

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/auth/schannel: make struct schannel_state private
Stefan Metzmacher [Fri, 2 Aug 2013 11:37:54 +0000 (13:37 +0200)]
libcli/auth/schannel: make struct schannel_state private

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:gensec/schannel: only require librpc/gen_ndr/dcerpc.h
Stefan Metzmacher [Sat, 3 Aug 2013 09:32:31 +0000 (11:32 +0200)]
s4:gensec/schannel: only require librpc/gen_ndr/dcerpc.h

We just need DCERPC_AUTH_TYPE_SCHANNEL

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:gensec/schannel: there's no point in having schannel_session_key()
Stefan Metzmacher [Sat, 3 Aug 2013 09:27:55 +0000 (11:27 +0200)]
s4:gensec/schannel: there's no point in having schannel_session_key()

gensec_session_key() will return NT_STATUS_NO_USER_SESSION_KEY
before calling schannel_session_key(), as we don't provide
GENSEC_FEATURE_SESSION_KEY.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:gensec/schannel: GENSEC_FEATURE_ASYNC_REPLIES is not supported
Stefan Metzmacher [Sat, 3 Aug 2013 09:21:32 +0000 (11:21 +0200)]
s4:gensec/schannel: GENSEC_FEATURE_ASYNC_REPLIES is not supported

There's a sequence number attached to the connection,
which needs to be incremented with each message...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:gensec/schannel: use the correct computer_name from netlogon_creds_CredentialState
Stefan Metzmacher [Fri, 2 Aug 2013 11:25:20 +0000 (13:25 +0200)]
s4:gensec/schannel: use the correct computer_name from netlogon_creds_CredentialState

We need to use the same computer_name we used in the netr_Authenticate3
request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:gensec/schannel: simplify the code by using netsec_create_state()
Stefan Metzmacher [Fri, 2 Aug 2013 11:04:07 +0000 (13:04 +0200)]
s4:gensec/schannel: simplify the code by using netsec_create_state()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:gensec/schannel: remove unused dcerpc_schannel_creds()
Stefan Metzmacher [Fri, 2 Aug 2013 10:31:41 +0000 (12:31 +0200)]
s4:gensec/schannel: remove unused dcerpc_schannel_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture: avoid usage of dcerpc_schannel_creds()
Stefan Metzmacher [Fri, 2 Aug 2013 08:08:54 +0000 (10:08 +0200)]
s4:torture: avoid usage of dcerpc_schannel_creds()

We use cli_credentials_get_netlogon_creds() which returns the same value.

dcerpc_schannel_creds() is a layer violation.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:libnet: avoid usage of dcerpc_schannel_creds()
Stefan Metzmacher [Fri, 2 Aug 2013 08:08:54 +0000 (10:08 +0200)]
s4:libnet: avoid usage of dcerpc_schannel_creds()

We use cli_credentials_get_netlogon_creds() which returns the same value.

dcerpc_schannel_creds() is a layer violation.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:dcerpc_helpers: remove unused DEBUG message of schannel_state->seq_num.
Stefan Metzmacher [Fri, 2 Aug 2013 11:36:30 +0000 (13:36 +0200)]
s3:dcerpc_helpers: remove unused DEBUG message of schannel_state->seq_num.

This is a layer violation and not needed anymore as we know
how the seqnum handling works now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_server: make use of netsec_create_state()
Stefan Metzmacher [Fri, 2 Aug 2013 11:33:37 +0000 (13:33 +0200)]
s3:rpc_server: make use of netsec_create_state()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:cli_pipe.c: return NO_USER_SESSION_KEY in cli_get_session_key() for schannel
Stefan Metzmacher [Sat, 3 Aug 2013 06:50:54 +0000 (08:50 +0200)]
s3:cli_pipe.c: return NO_USER_SESSION_KEY in cli_get_session_key() for schannel

SCHANNEL connections don't have a user session key,
they're like anonymous connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:cli_pipe: pass down creds->computer_name to NL_AUTH_MESSAGE
Stefan Metzmacher [Fri, 2 Aug 2013 11:28:59 +0000 (13:28 +0200)]
s3:cli_pipe: pass down creds->computer_name to NL_AUTH_MESSAGE

We need to use the same computer_name value as in the netr_Authenticate3()
request.

We abuse cli->auth->user_name to pass the value down.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:cli_pipe: make use of netsec_create_state()
Stefan Metzmacher [Fri, 2 Aug 2013 11:28:11 +0000 (13:28 +0200)]
s3:cli_pipe: make use of netsec_create_state()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/auth: add netsec_create_state()
Stefan Metzmacher [Fri, 2 Aug 2013 10:53:42 +0000 (12:53 +0200)]
libcli/auth: add netsec_create_state()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/auth: maintain the sequence number for the NETLOGON SSP as 64bit
Stefan Metzmacher [Wed, 24 Apr 2013 10:33:28 +0000 (12:33 +0200)]
libcli/auth: maintain the sequence number for the NETLOGON SSP as 64bit

See [MS-NPRC] 3.3.4.2 The Netlogon Signature Token.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: add gensec_security_by_auth_type()
Stefan Metzmacher [Sat, 3 Aug 2013 09:43:58 +0000 (11:43 +0200)]
auth/gensec: add gensec_security_by_auth_type()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoauth/gensec: first check GENSEC_FEATURE_SESSION_KEY before returning NOT_IMPLEMENTED
Stefan Metzmacher [Sat, 3 Aug 2013 09:26:13 +0000 (11:26 +0200)]
auth/gensec: first check GENSEC_FEATURE_SESSION_KEY before returning NOT_IMPLEMENTED

Preferr NT_STATUS_NO_USER_SESSION_KEY as return value of gensec_session_key().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_client: remove unused cli_rpc_pipe_open_ntlmssp_auth_schannel()
Stefan Metzmacher [Thu, 25 Apr 2013 17:33:28 +0000 (19:33 +0200)]
s3:rpc_client: remove unused cli_rpc_pipe_open_ntlmssp_auth_schannel()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_client: remove netr_LogonGetCapabilities check from rpc_pipe_bind*
Stefan Metzmacher [Thu, 25 Apr 2013 16:30:36 +0000 (18:30 +0200)]
s3:rpc_client: remove netr_LogonGetCapabilities check from rpc_pipe_bind*

It's done in the caller now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_client: add netr_LogonGetCapabilities to cli_rpc_pipe_open_schannel_with_key()
Stefan Metzmacher [Thu, 25 Apr 2013 17:34:13 +0000 (19:34 +0200)]
s3:rpc_client: add netr_LogonGetCapabilities to cli_rpc_pipe_open_schannel_with_key()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_client: use netlogon_creds_copy before rpc_pipe_bind
Stefan Metzmacher [Thu, 25 Apr 2013 17:45:52 +0000 (19:45 +0200)]
s3:rpc_client: use netlogon_creds_copy before rpc_pipe_bind

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_client: fix/add AES downgrade detection to rpc_pipe_bind_step_two_done()
Stefan Metzmacher [Thu, 25 Apr 2013 17:57:09 +0000 (19:57 +0200)]
s3:rpc_client: fix/add AES downgrade detection to rpc_pipe_bind_step_two_done()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpcclient: try to use NETLOGON_NEG_SUPPORTS_AES
Stefan Metzmacher [Sat, 15 Jun 2013 07:41:52 +0000 (09:41 +0200)]
s3:rpcclient: try to use NETLOGON_NEG_SUPPORTS_AES

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:rpc_client: try to use NETLOGON_NEG_SUPPORTS_AES
Stefan Metzmacher [Sat, 15 Jun 2013 07:41:52 +0000 (09:41 +0200)]
s3:rpc_client: try to use NETLOGON_NEG_SUPPORTS_AES

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:libnet_join: try to use NETLOGON_NEG_SUPPORTS_AES
Stefan Metzmacher [Sat, 15 Jun 2013 07:41:52 +0000 (09:41 +0200)]
s3:libnet_join: try to use NETLOGON_NEG_SUPPORTS_AES

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:auth_domain: try to use NETLOGON_NEG_SUPPORTS_AES
Stefan Metzmacher [Sat, 15 Jun 2013 07:41:52 +0000 (09:41 +0200)]
s3:auth_domain: try to use NETLOGON_NEG_SUPPORTS_AES

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:libsmb: remove unused cli_state->is_guestlogin
Stefan Metzmacher [Mon, 5 Aug 2013 18:26:54 +0000 (20:26 +0200)]
s3:libsmb: remove unused cli_state->is_guestlogin

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agotorture: add smb2 FSCTL_[GET/SET]_COMPRESSION test
David Disseldorp [Wed, 7 Aug 2013 15:16:12 +0000 (17:16 +0200)]
torture: add smb2 FSCTL_[GET/SET]_COMPRESSION test

This test simply creates a file and checks the compression state before
and after FSCTL_SET_COMPRESSION(COMPRESSION_FORMAT_DEFAULT).

The test expects the compression state to be COMPRESSION_FORMAT_LZNT1
after set, conforming to Windows Server behaviour.

If the server responds to the first FSCTL_GET_COMPRESSION request with
NT_STATUS_NOT_SUPPORTED or NT_STATUS_INVALID_DEVICE_REQUEST, then the
test is skipped. This allows it to run during selftest.

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): Fri Aug  9 22:03:39 CEST 2013 on sn-devel-104

10 years agolib: add FSCTL_[GET/SET]_COMPRESSION constants
David Disseldorp [Wed, 7 Aug 2013 15:16:11 +0000 (17:16 +0200)]
lib: add FSCTL_[GET/SET]_COMPRESSION constants

Values taken from MS-FSCC.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agotorture: split out ioctl test file creation helper
David Disseldorp [Wed, 7 Aug 2013 15:16:10 +0000 (17:16 +0200)]
torture: split out ioctl test file creation helper

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoVFS plugin was sending the actual size of the volume instead of the total number...
Susant Kumar Palai [Tue, 6 Aug 2013 21:45:06 +0000 (14:45 -0700)]
VFS plugin was sending the actual size of the volume instead of the total number of block units because of which windows was getting the wrong volume capacity.

Signed-off-by: Susant Kumar Palai <spalai@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christopher R. Hertel <crh@samba.org>
10 years agodoc: Fix prefix parameter name in vfs_full_audit man page
Christof Schmitt [Wed, 7 Aug 2013 17:59:08 +0000 (10:59 -0700)]
doc: Fix prefix parameter name in vfs_full_audit man page

Commit 2314f47 fixed two other instances, but forgot to change the last
one.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Aug  9 16:53:28 CEST 2013 on sn-devel-104

10 years agodocs: Add basic man page for vfs_syncops.
Karolin Seeger [Fri, 9 Aug 2013 08:57:51 +0000 (10:57 +0200)]
docs: Add basic man page for vfs_syncops.

Fix bug #7364 - man vfs_syncops missing.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Aug  9 13:19:12 CEST 2013 on sn-devel-104

10 years agodrs-cracknames: Add some debugs in the torture to know better which test has failed
Matthieu Patou [Tue, 30 Jul 2013 23:09:00 +0000 (16:09 -0700)]
drs-cracknames: Add some debugs in the torture to know better which test has failed

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-By: Andrew Bartlett <abarlett@samba.org>
Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Wed Aug  7 08:10:58 CEST 2013 on sn-devel-104

10 years agoRemove the knownfail flag on cracknames as it didn't fail anymore
Matthieu Patou [Mon, 1 Jul 2013 03:45:28 +0000 (20:45 -0700)]
Remove the knownfail flag on cracknames as it didn't fail anymore

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
10 years agodrs-cracksname: fix problems that prevented to pass our torture tests
Matthieu Patou [Mon, 1 Jul 2013 03:44:22 +0000 (20:44 -0700)]
drs-cracksname: fix problems that prevented to pass our torture tests

Some of the problems where also reported by Microsoft testing tools

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
10 years agodrs-crackname: Fix error code so that we have the same as windows
Matthieu Patou [Sun, 30 Jun 2013 09:04:20 +0000 (02:04 -0700)]
drs-crackname: Fix error code so that we have the same as windows

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
10 years agodrs-cracknames: When cracking NT4 names we should just look at netbios for the match
Matthieu Patou [Sun, 30 Jun 2013 09:03:02 +0000 (02:03 -0700)]
drs-cracknames: When cracking NT4 names we should just look at netbios for the match

Looking at dnsRoot will yield a result for domain.tld\username when it
shouldn't work.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
10 years agodrs-crackname: Fix cracknames for the format UNKNOWN when the data is actually a...
Matthieu Patou [Sat, 29 Jun 2013 23:02:32 +0000 (16:02 -0700)]
drs-crackname: Fix cracknames for the format UNKNOWN when the data is actually a GUID

The cannonical crackname expect a "/" or it returns
DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR, when doing UNKNOWN format it's not
an error to not have a "/" in the name to crack it's just a sign the
name is not a cannonical one.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
10 years agodrs-cracknames: Reorganise the cracknames list so that similar format names are group...
Matthieu Patou [Fri, 28 Jun 2013 08:11:46 +0000 (01:11 -0700)]
drs-cracknames: Reorganise the cracknames list so that similar format names are group together

It makes easier when reviewing failed test case in DRSR testsuite

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
10 years agoAdd Notes related to DRSUAPI
Matthieu Patou [Fri, 28 Jun 2013 06:58:41 +0000 (23:58 -0700)]
Add Notes related to DRSUAPI

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>