samba.git
9 years agoAdd simple subunit runner outputting subunit v1.
Jelmer Vernooij [Thu, 11 Dec 2014 01:07:36 +0000 (01:07 +0000)]
Add simple subunit runner outputting subunit v1.

This is a short module (< 1k lines) that removes the need to
depend on subunit, testtools, extras and mimeparse. It is
based on an extract from testtools and subunit.

Change-Id: I0a4f3060b25f7bde602a07ed6bef71c8196fca64
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoctdb-tests: Check for readable, not executable, script
Martin Schwenke [Fri, 6 Mar 2015 00:36:18 +0000 (11:36 +1100)]
ctdb-tests: Check for readable, not executable, script

Scripts in eventscript unit tests are run under an explicitly
specified shell so they do not need to be executable.  Checking that
the script is executable breaks on scripts that are installed without
the execute bit set, such as disabled eventscripts.

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): Fri Mar  6 04:40:07 CET 2015 on sn-devel-104

9 years agoperfcount: Fix CID 1035494 Out-of-bounds read
Volker Lendecke [Thu, 5 Mar 2015 10:12:38 +0000 (11:12 +0100)]
perfcount: Fix CID 1035494 Out-of-bounds read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Thu Mar  5 18:28:44 CET 2015 on sn-devel-104

9 years agoperfcount: Fix CID 1035493 Out-of-bounds read
Volker Lendecke [Thu, 5 Mar 2015 10:11:59 +0000 (11:11 +0100)]
perfcount: Fix CID 1035493 Out-of-bounds read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agoperfcount: Fix CID 1035492 Out-of-bounds read
Volker Lendecke [Thu, 5 Mar 2015 10:10:35 +0000 (11:10 +0100)]
perfcount: Fix CID 1035492 Out-of-bounds read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agoperfcount: Fix CID 1274043 Division or modulo by zero
Volker Lendecke [Thu, 5 Mar 2015 10:07:56 +0000 (11:07 +0100)]
perfcount: Fix CID 1274043 Division or modulo by zero

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agoprinting: increse log level for unreachable cups servers
Björn Jacke [Wed, 4 Mar 2015 09:15:10 +0000 (10:15 +0100)]
printing: increse log level for unreachable cups servers

this annoying messages hitting the logs very often on non-cups servers by
default in log level 0 otherwise.

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Mar  5 14:38:42 CET 2015 on sn-devel-104

9 years agoctdb-locking: Back-off from logging every 10 seconds
Amitay Isaacs [Wed, 4 Mar 2015 04:36:05 +0000 (15:36 +1100)]
ctdb-locking: Back-off from logging every 10 seconds

If ctdb_lock_helper cannot get a lock within 10 seconds, ctdb daemon
logs a message and invokes an external debug script.  This is repeated
every 10 seconds.

In case of a contention or on a loaded system, there can be multiple
ctdb_lock_helper processes waiting to get lock on record(s).  For each
lock request taking longer, ctdb daemon will flood the log every
10 seconds.  Instead of logging aggressively every 10 seconds, relax
logging to every 100s and 1000s if the elapsed time has exceeded 100s
and 1000s respectively.

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): Thu Mar  5 12:06:44 CET 2015 on sn-devel-104

9 years agoctdb-tests: Correctly cascade test failures from the end of pipes
Amitay Isaacs [Thu, 5 Mar 2015 02:11:46 +0000 (13:11 +1100)]
ctdb-tests: Correctly cascade test failures from the end of pipes

Some eventscript unit test failures get lost because _passed=false is
set in the tail of a pipe.  Add a new function test_fail() and call it
when necessary to ensure the value of _passed is set correctly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Mar  5 07:16:54 CET 2015 on sn-devel-104

9 years agoctdb-scripts: Add a 'rm' stub so statd-callout tests work correctly
Amitay Isaacs [Thu, 5 Mar 2015 02:10:32 +0000 (13:10 +1100)]
ctdb-scripts: Add a 'rm' stub so statd-callout tests work correctly

