kai/samba-autobuild/.git
10 years agos3:client: only limit the buffer by the given length 'n'
Stefan Metzmacher [Wed, 19 Feb 2014 12:57:28 +0000 (13:57 +0100)]
s3:client: only limit the buffer by the given length 'n'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZE
Stefan Metzmacher [Wed, 19 Feb 2014 12:56:06 +0000 (13:56 +0100)]
s3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZE

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:utils/smbfilter: use a local variable for the packet buffer
Stefan Metzmacher [Wed, 19 Feb 2014 12:54:44 +0000 (13:54 +0100)]
s3:utils/smbfilter: use a local variable for the packet buffer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agonsswitch: Remove fallback setting of WINBINDD_SOCKET_DIR
Andrew Bartlett [Tue, 18 Feb 2014 22:39:46 +0000 (11:39 +1300)]
nsswitch: Remove fallback setting of WINBINDD_SOCKET_DIR

This is the original cause of the wbc NT_STATUS_OBJECT_NAME_NOT_FOUND issues in recent git master, as the
build was able to progress without the correct path being set as an override.

Andrew Bartlett

Change-Id: I1dbc7350695756356e869199b589eb781eb5c673
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Mar  5 18:34:48 CET 2014 on sn-devel-104

10 years agolibcli: Add warning about flow control changing macros in ntstatus.h
Andrew Bartlett [Tue, 4 Mar 2014 01:11:09 +0000 (14:11 +1300)]
libcli: Add warning about flow control changing macros in ntstatus.h

Change-Id: I49fec82e55b6bc59d5c0f157df90005f7d891c66
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoRemove all uses of the NT_STATUS_NOT_OK_RETURN_AND_FREE macro from the codebase.
Garming Sam [Fri, 14 Feb 2014 05:04:22 +0000 (18:04 +1300)]
Remove all uses of the NT_STATUS_NOT_OK_RETURN_AND_FREE macro from the codebase.

Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: I421e169275fe323e2b019c6cc5d386289aec07f7
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoRemove NT_STATUS_IS_ERR_RETURN macro from the codebase.
Garming Sam [Fri, 14 Feb 2014 04:46:40 +0000 (17:46 +1300)]
Remove NT_STATUS_IS_ERR_RETURN macro from the codebase.

Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: I39b07b3a799331a5faa968629aa95b836cb78600
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoRemove NT_STATUS_IS_OK_RETURN macro from the codebase.
Garming Sam [Fri, 14 Feb 2014 04:43:25 +0000 (17:43 +1300)]
Remove NT_STATUS_IS_OK_RETURN macro from the codebase.

Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: I27e7597f4078f0a6c96b5dadd12454fffe33e6b2
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoRemove the remaining uses of the macro NT_STATUS_HAVE_NO_MEMORY_AND_FREE in the codebase.
Garming Sam [Thu, 13 Feb 2014 05:08:56 +0000 (18:08 +1300)]
Remove the remaining uses of the macro NT_STATUS_HAVE_NO_MEMORY_AND_FREE in the codebase.

Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: Id1b540cde127395a7b27385a7c0fe79f3a145c73
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoRemove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.
Garming Sam [Thu, 13 Feb 2014 04:51:11 +0000 (17:51 +1300)]
Remove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.

Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: I133eb5a699757ae57b87d3bd3ebbcf5b556b0268
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agowinbind4: Remove unused winbind_get_idmap irpc operation
Volker Lendecke [Tue, 4 Feb 2014 10:22:25 +0000 (10:22 +0000)]
winbind4: Remove unused winbind_get_idmap irpc operation

