samba.git
5 years agoncacn_http: Add http library
Samuel Cabrero [Tue, 16 Sep 2014 14:12:26 +0000 (16:12 +0200)]
ncacn_http: Add http library

Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:smbtorture: align explanations for parameters
Michael Adam [Sun, 21 Sep 2014 23:28:19 +0000 (01:28 +0200)]
s3:smbtorture: align explanations for parameters

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Sep 22 10:31:55 CEST 2014 on sn-devel-104

5 years agos3:smbtorture: mention "-e" in the help text
Michael Adam [Sun, 21 Sep 2014 23:27:33 +0000 (01:27 +0200)]
s3:smbtorture: mention "-e" in the help text

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoselftst: run the smbtorture3 local tests in the "none" environment
Michael Adam [Sun, 21 Sep 2014 23:24:49 +0000 (01:24 +0200)]
selftst: run the smbtorture3 local tests in the "none" environment

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoWHATSNEW: Mention combined CTDB
Amitay Isaacs [Mon, 22 Sep 2014 00:44:47 +0000 (10:44 +1000)]
WHATSNEW: Mention combined CTDB

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Sep 22 07:05:26 CEST 2014 on sn-devel-104

5 years agosmbd: fix a comment typo.
Michael Adam [Sun, 21 Sep 2014 07:32:53 +0000 (09:32 +0200)]
smbd: fix a comment typo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sun Sep 21 22:43:55 CEST 2014 on sn-devel-104

5 years agos3: reset tracepoint handler in reinit_after fork.
Michael Adam [Sun, 21 Sep 2014 08:29:49 +0000 (10:29 +0200)]
s3: reset tracepoint handler in reinit_after fork.

This for instance fixes panics in the scavenger process
due to talloc stackframes not freed in order.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoWHATSNEW: Fix typos.
Karolin Seeger [Sun, 21 Sep 2014 18:07:41 +0000 (20:07 +0200)]
WHATSNEW: Fix typos.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoWHATSNEW: Mention unix domain datagram messaging
Volker Lendecke [Sat, 20 Sep 2014 15:20:11 +0000 (17:20 +0200)]
WHATSNEW: Mention unix domain datagram messaging

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Sep 20 21:13:50 CEST 2014 on sn-devel-104

5 years agoWHATSNEW: Mention tdb mutexes
Volker Lendecke [Sat, 20 Sep 2014 15:16:49 +0000 (17:16 +0200)]
WHATSNEW: Mention tdb mutexes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoWHATSNEW: mention overhauled "net idmap" command
Michael Adam [Fri, 19 Sep 2014 23:53:28 +0000 (01:53 +0200)]
WHATSNEW: mention overhauled "net idmap" command

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Sep 20 11:37:51 CEST 2014 on sn-devel-104

5 years agoWHATSNEW: Improved DCERPC man in the middle detection
Stefan Metzmacher [Fri, 19 Sep 2014 23:29:19 +0000 (01:29 +0200)]
WHATSNEW: Improved DCERPC man in the middle detection

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoWHATSNEW: Larger IO sizes for SMB2/3 per default
Stefan Metzmacher [Fri, 19 Sep 2014 23:18:53 +0000 (01:18 +0200)]
WHATSNEW: Larger IO sizes for SMB2/3 per default

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoWHATSNEW: Winbindd/Netlogon improvements
Stefan Metzmacher [Fri, 19 Sep 2014 23:14:11 +0000 (01:14 +0200)]
WHATSNEW: Winbindd/Netlogon improvements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agopassdb: Use talloc_zero_array
Volker Lendecke [Sat, 20 Sep 2014 00:08:44 +0000 (02:08 +0200)]
passdb: Use talloc_zero_array

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Sep 20 08:29:31 CEST 2014 on sn-devel-104

5 years agolib/util: Drop unnecessary use of talloc_tos()
Volker Lendecke [Fri, 19 Sep 2014 14:58:52 +0000 (16:58 +0200)]
lib/util: Drop unnecessary use of talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agolib/util: Return some functions to util_str.c
Martin Schwenke [Fri, 19 Sep 2014 03:42:32 +0000 (13:42 +1000)]
lib/util: Return some functions to util_str.c