statd-callout tries to remove global files from /var/lib/nfs/statd and
this causes errors in tests.  Add an rm stub that ignores attempts to
remove these files but invokes /bin/rm for anything else.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agorpc_server: Fix CID 1273433 Unused value
Volker Lendecke [Wed, 4 Mar 2015 10:08:36 +0000 (11:08 +0100)]
rpc_server: Fix CID 1273433 Unused value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar  4 23:29:01 CET 2015 on sn-devel-104

9 years agorpc_server: Fix CID 1035535 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:47:03 +0000 (10:47 +0100)]
rpc_server: Fix CID 1035535 Uninitialized scalar variable

I believe this can't happen, but better be safe than sorry

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): Wed Mar  4 17:14:53 CET 2015 on sn-devel-104

9 years agorpc_server: Fix CID 1035534 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:47:03 +0000 (10:47 +0100)]
rpc_server: Fix CID 1035534 Uninitialized scalar variable

I believe this can't happen, but better be safe than sorry

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agobackupkey: Remove an unused variable
Volker Lendecke [Wed, 4 Mar 2015 09:36:40 +0000 (10:36 +0100)]
backupkey: Remove an unused variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agobackupkey: Fix CID 1273293 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:35:47 +0000 (10:35 +0100)]
backupkey: Fix CID 1273293 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agobackupkey: Fix a memleak
Volker Lendecke [Wed, 4 Mar 2015 09:33:57 +0000 (10:33 +0100)]
backupkey: Fix a memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agobackupkey: Simplify get_lsa_secret
Volker Lendecke [Wed, 4 Mar 2015 09:33:38 +0000 (10:33 +0100)]
backupkey: Simplify get_lsa_secret

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agobackupkey: Slightly simplify bkrp_do_retrieve_server_wrap_key
Volker Lendecke [Wed, 4 Mar 2015 09:29:53 +0000 (10:29 +0100)]
backupkey: Slightly simplify bkrp_do_retrieve_server_wrap_key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agowinbind: Fix CID 1273294 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:28:20 +0000 (10:28 +0100)]
winbind: Fix CID 1273294 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agowinbind: Fix CID 1273295 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:22:48 +0000 (10:22 +0100)]
winbind: Fix CID 1273295 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agolibads: Fix CID 1273305 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:09:51 +0000 (10:09 +0100)]
libads: Fix CID 1273305 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agolibads: Fix CID 1273306 Uninitialized scalar variable
Volker Lendecke [Wed, 4 Mar 2015 09:09:18 +0000 (10:09 +0100)]
libads: Fix CID 1273306 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agolib: Fix CID 1273292 Uninitialized pointer read
Volker Lendecke [Wed, 4 Mar 2015 09:00:29 +0000 (10:00 +0100)]
lib: Fix CID 1273292 Uninitialized pointer read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agolib: Fix CID 1273056 Negative array index read
Volker Lendecke [Wed, 4 Mar 2015 08:49:18 +0000 (09:49 +0100)]
lib: Fix CID 1273056 Negative array index read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agolib: Fix CID 1128561 Pointer to local outside scope
Volker Lendecke [Wed, 4 Mar 2015 08:43:19 +0000 (09:43 +0100)]
lib: Fix CID 1128561 Pointer to local outside scope

This is not strictly a bug, but it is confusing enough to justify a small patch
I guess.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agoFix whitespace
Volker Lendecke [Wed, 4 Mar 2015 08:43:09 +0000 (09:43 +0100)]
Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agolib: Fix CID 1128552 Buffer not null terminated
Volker Lendecke [Wed, 4 Mar 2015 08:38:52 +0000 (09:38 +0100)]
lib: Fix CID 1128552 Buffer not null terminated

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agobuild:wafadmin: fix use of spaces instead of tabs.
Michael Adam [Tue, 3 Mar 2015 12:33:10 +0000 (13:33 +0100)]
build:wafadmin: fix use of spaces instead of tabs.

Indentation should not be a mixture of tabs and spaces.
Waf uses tabs.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agoctdb-build: Specify absolute path to libsocket-wrapper.so
Amitay Isaacs [Wed, 4 Mar 2015 04:55:15 +0000 (15:55 +1100)]
ctdb-build: Specify absolute path to libsocket-wrapper.so

Specifying a relative path to LD_PRELOAD can fail if any of the test
scripts uses cd to change directory and execute commands.