Change-Id: Ia5e62d30b277f8a7074d451cfb8675eee8e9d21f
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoauth4: Remove unused wbc_context
Volker Lendecke [Tue, 4 Feb 2014 10:18:48 +0000 (10:18 +0000)]
auth4: Remove unused wbc_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I07d9f7d8028429564d91da39f8d1e73cc13a646c
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agontvfs_unixuid: No wbc_context required
Volker Lendecke [Mon, 3 Feb 2014 20:36:25 +0000 (21:36 +0100)]
ntvfs_unixuid: No wbc_context required

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I46f5d719005f3ac940482773404702368bbcfa4f
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agontvfs_posix: No wbc_context required
Volker Lendecke [Mon, 3 Feb 2014 20:35:05 +0000 (21:35 +0100)]
ntvfs_posix: No wbc_context required

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: Ibce7b25740cc14b0a60ad856f6b18c33115ea6fa
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agodcesrv_unixinfo: No wbc_context required
Volker Lendecke [Mon, 3 Feb 2014 20:33:21 +0000 (21:33 +0100)]
dcesrv_unixinfo: No wbc_context required

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I58f01cf754e6f9a7715c0319a43ec87d8e5df194
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agounixuid: Use the tevent_context from the ntvfs_context
Volker Lendecke [Sun, 2 Feb 2014 14:54:53 +0000 (15:54 +0100)]
unixuid: Use the tevent_context from the ntvfs_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I4edb0ee4cefdc2f1b309202c9ec70c7c7bbac0b8
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agopvfs: Use the tevent_context from the ntvfs_context
Volker Lendecke [Sun, 2 Feb 2014 14:53:25 +0000 (15:53 +0100)]
pvfs: Use the tevent_context from the ntvfs_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: Idb3ad8047d5161dd06800df611ea2a9cac84ecaa
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoauth4: Do not generate just a temporary wbc_context
Volker Lendecke [Sun, 2 Feb 2014 14:50:08 +0000 (15:50 +0100)]
auth4: Do not generate just a temporary wbc_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I16e116d7f1fdaf165e1239c10723c51f3828126d
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoauth4: auth_session_info_fill_unix only needs a tevent_context
Volker Lendecke [Sun, 2 Feb 2014 14:48:03 +0000 (15:48 +0100)]
auth4: auth_session_info_fill_unix only needs a tevent_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: Id453d68f57bd1dd15aa5778b317d258a6132d3d6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoauth4: security_token_to_unix_token only needs a tevent_context
Volker Lendecke [Sun, 2 Feb 2014 14:45:47 +0000 (15:45 +0100)]
auth4: security_token_to_unix_token only needs a tevent_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I27e5b38fcd3ac899c55c0632ea5d92fad686d9b1
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agolibwbclient4: Remove unused composite-based functions
Volker Lendecke [Sun, 2 Feb 2014 14:45:13 +0000 (15:45 +0100)]
libwbclient4: Remove unused composite-based functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: Iff6169e35f7a82e31c42df7b2d30d122b5f67451
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agosource4: Use wbc_xids_to_sids
Volker Lendecke [Sun, 2 Feb 2014 14:35:02 +0000 (15:35 +0100)]
source4: Use wbc_xids_to_sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: Ib1b1a7fcd881510e3fb4e5da29391e3d9392fa17
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agolibwbclient4: Add wbc_xids_to_sids
Volker Lendecke [Sat, 1 Feb 2014 19:46:28 +0000 (20:46 +0100)]
libwbclient4: Add wbc_xids_to_sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: Ibb67f6aabd9a3fbd023ff9ec1a34d82ae599177c
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agosource4: Use wbc_sids_to_xids
Volker Lendecke [Thu, 30 Jan 2014 20:12:07 +0000 (20:12 +0000)]
source4: Use wbc_sids_to_xids

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I86ea6587c436247ce66207c517f9c8d567ecac1d
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agolibwbclient4: Add wbc_sids_to_xids
Volker Lendecke [Thu, 30 Jan 2014 19:05:09 +0000 (19:05 +0000)]
libwbclient4: Add wbc_sids_to_xids

Signed-off-by: Volker Lendecke <vl@samba.org>
Change-Id: I79f4b87a14e7074970bd024626e5838a4461cc2e
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agorpc_server: change unsupported pipe error
David Disseldorp [Wed, 5 Mar 2014 12:37:26 +0000 (13:37 +0100)]
rpc_server: change unsupported pipe error

smbd currently prints the following level 0 error when a client attempts
to connect to an unsupported named pipe (e.g. browser):
  ERROR! 'browser' is not a registred pipe

This change reduces the severity of the error (0->2) and fixes a couple
of typos.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Mar  5 16:31:42 CET 2014 on sn-devel-104

10 years agodns: Extend tests for records with another type
Kai Blin [Fri, 28 Feb 2014 09:35:07 +0000 (10:35 +0100)]
dns: Extend tests for records with another type

Add another check to the one added for bug #10471, for added paranoia

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Tue Mar  4 15:47:10 CET 2014 on sn-devel-104

10 years agobug #10471: Don't respond with NXDOMAIN to records that exist with another type
Kai Blin [Thu, 27 Feb 2014 22:49:24 +0000 (23:49 +0100)]
bug #10471: Don't respond with NXDOMAIN to records that exist with another type

DNS queries for records with the wrong type need to trigger an empty
response with RCODE_OK instead of returning NXDOMAIN.

This adds a test and fixes bug #10471

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoautobuild: Run "make dist" to ensure non-waf docs build is run
Andrew Bartlett [Fri, 28 Feb 2014 00:32:55 +0000 (13:32 +1300)]
autobuild: Run "make dist" to ensure non-waf docs build is run

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar  4 05:00:27 CET 2014 on sn-devel-104