These were moved in commit 8e704e4107b284bfc1e43f4c698ac0e6c5ae1800
when util_str.c was not shared.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 19 20:34:05 CEST 2014 on sn-devel-104

5 years agolib/util: Move next_token* functions to util_str.c
Martin Schwenke [Fri, 19 Sep 2014 03:30:26 +0000 (13:30 +1000)]
lib/util: Move next_token* functions to util_str.c

This is part of an attempt to untangle charset from util.c.

Most of this was moved from util_str.c in commit
55903e6f9120f1ec58a8554813229975c3028a09.  next_token() was moved from
charset to util.c in commit 4be643d4ce33d5ce2bf9deacc3f6d0fde90cf626
so that it would be alongside next_token_talloc().

Now that util_str.c is in shared lib/util it is no longer necessary to
have these in util.c.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolib/util: Move idr_get_new_random() to new source file idtree_random.c
Martin Schwenke [Fri, 19 Sep 2014 05:01:51 +0000 (15:01 +1000)]
lib/util: Move idr_get_new_random() to new source file idtree_random.c

This function depends on genrand.c, which depends on lib/crypto.  This
way the other IDR tree code can be used without lib/crypto.

While doing this, create idtree.h and idtree_random.h and clean up the
includes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agodebug: Standalone compile without includes.h
Martin Schwenke [Mon, 8 Sep 2014 06:32:46 +0000 (16:32 +1000)]
debug: Standalone compile without includes.h

Compiling utilities with includes.h is confusing because includes.h
could come from source3, source4 or ctdb.  Utilities should be
independent of such things.

Add a minimal set of fined-grained includes that attempts to avoid the
catch-all samba_util.h.  A comment indicates what is used from
samba_util.h so that future clean-ups are easier.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb_wrap: Standalone compile without includes.h
Martin Schwenke [Tue, 19 Aug 2014 02:22:00 +0000 (12:22 +1000)]
tdb_wrap: Standalone compile without includes.h

Compiling this generic code is confusing because it uses includes.h,
which could come from source3, source4 or ctdb.  Generic code should
be independent of such things.

Drop include of param.h since nothing from that file is used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb_wrap: tdb_wrap.h doesn't need struct loadparm_context
Martin Schwenke [Tue, 16 Sep 2014 04:01:19 +0000 (14:01 +1000)]
tdb_wrap: tdb_wrap.h doesn't need struct loadparm_context

Not since commit d6db35d7a564ee556b74131ef4c3a3cdb8097e14.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agotdb: tdb.h needs bool type
Martin Schwenke [Tue, 16 Sep 2014 03:42:33 +0000 (13:42 +1000)]
tdb: tdb.h needs bool type

Due to introduction of tdb_runtime_check_for_robust_mutexes().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolib/crypto: Protect crypto.h against multiple inclusion
Martin Schwenke [Wed, 10 Sep 2014 03:42:00 +0000 (13:42 +1000)]
lib/crypto: Protect crypto.h against multiple inclusion

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agocharset: Avoid compiler warnings with --enable-developer
Martin Schwenke [Wed, 10 Sep 2014 01:10:09 +0000 (11:10 +1000)]
charset: Avoid compiler warnings with --enable-developer

These:

  [ 44/309] Compiling ../lib/util/charset/util_unistr_w.c
  ../../lib/util/charset/util_unistr_w.c: In function ‘strlower_w’:
  ../../lib/util/charset/util_unistr_w.c:182:127: warning: right-hand operand of comma expression has no effect [-Wunused-value]
      COPY_UCS2_CHAR(s,&v);

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoreplace: Fix includes of unistd.h
Martin Schwenke [Fri, 29 Aug 2014 11:13:47 +0000 (21:13 +1000)]
replace: Fix includes of unistd.h

This should always be conditional.  system/passwd.h wants it too so
that uid_t is defined.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agodynconfig: Remove include of nsswitch/winbind_struct_protocol.h
Martin Schwenke [Tue, 19 Aug 2014 02:07:12 +0000 (12:07 +1000)]
dynconfig: Remove include of nsswitch/winbind_struct_protocol.h