Adding statd-callout tests breaks autotest since statd-callout does "cd".

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Mar  4 13:11:53 CET 2015 on sn-devel-104

9 years agoctdb-tests: Remove the old, confusing INSTALL script
Martin Schwenke [Wed, 4 Mar 2015 00:51:50 +0000 (11:51 +1100)]
ctdb-tests: Remove the old, confusing INSTALL script

It is not used after switching to waf build.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Remove unused function nfs_statd_update()
Martin Schwenke [Fri, 13 Feb 2015 04:42:20 +0000 (15:42 +1100)]
ctdb-scripts: Remove unused function nfs_statd_update()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Change statd-callout to be more scalable
Martin Schwenke [Fri, 13 Feb 2015 09:55:43 +0000 (20:55 +1100)]
ctdb-scripts: Change statd-callout to be more scalable

Updating ctdb.tdb on each add-client, del-client and each delete
during notify was too ambitious.  Persistent transactions do not
perform well enough to do this.

Revert to having add-client and del-client create touch files.  Each
monitor event calls "statd-callout update" to convert touch files into
ctdb.tdb records.

Update testcases to do the "update" and add an extra test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Fix a regression in statd-callout
Martin Schwenke [Thu, 26 Feb 2015 04:34:51 +0000 (15:34 +1100)]
ctdb-scripts: Fix a regression in statd-callout

Commit 4638010abb116aed0c180207aaa11475277aecb7 changed from using
gensub() to gsub() in awk.  However, it didn't halve the number of
backslashes in the target strings.  This is necessary because
backslash is used in gensub() target strings to allow substitution of
text matching parenthesised subexpressions.  This is not the case with
gsub().

So, halve the number of backslashes in the target string where gsub()
is used in statd-callout.  This is the only target string broken by
changes made by the above commit

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Unit tests for statd-callout
Martin Schwenke [Wed, 4 Mar 2015 00:51:20 +0000 (11:51 +1100)]
ctdb-tests: Unit tests for statd-callout

With improvements to unit test infrastructure to support.  This
includes linking the real statd-callout into etc-ctdb/ in place of the
placeholder script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Make setup of public addresses more obvious
Martin Schwenke [Fri, 27 Feb 2015 04:20:56 +0000 (15:20 +1100)]
ctdb-tests: Make setup of public addresses more obvious

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Extend eventscript unit test infrastructure for other scripts
Martin Schwenke [Fri, 27 Feb 2015 04:19:04 +0000 (15:19 +1100)]
ctdb-tests: Extend eventscript unit test infrastructure for other scripts

There's so much infrastructure here that it would be a shame not to
use it for testing things like statd-callout.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Support testing scripts that change directory
Martin Schwenke [Fri, 27 Feb 2015 04:17:30 +0000 (15:17 +1100)]
ctdb-tests: Support testing scripts that change directory

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Extend ctdb stub to support "ip" with and without -X
Martin Schwenke [Fri, 27 Feb 2015 04:15:18 +0000 (15:15 +1100)]
ctdb-tests: Extend ctdb stub to support "ip" with and without -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Extend ctdb stub to support "ptrans", "pdelete", "catdb"
Martin Schwenke [Fri, 27 Feb 2015 04:13:23 +0000 (15:13 +1100)]
ctdb-tests: Extend ctdb stub to support "ptrans", "pdelete", "catdb"

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotevent: version 0.9.24 tevent-0.9.24
David Disseldorp [Tue, 3 Mar 2015 22:58:09 +0000 (23:58 +0100)]
tevent: version 0.9.24

* Ignore unsolicited signal wakeup in tevent_port event loop.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar  4 08:33:06 CET 2015 on sn-devel-104

9 years agopyldb: Add tests for type errors
Petr Viktorin [Tue, 3 Mar 2015 21:29:14 +0000 (22:29 +0100)]
pyldb: Add tests for type errors

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar  4 01:49:02 CET 2015 on sn-devel-104

9 years agopyldb: Report errors converting controls list to char**
Petr Viktorin [Tue, 3 Mar 2015 21:29:13 +0000 (22:29 +0100)]
pyldb: Report errors converting controls list to char**