10 years agorpc_client: retry open on STATUS_PIPE_NOT_AVAILABLE
David Disseldorp [Mon, 3 Mar 2014 18:49:35 +0000 (19:49 +0100)]
rpc_client: retry open on STATUS_PIPE_NOT_AVAILABLE

Windows Server starts some named pipe services on demand, and responds
to initial open requests with STATUS_PIPE_NOT_AVAILABLE. The FssagentRpc
named pipe on Windows Server 2012 exhibits this behaviour.

This change sees rpcclient retry named pipe open requests when the
server responds with STATUS_PIPE_NOT_AVAILABLE. The retry logic is
contained in an asynchronous tevent_timer callback, to allow for
non-blocking callers.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoctdb-daemon: Do not support connection tracking if there are no public IPs
Amitay Isaacs [Tue, 11 Feb 2014 07:07:08 +0000 (18:07 +1100)]
ctdb-daemon: Do not support connection tracking if there are no public IPs

CTDB tracks connections to be able to send tickle ACKs and gratuitous
ARPs.  When there are no public IPs, there is no need for tickle ACKs
and gratuitous ARPs.

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): Tue Mar  4 03:01:38 CET 2014 on sn-devel-104

10 years agoctdb-util: Do not use mlockall() on AIX
Amitay Isaacs [Tue, 11 Feb 2014 06:57:42 +0000 (17:57 +1100)]
ctdb-util: Do not use mlockall() on AIX

Memory lockdown causes recovery daemon to crash on AIX.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-build: AIX does not have working C99 vsnprintf, requires libreplace
Amitay Isaacs [Thu, 6 Feb 2014 05:32:42 +0000 (16:32 +1100)]
ctdb-build: AIX does not have working C99 vsnprintf, requires libreplace

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-build: Remove auto-generated header file in distclean
Amitay Isaacs [Thu, 6 Feb 2014 05:27:09 +0000 (16:27 +1100)]
ctdb-build: Remove auto-generated header file in distclean

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agodocs-smbdotconf: fix WINBINDD_SOCKET_DIR path in fallback table
Björn Baumbach [Wed, 26 Feb 2014 14:31:55 +0000 (15:31 +0100)]
docs-smbdotconf: fix WINBINDD_SOCKET_DIR path in fallback table

Signed-off-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Mar  3 23:42:22 CET 2014 on sn-devel-104

10 years agodocs-smbdotconf: Fix build - add missing XML entities (config paths)
Björn Baumbach [Wed, 26 Feb 2014 14:26:28 +0000 (15:26 +0100)]
docs-smbdotconf: Fix build - add missing XML entities (config paths)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3: smbd - smb1 - fix read of deleted memory in reply_writeclose().
Noel Power [Thu, 27 Feb 2014 20:07:11 +0000 (12:07 -0800)]
s3: smbd - smb1 - fix read of deleted memory in reply_writeclose().

While running smbtorture test raw.write under valgrind an "Invalid read"
was reported in methid reply_writeclose, it seems after closing a file
sometime later we try to access it again.

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Mar  3 20:42:40 CET 2014 on sn-devel-104

10 years agosmbd: Fix an uninitialized memory read
Volker Lendecke [Mon, 3 Mar 2014 12:49:46 +0000 (13:49 +0100)]
smbd: Fix an uninitialized memory read

This might be the reason for a few flaky builds.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Mar  3 16:30:53 CET 2014 on sn-devel-104

10 years agopthreadpool: Add test for fork crash
Volker Lendecke [Mon, 3 Mar 2014 11:57:18 +0000 (11:57 +0000)]
pthreadpool: Add test for fork crash

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Simo Sorce <simo@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agopthreadpool: Fix pthreadpools with fork
Volker Lendecke [Mon, 3 Mar 2014 11:20:41 +0000 (12:20 +0100)]
pthreadpool: Fix pthreadpools with fork

The current could would crash if a pthreadpool was created, deleted and the
process then fork()s. "pthreadpools" is NULL in this case, but the
pthread_atfork handlers are in place. This fixes walking the pthreadpools list
in reverse.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Simo Sorce <simo@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agodbwrap_ctdb: avoid smbd/ctdb deadlocks: check whether we can work locally in db_ctdb_...
Michael Adam [Fri, 28 Feb 2014 14:49:30 +0000 (15:49 +0100)]
dbwrap_ctdb: avoid smbd/ctdb deadlocks: check whether we can work locally in db_ctdb_parse_record()

If the same process tries to re-lock the same record
it has already locked, don't go to the ctdbd again.

There are situations where we already have a lock on a record
and then do a dbwrap_parse_record() on that record, for instance
in locking code:

do_lock()
  -> grabs lock on brl record with brl_get_locks()
    -> calls brl_lock()
      -> calls brl_lock_posix or _windows_default()
        -> calls contend_level2_oplocks_begin()
          -> calls brl_locks_get_read_only()
            -> calls dbwrap_parse_record on the same brl record as above