Nothing declared in this file is used in dynconfig.c.  It appears that
WINBINDD_SOCKET_DIR used to come from there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agoutil: Fix indentation
Martin Schwenke [Wed, 6 Aug 2014 01:57:06 +0000 (11:57 +1000)]
util: Fix indentation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agonsswitch: Skip groups we were not able to map.
Andreas Schneider [Fri, 19 Sep 2014 11:33:10 +0000 (13:33 +0200)]
nsswitch: Skip groups we were not able to map.

If we have configured the idmap_ad backend it is possible that the user
is in a group without a gid set. This will result in (uid_t)-1 as the
gid. We return this invalid gid to NSS which is wrong.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Sep 19 17:57:14 CEST 2014 on sn-devel-104

5 years agos3:torture: use cli_state_client_guid in run_smb2_multi_channel()
Stefan Metzmacher [Thu, 19 Jun 2014 23:03:38 +0000 (01:03 +0200)]
s3:torture: use cli_state_client_guid in run_smb2_multi_channel()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep 19 11:40:15 CEST 2014 on sn-devel-104

5 years agos3:libsmb: add 'cli_state_client_guid'
Stefan Metzmacher [Thu, 19 Jun 2014 23:03:08 +0000 (01:03 +0200)]
s3:libsmb: add 'cli_state_client_guid'

This can be used by tests to use the same client guid for multiple connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()
Stefan Metzmacher [Sun, 14 Sep 2014 22:10:11 +0000 (00:10 +0200)]
s3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()

For the continuation of a SMB2 SessionSetup we already have the
smb2req->session (with NT_STATUS_MORE_PROCESSING_REQUIRED).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: add smbd_smb2_signing_key() helper function
Stefan Metzmacher [Thu, 12 Jun 2014 13:31:25 +0000 (15:31 +0200)]
s3:smb2_server: add smbd_smb2_signing_key() helper function

This will find the correct signing key for the connection.

If there's already a channel session key, we need to use that
otherwise we need to use the global session key.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbXsrv_session: add smbXsrv_session_find_channel()
Stefan Metzmacher [Thu, 12 Jun 2014 11:04:40 +0000 (13:04 +0200)]
s3:smbXsrv_session: add smbXsrv_session_find_channel()

This function can check if a smbXsrv_connection is already bound to
a smbXsrv_session.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a session
Stefan Metzmacher [Thu, 12 Jun 2014 07:51:18 +0000 (09:51 +0200)]
s3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a session

A session will be usable from multiple connections in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: split out a smbd_add_connection() helper function.
Stefan Metzmacher [Thu, 19 Jun 2014 22:31:31 +0000 (00:31 +0200)]
s3:smbd: split out a smbd_add_connection() helper function.

This attaches a smbXsrv_connection to a smbXsrv_client structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: remove now unused smbd_server_connection->conn
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: remove now unused smbd_server_connection->conn

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_lock: iterate over all sconn->client->connections
Stefan Metzmacher [Tue, 16 Sep 2014 07:03:39 +0000 (09:03 +0200)]
s3:smb2_lock: iterate over all sconn->client->connections

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_lock: always use tevent_req_defer_callback() if we go async
Stefan Metzmacher [Tue, 16 Sep 2014 06:05:31 +0000 (08:05 +0200)]
s3:smb2_lock: always use tevent_req_defer_callback() if we go async

process_blocking_lock_queue_smb2() can call reprocess_blocked_smb2_lock()
multiple times, which results in multiple tevent_req_done() calls.

As we could disconnect the connection from there,
process_blocking_lock_queue_smb2() could crash as the local state might be
destroyed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()
Stefan Metzmacher [Tue, 16 Sep 2014 05:50:41 +0000 (07:50 +0200)]
s3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock breaks
Stefan Metzmacher [Tue, 16 Sep 2014 07:23:54 +0000 (09:23 +0200)]
s3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock breaks

This means we use the first connection for now.