With this change, passing an unexpected type to the CRUD methods
will result in an informative TypeError.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Better error reporting
Petr Viktorin [Tue, 3 Mar 2015 21:29:12 +0000 (22:29 +0100)]
pyldb: Better error reporting

Provide more useful error messages for some type errors

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Type-check arguments parsed with PyArg_ParseTuple*
Petr Viktorin [Tue, 3 Mar 2015 21:29:11 +0000 (22:29 +0100)]
pyldb: Type-check arguments parsed with PyArg_ParseTuple*

PyObject* arguments need to be type-checked before they're
cast to subtypes.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Fix reference leaks
Petr Viktorin [Tue, 3 Mar 2015 21:29:10 +0000 (22:29 +0100)]
pyldb: Fix reference leaks

The parse_ldif and MessageElement.__iter__ functions leaked references
to intermediate lists whose iterators they return.

The MessageElement repr used the undocumented macro PyObject_REPR, which
leaks references. (It was used internally in CPython before fatal errors,
and will be removed in Python 3.5.)

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Remove use of staticforward macro
Petr Viktorin [Tue, 3 Mar 2015 21:29:09 +0000 (22:29 +0100)]
pyldb: Remove use of staticforward macro

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Properly preallocate result control list
Petr Viktorin [Tue, 3 Mar 2015 21:29:08 +0000 (22:29 +0100)]
pyldb: Properly preallocate result control list

The list was always allocated with size 1, so
if there is more than 1 result control, the additional
items would not be added in the list, and would
become leaked references.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Use the Py_TYPE macro
Petr Viktorin [Tue, 3 Mar 2015 21:29:07 +0000 (22:29 +0100)]
pyldb: Use the Py_TYPE macro

The "ob_type" member of Python objects is going away
in Python 3 for compliance with C's strict aliasing rules.
The Py_TYPE macro should be used instead.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopyldb: Correct reference counting when returning bools
Petr Viktorin [Tue, 3 Mar 2015 21:29:06 +0000 (22:29 +0100)]
pyldb: Correct reference counting when returning bools

Simply returning Py_True/PyFalse doesn't increment the bool object's
reference count.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopam: Fix CID 1034871 Resource leak
Volker Lendecke [Tue, 3 Mar 2015 15:12:03 +0000 (16:12 +0100)]
pam: Fix CID 1034871 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Mar  3 20:03:25 CET 2015 on sn-devel-104

9 years agopam: Fix CID 1034870 Resource leak
Volker Lendecke [Tue, 3 Mar 2015 15:11:26 +0000 (16:11 +0100)]
pam: Fix CID 1034870 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 years agolib: Fix CID 1273073 Assign instead of compare
Volker Lendecke [Tue, 3 Mar 2015 14:57:02 +0000 (15:57 +0100)]
lib: Fix CID 1273073 Assign instead of compare

This is a brown paper bag thingy, right?

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 years agosmbd: Fix CID 1273088 Resource leak
Volker Lendecke [Tue, 3 Mar 2015 14:53:34 +0000 (15:53 +0100)]
smbd: Fix CID 1273088 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 years agoaio_fork: Fix CID 1273291 Uninitialized scalar variable
Volker Lendecke [Tue, 3 Mar 2015 14:48:46 +0000 (15:48 +0100)]
aio_fork: Fix CID 1273291 Uninitialized scalar variable

The previous code left msg.msg_flags uninitialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 years agotevent: Ignore unexpected signal events in the same way the epoll backend does.
Jeremy Allison [Tue, 3 Mar 2015 00:17:54 +0000 (16:17 -0800)]
tevent: Ignore unexpected signal events in the same way the epoll backend does.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Mar  3 17:33:06 CET 2015 on sn-devel-104

9 years agoFix the O3 developer build
Volker Lendecke [Tue, 3 Mar 2015 07:48:00 +0000 (08:48 +0100)]
Fix the O3 developer build

Different gcc versions complain at different places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  3 13:14:53 CET 2015 on sn-devel-104

9 years agosmbd: Make SMB3 clients use encryption with "smb encrypt = auto"
Volker Lendecke [Wed, 25 Feb 2015 15:59:26 +0000 (16:59 +0100)]
smbd: Make SMB3 clients use encryption with "smb encrypt = auto"

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): Tue Mar  3 10:40:42 CET 2015 on sn-devel-104