In the local (tdb) case, this is not a problem, because
identical fcntl locks in the same process don't contend each other,
but calling out to ctdb for this lets smbd and ctdb deadlock.

db_ctdb_fetch_lock() already correclty checks first
whether we can simply try to lock locally. But db_ctdb_parse_record()
failed to do so for empty records, i.e. records that only
consist of the ctdb record header. (These can be deleted records
but can also be freshly created and still empty records.)

This patch lets db_ctdb_parse_record() not skip local access
for empty records, hence fixing the deadlock.

PLAN: In the long run, it would be better to solve this
generically on the dbwrap_layer, i.e. root the notion of
an already locked record there, and skip any call to the
db (tdb or ctdb backend) if we have it. This would also
solve the problem for all calls like fetch_locked, parse_record
and possibly others.  But this is the urgent fix for now.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Tested-by: Björn Baumbach <bb@sernet.de>
10 years agotorture: Fix a torture crash with -O3
Volker Lendecke [Fri, 28 Feb 2014 16:30:52 +0000 (16:30 +0000)]
torture: Fix a torture crash with -O3

When compiled with -O3, smbtorture can crash after the following valgrind
trace:

==16944== Conditional jump or move depends on uninitialised value(s)
==16944==    at 0x57FFAC3: ndr_push_unique_ptr (ndr_basic.c:730)
==16944==    by 0x58CB855: ndr_push_spoolss_SetPrinterInfo (ndr_spoolss.c:7939)
==16944==    by 0x58E2F95: ndr_push_spoolss_SetPrinter (ndr_spoolss.c:24724)
==16944==    by 0x417C78C: dcerpc_binding_handle_call_send (binding_handle.c:410)
==16944==    by 0x417C986: dcerpc_binding_handle_call (binding_handle.c:547)
==16944==    by 0x522059C: dcerpc_spoolss_SetPrinter_r (ndr_spoolss_c.c:1722)
==16944==    by 0x2853BD: test_sd_set_level (spoolss.c:1248)
==16944==    by 0x28F146: test_PrinterInfo_SD (spoolss.c:1962)
==16944==    by 0x2A3C31: test_EnumPrinters_old (spoolss.c:6589)
==16944==    by 0x41F6D66: internal_torture_run_test.part.0 (torture.c:442)
==16944==    by 0x41F711F: torture_run_tcase_restricted (torture.c:758)
==16944==    by 0x2018E8: run_matching.isra.1 (smbtorture.c:103)
==16944==    by 0x20176B: run_matching.isra.1 (smbtorture.c:95)
==16944==    by 0x20176B: run_matching.isra.1 (smbtorture.c:95)
==16944==    by 0x201C12: torture_run_named_tests (smbtorture.c:143)
==16944==    by 0x202F5B: main (smbtorture.c:661)

My assumption is that with optimization gcc makes use of the fact that the
structures that this patch moves go out of scope.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Feb 28 21:27:11 CET 2014 on sn-devel-104

10 years agotorture: Fix a buffer overrun
Volker Lendecke [Fri, 28 Feb 2014 15:50:21 +0000 (15:50 +0000)]
torture: Fix a buffer overrun

In test_EnumPrinterDrivers we go up to driver level 8. In C, this means
we are accessing the 9th entry in the following lines:

        ctx->driver_count[level]        = count;
        ctx->drivers[level]             = info;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agovfs: propagate snapshot enumeration errors
David Disseldorp [Thu, 27 Feb 2014 18:46:14 +0000 (19:46 +0100)]
vfs: propagate snapshot enumeration errors

The current FSCTL_GET_SHADOW_COPY_DATA/FSCTL_SRV_ENUMERATE_SNAPSHOTS
handler squashes all non-ENOSYS errors into an NT_STATUS_UNSUCCESSFUL
response.
This commit ensures that all errors are propagated up to the client, to
aid debugging.
The Windows Explorer "Previous Versions" dialogue doesn't appear to
distinguish between error codes. It displays "There are no previous
versions available".

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): Thu Feb 27 22:42:50 CET 2014 on sn-devel-104

10 years agos3: smbd: Ensure brl_get_locks_readonly() always returns a valid struct byte_range_lo...
Jeremy Allison [Thu, 27 Feb 2014 00:30:25 +0000 (16:30 -0800)]
s3: smbd: Ensure brl_get_locks_readonly() always returns a valid struct byte_range_lock even if there are no locks.

brl_get_locks_readonly() currently returns NULL when it can't
find any byte range locks on the file. This is an error - it
should return a valid struct byte_range_lock containing num_locks == 0
so it can be cached.