TODO: we may need to use the connection on which the SMB2 create was done
and fallback to other connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()
Stefan Metzmacher [Tue, 16 Sep 2014 04:52:26 +0000 (06:52 +0200)]
s3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_create: pass smbXsrv_connection to *deferred*_smb2
Stefan Metzmacher [Tue, 16 Sep 2014 05:49:44 +0000 (07:49 +0200)]
s3:smb2_create: pass smbXsrv_connection to *deferred*_smb2

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()
Stefan Metzmacher [Tue, 16 Sep 2014 05:38:44 +0000 (07:38 +0200)]
s3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()
Stefan Metzmacher [Tue, 16 Sep 2014 05:32:14 +0000 (07:32 +0200)]
s3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to open_was_deferred()
Stefan Metzmacher [Tue, 16 Sep 2014 04:55:39 +0000 (06:55 +0200)]
s3:smbd: pass smbXsrv_connection to open_was_deferred()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: move smbXsrv_{session,tcon,open} tables to smbXsrv_client
Stefan Metzmacher [Thu, 12 Jun 2014 18:22:54 +0000 (20:22 +0200)]
s3:smbd: move smbXsrv_{session,tcon,open} tables to smbXsrv_client

These should be per client (based on the SMB >= 2.1 client_guid),
this is a preparation for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use tevent_loop_wait() in the parent smbd process.
Michael Adam [Tue, 26 Feb 2013 15:39:46 +0000 (16:39 +0100)]
s3:smbd: use tevent_loop_wait() in the parent smbd process.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbd: use tevent_loop_wait() in the child process event loop
Michael Adam [Tue, 26 Feb 2013 15:18:09 +0000 (16:18 +0100)]
s3:smbd: use tevent_loop_wait() in the child process event loop

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbXsrv_session: change smbXsrv_session->connection to smbXsrv_session->client
Stefan Metzmacher [Thu, 12 Jun 2014 07:30:24 +0000 (09:30 +0200)]
s3:smbXsrv_session: change smbXsrv_session->connection to smbXsrv_session->client

A session will be usable from multiple connections in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use fsp->conn->sconn->client->connections to send SMB1 oplock breaks
Stefan Metzmacher [Tue, 16 Sep 2014 07:23:54 +0000 (09:23 +0200)]
s3:smbd: use fsp->conn->sconn->client->connections to send SMB1 oplock breaks

This means we use the first and only connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use sconn->client->connections in keepalive_fn()
Stefan Metzmacher [Mon, 15 Sep 2014 02:07:43 +0000 (04:07 +0200)]
s3:smbd: use sconn->client->connections in keepalive_fn()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use sconn->client->connections in reload_services()
Stefan Metzmacher [Tue, 10 Jun 2014 13:47:26 +0000 (15:47 +0200)]
s3:smbd: use sconn->client->connections in reload_services()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: remove now unused smbXsrv_connection->sconn
Stefan Metzmacher [Thu, 12 Jun 2014 06:57:22 +0000 (08:57 +0200)]
s3:smbd: remove now unused smbXsrv_connection->sconn

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()
Stefan Metzmacher [Thu, 12 Jun 2014 06:57:22 +0000 (08:57 +0200)]
s3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()

conn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()
Stefan Metzmacher [Thu, 12 Jun 2014 06:57:22 +0000 (08:57 +0200)]
s3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()