9 years agowaf: Fix the build on openbsd
Volker Lendecke [Mon, 2 Feb 2015 20:08:25 +0000 (21:08 +0100)]
waf: Fix the build on openbsd

We have single-digit vnum='0', make the assignment deal with it

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): Tue Mar  3 03:33:24 CET 2015 on sn-devel-104

9 years agogpfs: Add include guard to gpfswrap.h
Christof Schmitt [Wed, 18 Feb 2015 22:29:45 +0000 (15:29 -0700)]
gpfs: Add include guard to gpfswrap.h

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Tue Mar  3 01:01:25 CET 2015 on sn-devel-104

9 years agogpfs: Rename library wrapper to gpfswrap
Christof Schmitt [Wed, 10 Dec 2014 23:05:16 +0000 (16:05 -0700)]
gpfs: Rename library wrapper to gpfswrap

The code in gpfs.c and vfs_gpfs.h now only wraps the gpfs library.
Rename the files to gpfswrap to make it clear that this is the only
purpose of that file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Update file headers
Christof Schmitt [Wed, 18 Feb 2015 22:25:02 +0000 (15:25 -0700)]
gpfs: Update file headers

Update file headers to reflect the new code organization and reformat
for consistency.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Remove unncessary includes from gpfs.c
Christof Schmitt [Wed, 18 Feb 2015 22:24:56 +0000 (15:24 -0700)]
gpfs: Remove unncessary includes from gpfs.c