Returning NULL when there are no locks causes POSIX lock
tests to fail returning NT_STATUS_NO_MEMORY (as it thinks
it can't allocate the struct) instead of NT_STATUS_OK.

Fixes bug:

Bug 10431 - STATUS_NO_MEMORY response from Query File Posix Lock request

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
10 years agopidl: Make perl(Parse:Yapp:Driver) installation optional.
Andreas Schneider [Thu, 27 Feb 2014 12:14:56 +0000 (13:14 +0100)]
pidl: Make perl(Parse:Yapp:Driver) installation optional.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 27 18:47:03 CET 2014 on sn-devel-104

10 years agos3-spoolssd: Don't register spoolssd if epmd is not running.
Andreas Schneider [Thu, 27 Feb 2014 08:58:27 +0000 (09:58 +0100)]
s3-spoolssd: Don't register spoolssd if epmd is not running.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agoctdb-recoverd: Check if callback function is registered before calling
Amitay Isaacs [Thu, 27 Feb 2014 01:41:23 +0000 (12:41 +1100)]
ctdb-recoverd: Check if callback function is registered before calling

Fix suggested by by Kevin Osborn <kosborn@overlandstorage.com>.

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): Thu Feb 27 13:54:59 CET 2014 on sn-devel-104

10 years agoctdb-daemon: After updating tickles on other nodes, set update flag to false
Amitay Isaacs [Wed, 29 Jan 2014 04:54:35 +0000 (15:54 +1100)]
ctdb-daemon: After updating tickles on other nodes, set update flag to false

tcp_update_flag is set to true whenever tickles are added or deleted.
This flag is used to determine whether or not to send tickles list to
other nodes.  Once tickles list is sent to other nodes successfully,
set tcp_update_flag to false, so ctdbd does not keep sending same tickles
list every TickleUpdateInterval (20 seconds).

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Implement ctdb_control_startup()
Martin Schwenke [Thu, 27 Feb 2014 02:47:28 +0000 (13:47 +1100)]
ctdb-daemon: Implement ctdb_control_startup()

This doesn't implement what was recommended.  That would require
careful error handling, probably with a fallback to this code anyway.
This is simple and does no worse that the current code.  That is, the
new node is updated on the next call to tdb_update_tcp_tickles().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-daemon: Fix whitespaces
Amitay Isaacs [Wed, 22 Jan 2014 04:00:48 +0000 (15:00 +1100)]
ctdb-daemon: Fix whitespaces

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-daemon: Always talloc tickle array off vnn instead of ctdb->nodes
Amitay Isaacs [Wed, 22 Jan 2014 04:00:33 +0000 (15:00 +1100)]
ctdb-daemon: Always talloc tickle array off vnn instead of ctdb->nodes

This fixes ctdb crash reported in bug #10366.
Fix suggested by Kevin Osborn <kosborn@overlandstorage.com>.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agowaf: Add option to specify perl vendor dir.
Andreas Schneider [Tue, 25 Feb 2014 16:16:37 +0000 (17:16 +0100)]
waf: Add option to specify perl vendor dir.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 27 11:48:54 CET 2014 on sn-devel-104

10 years agopidl: Install pidl files corrently.
Andreas Schneider [Tue, 25 Feb 2014 15:04:24 +0000 (16:04 +0100)]
pidl: Install pidl files corrently.

Globbing is a really bad idea in installtion system. One of them is if
you use patch -b to create a backup, you will end up installing the
backup file too!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agodbwrap: Slightly simplify dbwrap_watch_record_stored
Volker Lendecke [Wed, 12 Feb 2014 12:48:19 +0000 (12:48 +0000)]
dbwrap: Slightly simplify dbwrap_watch_record_stored

We have messaging_send_buf, so there's no point to use an explicit
DATA_BLOB here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 25 23:27:21 CET 2014 on sn-devel-104

10 years agovfs_glusterfs: Remove "integer fd" code and store the glfs pointers.
Jose A. Rivera [Thu, 12 Dec 2013 22:06:36 +0000 (16:06 -0600)]
vfs_glusterfs: Remove "integer fd" code and store the glfs pointers.

Change-Id: I74347199e54be0d1dc031985534da1e56fd3e280
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Christopher R. Hertel <crh@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agovfs_glusterfs: smb_stat_ex_from_stat commenting and cleanup.
Christopher R. Hertel [Thu, 12 Dec 2013 18:29:20 +0000 (12:29 -0600)]
vfs_glusterfs: smb_stat_ex_from_stat commenting and cleanup.

Change-Id: If1b54e62b4fc2240aa17e5d1eae8f279f2fdfc42
Signed-off-by: Christopher R. Hertel <crh@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agovfs_glusterfs: Comment the top of the file.
Christopher R. Hertel [Thu, 12 Dec 2013 18:27:10 +0000 (12:27 -0600)]
vfs_glusterfs: Comment the top of the file.