conn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_request_next_incoming()
Stefan Metzmacher [Wed, 11 Jun 2014 08:59:00 +0000 (10:59 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_next_incoming()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()
Stefan Metzmacher [Wed, 11 Jun 2014 08:51:04 +0000 (10:51 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()
Stefan Metzmacher [Wed, 11 Jun 2014 08:42:01 +0000 (10:42 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()
Stefan Metzmacher [Tue, 10 Jun 2014 18:20:58 +0000 (20:20 +0200)]
s3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use xconn->client->sconn in make_connection_snum()
Stefan Metzmacher [Mon, 15 Sep 2014 23:03:31 +0000 (01:03 +0200)]
s3:smbd: use xconn->client->sconn in make_connection_snum()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use xconn->client->sconn in smb1_parse_chain()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: use xconn->client->sconn in smb1_parse_chain()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use xconn->client->sconn in construct_reply()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: use xconn->client->sconn in construct_reply()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use xconn->client->sconn in reply_special()
Stefan Metzmacher [Wed, 11 Jun 2014 10:54:47 +0000 (12:54 +0200)]
s3:smbd: use xconn->client->sconn in reply_special()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use xconn->client->sconn in process_smb()
Stefan Metzmacher [Wed, 11 Jun 2014 08:40:42 +0000 (10:40 +0200)]
s3:smbd: use xconn->client->sconn in process_smb()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support
Stefan Metzmacher [Tue, 20 May 2014 17:47:13 +0000 (19:47 +0200)]
s3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support

This structure is supposed to hold the global state shared between
multiple connections from the same client.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to make_connection_snum()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smbXsrv_connection to make_connection_snum()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smb_request to make_connection_smb1()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smb_request to make_connection_smb1()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbd_smb2_request to make_connection_smb2()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smbd_smb2_request to make_connection_smb2()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smb_request to make_connection()
Stefan Metzmacher [Mon, 15 Sep 2014 01:47:41 +0000 (03:47 +0200)]
s3:smbd: pass smb_request to make_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to construct_reply*()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: pass smbXsrv_connection to construct_reply*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to smb1_parse_chain()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: pass smbXsrv_connection to smb1_parse_chain()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: support xconn=NULL in init_smb_request()
Michael Adam [Thu, 18 Sep 2014 19:46:22 +0000 (21:46 +0200)]
s3:smbd: support xconn=NULL in init_smb_request()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbd: only pass smbXsrv_connection to fork_echo_handler()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: only pass smbXsrv_connection to fork_echo_handler()

We don't need smbd_server_connection there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->sconn in reply.c where possible
Stefan Metzmacher [Wed, 11 Jun 2014 13:12:32 +0000 (15:12 +0200)]
s3:smbd: use req->sconn in reply.c where possible

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->sconn in sesssetup.c
Stefan Metzmacher [Wed, 11 Jun 2014 13:11:05 +0000 (15:11 +0200)]
s3:smbd: use req->sconn in sesssetup.c

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->sconn in reply_ntcancel()
Stefan Metzmacher [Wed, 11 Jun 2014 12:26:57 +0000 (14:26 +0200)]
s3:smbd: use req->sconn in reply_ntcancel()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use req->sconn in reply_negprot()
Stefan Metzmacher [Wed, 11 Jun 2014 10:42:56 +0000 (12:42 +0200)]
s3:smbd: use req->sconn in reply_negprot()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to srv_send_smb()
Stefan Metzmacher [Wed, 11 Jun 2014 10:55:24 +0000 (12:55 +0200)]
s3:smbd: pass smbXsrv_connection to srv_send_smb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: pass smbXsrv_connection to receive_smb*()
Stefan Metzmacher [Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)]
s3:smbd: pass smbXsrv_connection to receive_smb*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()
Michael Adam [Thu, 18 Sep 2014 19:25:44 +0000 (21:25 +0200)]
s3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()

instead of manually assembling the address string

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbd: use smbXsrv_connection_dbg() inreceive_smb_raw_talloc_partial_read()
Michael Adam [Thu, 18 Sep 2014 19:23:31 +0000 (21:23 +0200)]
s3:smbd: use smbXsrv_connection_dbg() inreceive_smb_raw_talloc_partial_read()

instead of manually assembling the address string

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()
Stefan Metzmacher [Wed, 6 Aug 2014 15:05:26 +0000 (17:05 +0200)]
s3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()

xconn->sconn will go away soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:smb2_server: use the global signing key to check if signing is required
Stefan Metzmacher [Thu, 12 Jun 2014 13:10:11 +0000 (15:10 +0200)]
s3:smb2_server: use the global signing key to check if signing is required

If we have a channel session key, we also always have a global session key.

For multi-channel it's possible that the channel session key is not in place
yet, in that case the global session key needs to be used.

In both cases (reauth or session bind) we session setup requests need to be
signed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos4:torture/smb2/lock: Add Lock Replay detection test case.
Anubhav Rakshit [Fri, 5 Sep 2014 10:46:57 +0000 (16:16 +0530)]
s4:torture/smb2/lock: Add Lock Replay detection test case.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos4:torture: Add Replay tests to examine server behaviour when Multiple Channels are...
Anubhav Rakshit [Thu, 7 Aug 2014 07:22:50 +0000 (12:52 +0530)]
s4:torture: Add Replay tests to examine server behaviour when Multiple Channels are utilized.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos3:selftest: run the smb2.replay test against the //$SERVER_IP/durable share
Stefan Metzmacher [Thu, 28 Aug 2014 11:26:44 +0000 (13:26 +0200)]
s3:selftest: run the smb2.replay test against the //$SERVER_IP/durable share

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.
Anubhav Rakshit [Thu, 10 Jul 2014 11:16:04 +0000 (16:46 +0530)]
libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.

Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: Add routine to reset the Channel Sequence number.
Anubhav Rakshit [Thu, 10 Jul 2014 09:00:10 +0000 (14:30 +0530)]
libcli/smb: Add routine to reset the Channel Sequence number.

Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolibcli/smb: correctly report disconnect errors after getting STATUS_PENDING
Stefan Metzmacher [Thu, 28 Aug 2014 08:20:36 +0000 (10:20 +0200)]
libcli/smb: correctly report disconnect errors after getting STATUS_PENDING

smb2cli_req_recv() should not report STATUS_PENDING if the
request isn't pending anymore (e.g. the connection was disconnected)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agos4:libcli/composite: correctly finish composite smb and smb2 requests
Stefan Metzmacher [Thu, 28 Aug 2014 09:05:23 +0000 (11:05 +0200)]
s4:libcli/composite: correctly finish composite smb and smb2 requests

Without this we would hang forever if the connection was already disconnected,
instead of directly propagating NT_STATUS_CONNECTION_DISCONNECTED;

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoctdb-build: Add missing configure checks for backtrace
Amitay Isaacs [Thu, 18 Sep 2014 00:21:25 +0000 (10:21 +1000)]
ctdb-build: Add missing configure checks for backtrace

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Sep 19 06:06:31 CEST 2014 on sn-devel-104

5 years agolib: util: Check *every* asn1 return call and early return.
Jeremy Allison [Thu, 18 Sep 2014 20:58:45 +0000 (13:58 -0700)]
lib: util: Check *every* asn1 return call and early return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 19 01:29:00 CEST 2014 on sn-devel-104

5 years agolib: Polish echo_server
Volker Lendecke [Sun, 14 Sep 2014 18:45:31 +0000 (20:45 +0200)]
lib: Polish echo_server

Samba has a lot of struct assignments now, in a lot of cases it simplifies the
code. Use it in the sample code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 18 23:02:38 CEST 2014 on sn-devel-104

5 years agolib: Add EMSGSIZE to map_nt_error_from_unix
Volker Lendecke [Sat, 13 Sep 2014 18:44:13 +0000 (20:44 +0200)]
lib: Add EMSGSIZE to map_nt_error_from_unix

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb_conn: Fix a small memory leak when releasing an IP
Volker Lendecke [Sat, 13 Sep 2014 18:06:45 +0000 (20:06 +0200)]
ctdb_conn: Fix a small memory leak when releasing an IP

We're exiting anyway, but when in the future we have multichannel this
might actually be a small leak.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agomessaging4: Fix an error path memleak
Volker Lendecke [Sun, 14 Sep 2014 12:33:53 +0000 (14:33 +0200)]
messaging4: Fix an error path memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agolib: util_tdb does not need samba-util
Volker Lendecke [Sun, 14 Sep 2014 09:22:36 +0000 (11:22 +0200)]
lib: util_tdb does not need samba-util

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agotdb_wrap: Only pull in samba-debug
Volker Lendecke [Sun, 14 Sep 2014 07:35:24 +0000 (09:35 +0200)]
tdb_wrap: Only pull in samba-debug

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agolib: Move tdb lock timeout fns to source3
Volker Lendecke [Sun, 14 Sep 2014 09:15:34 +0000 (11:15 +0200)]
lib: Move tdb lock timeout fns to source3

This is not the nicest code and needs to be replaced. Remove it from
common.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>