replace.h provides everything that is required (errno and ENOSYS).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move DBGC_CLASS definition below includes
Christof Schmitt [Wed, 18 Feb 2015 22:24:50 +0000 (15:24 -0700)]
gpfs: Move DBGC_CLASS definition below includes

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Include gpfs_fcntl.h only from vfs_gpfs header file
Christof Schmitt [Wed, 18 Feb 2015 22:24:44 +0000 (15:24 -0700)]
gpfs: Include gpfs_fcntl.h only from vfs_gpfs header file

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move definition of GPFS_GETACL_NATIVE to vfs_gpfs.c
Christof Schmitt [Wed, 18 Feb 2015 22:24:35 +0000 (15:24 -0700)]
gpfs: Move definition of GPFS_GETACL_NATIVE to vfs_gpfs.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move smbd_gpfs_set_times_path to vfs_gpfs.c
Christof Schmitt [Wed, 10 Dec 2014 22:56:30 +0000 (15:56 -0700)]
gpfs: Move smbd_gpfs_set_times_path to vfs_gpfs.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move get_gpfs_fset_id to vfs_gpfs.c
Christof Schmitt [Wed, 10 Dec 2014 22:55:19 +0000 (15:55 -0700)]
gpfs: Move get_gpfs_fset_id to vfs_gpfs.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move get_gpfs_quota to vfs_gpfs.c
Christof Schmitt [Wed, 10 Dec 2014 22:51:17 +0000 (15:51 -0700)]
gpfs: Move get_gpfs_quota to vfs_gpfs.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move set_gpfs_lease to vfs_gpfs.c
Christof Schmitt [Wed, 10 Dec 2014 22:50:14 +0000 (15:50 -0700)]
gpfs: Move set_gpfs_lease to vfs_gpfs.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Move set_gpfs_sharemode to vfs_gpfs.c
Christof Schmitt [Wed, 10 Dec 2014 22:49:25 +0000 (15:49 -0700)]
gpfs: Move set_gpfs_sharemode to vfs_gpfs.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Introduce wrapper for gpfs_getfilesetid
Christof Schmitt [Wed, 10 Dec 2014 22:47:46 +0000 (15:47 -0700)]
gpfs: Introduce wrapper for gpfs_getfilesetid

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Introduce wrapper for gpfs_fcntl
Christof Schmitt [Wed, 10 Dec 2014 22:46:07 +0000 (15:46 -0700)]
gpfs: Introduce wrapper for gpfs_fcntl

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Introduce wrapper for gpfs_quotactl
Christof Schmitt [Wed, 10 Dec 2014 22:42:32 +0000 (15:42 -0700)]
gpfs: Introduce wrapper for gpfs_quotactl

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Introduce wrapper for gpfs_set_times_path
Christof Schmitt [Wed, 10 Dec 2014 22:40:16 +0000 (15:40 -0700)]
gpfs: Introduce wrapper for gpfs_set_times_path

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_lib_init
Christof Schmitt [Wed, 10 Dec 2014 22:34:59 +0000 (15:34 -0700)]
gpfs: Rename wrapper for gpfs_lib_init

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_ftruncate
Christof Schmitt [Wed, 10 Dec 2014 22:33:23 +0000 (15:33 -0700)]
gpfs: Rename wrapper for gpfs_ftruncate

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_prealloc
Christof Schmitt [Wed, 10 Dec 2014 22:31:42 +0000 (15:31 -0700)]
gpfs: Rename wrapper for gpfs_prealloc

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_get_winattrs
Christof Schmitt [Wed, 10 Dec 2014 22:29:19 +0000 (15:29 -0700)]
gpfs: Rename wrapper for gpfs_get_winattrs

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_get_winattrs_path
Christof Schmitt [Wed, 10 Dec 2014 22:27:05 +0000 (15:27 -0700)]
gpfs: Rename wrapper for gpfs_get_winattrs_path

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_set_winattrs_path
Christof Schmitt [Wed, 10 Dec 2014 22:22:27 +0000 (15:22 -0700)]
gpfs: Rename wrapper for gpfs_set_winattrs_path

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_get_realfilename_path
Christof Schmitt [Wed, 10 Dec 2014 22:15:53 +0000 (15:15 -0700)]
gpfs: Rename wrapper for gpfs_get_realfilename_path

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_putacl
Christof Schmitt [Wed, 10 Dec 2014 22:11:18 +0000 (15:11 -0700)]
gpfs: Rename wrapper for gpfs_putacl

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Rename wrapper for gpfs_getacl
Christof Schmitt [Wed, 10 Dec 2014 22:09:07 +0000 (15:09 -0700)]
gpfs: Rename wrapper for gpfs_getacl

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Introduce wrapper for gpfs_set_lease
Christof Schmitt [Wed, 10 Dec 2014 22:06:02 +0000 (15:06 -0700)]
gpfs: Introduce wrapper for gpfs_set_lease

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Introduce wrapper for gpfs_set_share
Christof Schmitt [Wed, 18 Feb 2015 21:22:55 +0000 (14:22 -0700)]
gpfs: Introduce wrapper for gpfs_set_share

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Simplify initialization for gpfs library wrapper
Christof Schmitt [Wed, 18 Feb 2015 17:14:22 +0000 (10:14 -0700)]
gpfs: Simplify initialization for gpfs library wrapper

Merge the code for initializing the function pointers in one function.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Remove search for libgpfs_gpl.so
Christof Schmitt [Wed, 18 Feb 2015 17:13:55 +0000 (10:13 -0700)]
gpfs: Remove search for libgpfs_gpl.so

Similar to the header files, libgpfs_gpl.so no longer exists. The
library is now always called libgpfs.so.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Look for gpfs header files also in /usr/lpp/mmfs/include/
Christof Schmitt [Wed, 18 Feb 2015 17:13:33 +0000 (10:13 -0700)]
gpfs: Look for gpfs header files also in /usr/lpp/mmfs/include/

That is the default directory for the gpfs header files.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agogpfs: Always use gpfs_fcntl.h headerfile
Christof Schmitt [Wed, 18 Feb 2015 17:12:43 +0000 (10:12 -0700)]
gpfs: Always use gpfs_fcntl.h headerfile

gpfs_gpl.h no longer exists, everything from that header file has been
merged to gpfs.h. gpfs_fcntl.h implicitly includes gpfs.h. Simplify the
code by only looking for gpfs_fcntl.h and including that file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agoselftest: re-enable nsswrapper integration testing for dc and member environments.
Michael Adam [Mon, 2 Feb 2015 15:16:45 +0000 (16:16 +0100)]
selftest: re-enable nsswrapper integration testing for dc and member environments.

There are some failures:

- The dc environment fails consistently due to duplicate uid,
  (for the calling user and the domain administrator).
  ==> Marked as knownfail.