Change-Id: I98b512da2e0e56f061247a7c48ce576287b43827
Signed-off-by: Christopher R. Hertel <crh@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3-printing: Fix obvious memory leak in printer_list_get_printer().
Jeremy Allison [Tue, 25 Feb 2014 00:18:31 +0000 (16:18 -0800)]
s3-printing: Fix obvious memory leak in printer_list_get_printer().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Feb 25 13:19:37 CET 2014 on sn-devel-104

10 years agopassdb: spare superfluous call to lookup_rids() in lookup_sids()
Michael Adam [Thu, 20 Feb 2014 15:57:21 +0000 (16:57 +0100)]
passdb: spare superfluous call to lookup_rids() in lookup_sids()

If we have no name indexes for a domain, all names were domain
names and have been resolved earlier, including the domain name.

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

Change-Id: I5a7a387fa89d2b2bdd465c13b3dca0e18ca0482c
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): Tue Feb 25 11:17:18 CET 2014 on sn-devel-104

10 years agorpc: fix name-normalization in rpc_sid_to_name()
Michael Adam [Thu, 20 Feb 2014 15:55:15 +0000 (16:55 +0100)]
rpc: fix name-normalization in rpc_sid_to_name()

Hand the *input* name as input into the normalize call,
not the (potentially uninitialized...) *output* name...

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

Change-Id: I4f3fc25882c22d96329e252d0a53bbe13d533472
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agorpc: correctly tread domain-only requests in rpc_sid_to_name()
Michael Adam [Thu, 20 Feb 2014 15:53:51 +0000 (16:53 +0100)]
rpc: correctly tread domain-only requests in rpc_sid_to_name()

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

Change-Id: I6a8a8c272b9cf7dbce4f9a99012209c29c31e839
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosamr: don't block the sam sid or the builtin domain sid in sid_to_name
Stefan Metzmacher [Thu, 20 Feb 2014 15:50:32 +0000 (16:50 +0100)]
samr: don't block the sam sid or the builtin domain sid in sid_to_name

Previously only members of these domains were handled.
But we also need to handle the domain itself.

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

Change-Id: I44f85267eda243d586fffd24a799e153de0ff982
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoctdb-eventscripts: Switch on dumping of stuck nfsd threads
Martin Schwenke [Thu, 20 Feb 2014 04:20:44 +0000 (15:20 +1100)]
ctdb-eventscripts: Switch on dumping of stuck nfsd threads

This feature was added quite a while ago but was not enabled by
default.  It is a useful feature so enable it to dump stack traces of
up to 5 stuck processes by default.

This can be disabled by setting:

  CTDB_NFS_DUMP_STUCK_THREADS=0

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): Tue Feb 25 04:06:45 CET 2014 on sn-devel-104

10 years agos4: tidy up vfs smb2 in regards to using share_string_option
Garming Sam [Thu, 20 Feb 2014 20:34:45 +0000 (09:34 +1300)]
s4: tidy up vfs smb2 in regards to using share_string_option

Change-Id: Ieae6b5ddc2cd9983489c374605e4740371e81883
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Feb 24 19:16:48 CET 2014 on sn-devel-104

10 years agos4: tidy up vfs cifs in regards to using share_string_option
Garming Sam [Thu, 20 Feb 2014 20:29:38 +0000 (09:29 +1300)]
s4: tidy up vfs cifs in regards to using share_string_option

Change-Id: I014bce667d3f875a913dbccf269b514f7ffbab7b
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agos4: tidy up some null checks in ntvfs
Garming Sam [Thu, 20 Feb 2014 20:06:25 +0000 (09:06 +1300)]
s4: tidy up some null checks in ntvfs

Change-Id: I629a299bea10b063de4525020a4c6b838260cd67
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agolibcli: Overflow array index read possible, in auth code.
Ira Cooper [Thu, 13 Feb 2014 19:45:23 +0000 (14:45 -0500)]
libcli: Overflow array index read possible, in auth code.

Changed the if condtion to detect when we'd improperly overflow.

Coverity-Id: 1167990
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 24 11:56:38 CET 2014 on sn-devel-104

10 years agoRevert "libcli: Overflow array index read possible, in auth code."
Ira Cooper [Mon, 24 Feb 2014 08:46:00 +0000 (14:16 +0530)]
Revert "libcli: Overflow array index read possible, in auth code."

This reverts commit 538cbfe0e90b7c7ed0f8421b323cac4dacd83f04.

Signed-off-by: Ira Cooper <ira@samba.org>
10 years agolibcli: Overflow array index read possible, in auth code.
Ira Cooper [Thu, 13 Feb 2014 19:45:23 +0000 (14:45 -0500)]
libcli: Overflow array index read possible, in auth code.