- The s3member environment only fails under very strange
  circumstances:
  - one needs to run the unix.whoami test in the
    member and s3member environment for the local.nss
    test to fail in the s3member:local env. The failure
    is then related to builtin administrators sharing
    a gid with a different group.
    --> This is really really strange!!!
    ==> Marked as knownfail.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Mar  2 19:50:55 CET 2015 on sn-devel-104

9 years agos4-torture: cleanup nsswrapper test a little by removing nwrap references.
Günther Deschner [Sat, 7 Feb 2015 13:10:01 +0000 (14:10 +0100)]
s4-torture: cleanup nsswrapper test a little by removing nwrap references.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: re-add nss-wrapper torture testsuite.
Günther Deschner [Mon, 2 Feb 2015 13:50:30 +0000 (14:50 +0100)]
s4-torture: re-add nss-wrapper torture testsuite.

(The testsuite got removed with 5bb410f85312196bb24e62a6a0b8350576433dc6).

Although nss_wrapper now also has an upstream testsuite, it is still important
to run the older torture testsuite within Samba so we have some testing on
nss_winbind correctnes and consistency.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agodoc-xml: Add 'sharesec' reference to 'access based share enum'
Andreas Schneider [Mon, 2 Mar 2015 10:55:01 +0000 (11:55 +0100)]
doc-xml: Add 'sharesec' reference to 'access based share enum'

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Mar  2 14:33:33 CET 2015 on sn-devel-104

9 years agoselftest: shuffle msdfs-share DFS referral responses
David Disseldorp [Fri, 27 Feb 2015 14:52:47 +0000 (14:52 +0000)]
selftest: shuffle msdfs-share DFS referral responses

Add a secondary server path to the msdfs-src1 DFS link, and test "msdfs
shuffle referrals" behaviour during selftest using the existing
samba3.blackbox.smbclient_s3 suite.

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): Sat Feb 28 01:22:36 CET 2015 on sn-devel-104

9 years agoMSDFS referral shuffling
Robin McCorkell [Fri, 27 Feb 2015 14:52:46 +0000 (14:52 +0000)]
MSDFS referral shuffling

Shuffle MSDFS referral list in smbd in accordance with [MS-DFSC] 3.2.1.1
When parsing an MSDFS symlink, the names are shuffled with a Fisher-Yates
algorithm.

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agowinbind: Slightly simplify wb_sids2xids
Volker Lendecke [Fri, 23 Jan 2015 13:32:45 +0000 (13:32 +0000)]
winbind: Slightly simplify wb_sids2xids

We only needs "names" and "domains" wb_sids2xids_lookupsids_done. It confused
me when reading this code that these variables are stored in "state".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: Fix talloc hierarchy in init_lsa_ref_domain_list
Volker Lendecke [Fri, 27 Feb 2015 14:04:36 +0000 (14:04 +0000)]
lib: Fix talloc hierarchy in init_lsa_ref_domain_list

The sid is copied, so the name should also be copied.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib/util: Build iov_buf library only when building samba
Amitay Isaacs [Thu, 26 Feb 2015 00:09:09 +0000 (11:09 +1100)]
lib/util: Build iov_buf library only when building samba

lib/util can be built with SAMBA_UTIL_CORE_ONLY for building standalone
ctdb.  Any new libraries if not required by ctdb should be built only
when SAMBA_UTIL_CORE_ONLY is not specified.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Feb 27 09:06:01 CET 2015 on sn-devel-104

9 years agolibsmb: Make "ip_service_compare" static
Volker Lendecke [Wed, 25 Feb 2015 21:17:57 +0000 (21:17 +0000)]
libsmb: Make "ip_service_compare" static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 27 06:20:58 CET 2015 on sn-devel-104

9 years agotevent: version 0.9.23 tevent-0.9.23
Michael Adam [Thu, 26 Feb 2015 23:27:29 +0000 (00:27 +0100)]
tevent: version 0.9.23

* Add Solaris ports as tevent backend.
* Improvements to the tevent_data tutorial.
* Remove use of the 'staticforward' macro.

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): Fri Feb 27 03:48:57 CET 2015 on sn-devel-104