The values have to be signed here to allow for the values to go negative,
to prevent the overflow.

Coverity-Id: 1167990
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 24 07:23:03 CET 2014 on sn-devel-104

10 years agos3:printing: Fix a possible NULL dereference.
Poornima Gurusiddaiah [Fri, 14 Feb 2014 03:27:12 +0000 (03:27 +0000)]
s3:printing: Fix a possible NULL dereference.

Coverity-Id: 710708

Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3:passdb: Fix the use of uninitialized scalar variable.
Poornima Gurusiddaiah [Fri, 14 Feb 2014 03:56:56 +0000 (03:56 +0000)]
s3:passdb: Fix the use of uninitialized scalar variable.

Coverity-id: 1107228,1107227

Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3/libsmb: Free memdup'd local variable
Jose A. Rivera [Thu, 20 Feb 2014 15:14:59 +0000 (09:14 -0600)]
s3/libsmb: Free memdup'd local variable

secrets_fetch_machine_password() sets pwd to point to memdup()'d (and thus
malloc()'d) memory. This memory should be freed before we go out of scope.

Change-Id: I07e575819c309fa5b85627dce2eb969bc720ce4e
Coverity-Id: 1168001
Reviewed-by: Ira Cooper <ira@samba.org>
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Sat Feb 22 00:58:23 CET 2014 on sn-devel-104

10 years agopassdb: Patch memory leak in pdb_ldap.c
Jose A. Rivera [Tue, 18 Feb 2014 13:35:37 +0000 (07:35 -0600)]
passdb: Patch memory leak in pdb_ldap.c

Moved the call to the talloc autofree function to as early a point as
possible. init_ldap_from_sam() already calls smbldap_set_mod(), and there's
a chance that the init will fail after having already allocated memory for
&mods.

Coverity-Id: 1167997
Change-Id: Ic26bfb3c530f90aa885e447b8409deba49708d64
Reviewed-by: Ira Cooper <ira@samba.org>
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agotestprogs: Fix pkinit test with system ldb.
Andreas Schneider [Fri, 21 Feb 2014 14:55:22 +0000 (15:55 +0100)]
testprogs: Fix pkinit test with system ldb.

Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Feb 21 17:58:24 CET 2014 on sn-devel-104

10 years agotestprogs: Fix kinit test with system ldb.
Andreas Schneider [Fri, 21 Feb 2014 14:52:42 +0000 (15:52 +0100)]
testprogs: Fix kinit test with system ldb.

Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 years agonsswitch: Fix idmap rfc2307 test with system ldb.
Andreas Schneider [Fri, 21 Feb 2014 14:37:52 +0000 (15:37 +0100)]
nsswitch: Fix idmap rfc2307 test with system ldb.

Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 years agoselftest: Use the absolute path to the ldb modules.
Andreas Schneider [Fri, 21 Feb 2014 13:23:00 +0000 (14:23 +0100)]
selftest: Use the absolute path to the ldb modules.

This fixes 'make test' on Fedora with external ldb.

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 years agoheimdal: Use krb5_free_default_realm() for free()
Santosh Kumar Pradhan [Fri, 21 Feb 2014 04:18:31 +0000 (09:48 +0530)]
heimdal: Use krb5_free_default_realm() for free()

The resource allocated by krb5_default_default_realm() should be
free()'d by krb5_free_default_realm() instead of plain free()
for better readability.

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agokdc: Free the resource which is not used anymore
Santosh Kumar Pradhan [Fri, 21 Feb 2014 04:13:47 +0000 (09:43 +0530)]
kdc: Free the resource which is not used anymore

In samba_kdc_firstkey() routine, krb5_get_default_realm() allocates
memory for "realm" but never used afterwards. Free() the leaked memory.

CID: 1107223

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()
Gregor Beck [Thu, 20 Feb 2014 10:25:53 +0000 (11:25 +0100)]
s3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()

As a domain member we should always use a DC of our own domain.

It would be possible to pass all sids in one single dcerpc_wbint_LookupSids()
call. For now we just fix bug.

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

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3:winbindd: fix _wbint_LookupSids() on error
Gregor Beck [Thu, 20 Feb 2014 12:14:31 +0000 (13:14 +0100)]
s3:winbindd: fix _wbint_LookupSids() on error

We need to make sure that r->out.domains remains valid,
otherwise we're not able to marshall the response.

Note that wbint_LookupSids() has [out,ref] lsa_RefDomainList *domains,
while lsa_LookupSids() has [out,ref] lsa_RefDomainList **domains.

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

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"
Stefan Metzmacher [Thu, 13 Feb 2014 14:36:27 +0000 (15:36 +0100)]
s3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"

If smbd_server_connection_terminate("CTDB_SRVID_RELEASE_IP") is triggered from
within ctdbd_migrate(), we got a smb_panic complaining about invalid
lock_order, as ctdbd_migrate is called from dbwrap_fetch_locked().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10444
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 21 14:51:51 CET 2014 on sn-devel-104

10 years agos3:lib/ctdbd_conn: let release_ip_handler return bool
Stefan Metzmacher [Mon, 17 Feb 2014 10:57:52 +0000 (11:57 +0100)]
s3:lib/ctdbd_conn: let release_ip_handler return bool

If it returns true the passed ip address matched and we
let a nested ctdb operation fail with NT_STATUS_ADDRESS_CLOSED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agos3:smbd: maintain smbd_server_connection->status
Stefan Metzmacher [Mon, 17 Feb 2014 11:01:12 +0000 (12:01 +0100)]
s3:smbd: maintain smbd_server_connection->status

If this isn't NT_STATUS_OK, we skip any io on the socket.

This avoids possible problems during shutdown.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agos3:smbd: simplify exit_server_common()
Stefan Metzmacher [Mon, 17 Feb 2014 11:05:42 +0000 (12:05 +0100)]
s3:smbd: simplify exit_server_common()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agoclitar: don't panic, propagate talloc errors upwards
David Disseldorp [Thu, 20 Feb 2014 18:47:50 +0000 (19:47 +0100)]
clitar: don't panic, propagate talloc errors upwards

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb 21 02:49:36 CET 2014 on sn-devel-104

10 years agoclitar: propagate make_remote_path() talloc errors
David Disseldorp [Thu, 20 Feb 2014 18:47:49 +0000 (19:47 +0100)]
clitar: propagate make_remote_path() talloc errors

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: return allocation errors from is_subpath()
David Disseldorp [Thu, 20 Feb 2014 18:47:48 +0000 (19:47 +0100)]
clitar: return allocation errors from is_subpath()

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: add error return to tar_path_in_list()
David Disseldorp [Thu, 20 Feb 2014 18:47:47 +0000 (19:47 +0100)]
clitar: add error return to tar_path_in_list()

In preparation for propagation of memory allocation errors from
is_subpath().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: add error return to tar_extract_skip_path()
David Disseldorp [Thu, 20 Feb 2014 18:47:46 +0000 (19:47 +0100)]
clitar: add error return to tar_extract_skip_path()

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: add error return to tar_create_skip_path()
David Disseldorp [Thu, 20 Feb 2014 18:47:45 +0000 (19:47 +0100)]
clitar: add error return to tar_create_skip_path()

In preparation for propagation of memory allocation errors from
tar_path_in_list() and friends.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: check for path_base_name() allocation errors
David Disseldorp [Thu, 20 Feb 2014 18:47:44 +0000 (19:47 +0100)]
clitar: check for path_base_name() allocation errors

Add a separate NTSTATUS return code, as base string may be NULL on
successful return.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolib: Fix a typo
Volker Lendecke [Tue, 31 Dec 2013 14:28:04 +0000 (15:28 +0100)]
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 20 22:58:59 CET 2014 on sn-devel-104

10 years agomessaging: Fix a memleak on error in messaging_tdb_init
Volker Lendecke [Sat, 28 Dec 2013 13:18:32 +0000 (14:18 +0100)]
messaging: Fix a memleak on error in messaging_tdb_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agolib: Avoid a strlen call in xx_path()
Volker Lendecke [Wed, 1 Jan 2014 10:38:52 +0000 (11:38 +0100)]
lib: Avoid a strlen call in xx_path()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agokrb5_locator: Slightly simplify code
Volker Lendecke [Thu, 13 Feb 2014 13:19:26 +0000 (13:19 +0000)]
krb5_locator: Slightly simplify code

This makes it a bit easier to read for me

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agowinbindd: Avoid using deallocated memory
Santosh Kumar Pradhan [Thu, 20 Feb 2014 10:21:37 +0000 (15:51 +0530)]
winbindd: Avoid using deallocated memory

Failure in ads_search_retry() deallocates the memory occupied
by "ads" which should not be used after.

CID: 242096

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agomessaging: Enforce just one messaging context
Volker Lendecke [Tue, 18 Feb 2014 19:51:23 +0000 (20:51 +0100)]
messaging: Enforce just one messaging context

The current messaging implementation is based on a tdb indexed by server_id. If
we have more than one messaging context in a process, messages might not arrive
at the right context and be dropped, depending on which signal handler is
triggered first.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agovfstext: Use just one messaging_context in vfstest
Volker Lendecke [Tue, 18 Feb 2014 19:51:57 +0000 (20:51 +0100)]
vfstext: Use just one messaging_context in vfstest

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>