samba.git
9 years agos3:libads: avoid some compiler warnings in ldap.c
Stefan Metzmacher [Wed, 26 Feb 2014 19:16:26 +0000 (20:16 +0100)]
s3:libads: avoid some compiler warnings in ldap.c

We use helper variables and explicit casts using
discard_const_p() to avoid bogus const warnings.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:libsmb: remove unused variables in cliconnect.c
Stefan Metzmacher [Thu, 23 Oct 2014 08:17:40 +0000 (10:17 +0200)]
s3:libsmb: remove unused variables in cliconnect.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:lib/netapi/examples: fix pointer from integer error in nltest.c
Stefan Metzmacher [Wed, 26 Feb 2014 19:16:26 +0000 (20:16 +0100)]
s3:lib/netapi/examples: fix pointer from integer error in nltest.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:lib/netapi/tests: fix invalid switch enum level warning
Stefan Metzmacher [Wed, 26 Feb 2014 19:16:26 +0000 (20:16 +0100)]
s3:lib/netapi/tests: fix invalid switch enum level warning

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:lib: fix/simplify srprs_hex()
Stefan Metzmacher [Thu, 13 Nov 2014 07:50:35 +0000 (08:50 +0100)]
s3:lib: fix/simplify srprs_hex()

There're a few problems with this function.

- it pretends to support values up to UINT64_MAX
  in it only returns 'unsigned' which support only
  values up to UINT32_MAX. Currently we only have
  callers with len=2 and len=8, so it's not a triggered
  bug.

  We just allow (len >= 1 && len <= 8) now.

- The compiler is not able to inspect the format string
  to sscanf().

  We copy up to 8 bytes into a stack buffer
  and always pass "%8x" to sscanf.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()
Kamen Mazdrashki [Thu, 20 Nov 2014 03:07:47 +0000 (04:07 +0100)]
lib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()

Change-Id: I0d09374b27708fcaad3523d985a2db7983dbd81a
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 25 07:24:12 CET 2014 on sn-devel-104

9 years agolib-pyldb: Fix docstring for msg.add() method - it was "S.append()"
Kamen Mazdrashki [Thu, 20 Nov 2014 03:06:01 +0000 (04:06 +0100)]
lib-pyldb: Fix docstring for msg.add() method - it was "S.append()"

Change-Id: I9492d3c3993fc3d68d7bf24405db6e8cd746eaac
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-ldb-test: Test copying message element from a message to a new message
Kamen Mazdrashki [Tue, 25 Nov 2014 02:50:52 +0000 (03:50 +0100)]
lib-ldb-test: Test copying message element from a message to a new message

Change-Id: Iefcafb418a170ee410aec900bb36eb8e01e946b1
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-pyldb: Avoid crash when copying MessageElements between Python Message objects
Kamen Mazdrashki [Wed, 12 Nov 2014 00:17:56 +0000 (01:17 +0100)]
lib-pyldb: Avoid crash when copying MessageElements between Python Message objects

This patch allows for following snipets in Python:
  res = ldb.search(...)
  m_from = res[0]
  m_to = Message()
  m_to.add(m_from["attrName"])

The problem previously is that we are trying to reference a
ldb_message_element that may not be a memory context on its own.
For instance, when search request from above example returns
Messages with more than one attribute, this leads immediately
to "Bad talloc magic value" crash, every message element beside
the first one is not a memory context

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-ldb_ldif: Stop processing if ldb_message element name is NULL
Kamen Mazdrashki [Wed, 12 Nov 2014 00:12:31 +0000 (01:12 +0100)]
lib-ldb_ldif: Stop processing if ldb_message element name is NULL

I have hit this while using Python bindings for testing and
forgot to pass 'name' argument to MessageElement constructor
Passing NULL as 'name' is obviously a mistake and this commits
aims to warn about such unintetional mistakes.

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-ldb: Check for input parameter when searching attributes by name
Kamen Mazdrashki [Tue, 11 Nov 2014 01:56:32 +0000 (02:56 +0100)]
lib-ldb: Check for input parameter when searching attributes by name

This prevents a segfault that is hard to be tracked down from
Python bindings for instance.

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-pyldb: Throw exception when we can't create MessageElement object
Kamen Mazdrashki [Mon, 10 Nov 2014 21:59:07 +0000 (22:59 +0100)]
lib-pyldb: Throw exception when we can't create MessageElement object

At the moment we return an error, but no exception and it is
hard to instantly see what the problem is from Python

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-pyldb: Avoid leaking memory in error cases
Kamen Mazdrashki [Sun, 9 Nov 2014 03:31:36 +0000 (04:31 +0100)]
lib-pyldb: Avoid leaking memory in error cases

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String
Kamen Mazdrashki [Sun, 9 Nov 2014 03:28:47 +0000 (04:28 +0100)]
lib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3-smbstatus: Fix exit code of profile output.
Andreas Schneider [Mon, 24 Nov 2014 16:46:27 +0000 (17:46 +0100)]
s3-smbstatus: Fix exit code of profile output.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 24 21:13:51 CET 2014 on sn-devel-104

9 years agomessaging3: Fix sending large messages on FreeBSD
Volker Lendecke [Mon, 24 Nov 2014 15:31:07 +0000 (16:31 +0100)]
messaging3: Fix sending large messages on FreeBSD

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agounix_msg: Reformat unix_dgram_send a bit
Volker Lendecke [Mon, 24 Nov 2014 15:27:39 +0000 (16:27 +0100)]
unix_msg: Reformat unix_dgram_send a bit

This makes the next commit a bit more readable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3-smbclient: Return success if we listed the shares.
Andreas Schneider [Mon, 24 Nov 2014 15:26:13 +0000 (16:26 +0100)]
s3-smbclient: Return success if we listed the shares.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodsdb: Remove a self-assignment
Volker Lendecke [Mon, 24 Nov 2014 13:34:24 +0000 (14:34 +0100)]
dsdb: Remove a self-assignment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodbwrap: Fix a enum conversion
Volker Lendecke [Mon, 24 Nov 2014 13:52:42 +0000 (14:52 +0100)]
dbwrap: Fix a enum conversion

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 24 18:36:00 CET 2014 on sn-devel-104

9 years agoPrint number of slow tests from script rather than wscript.
Jelmer Vernooij [Sat, 1 Nov 2014 20:54:31 +0000 (13:54 -0700)]
Print number of slow tests from script rather than wscript.

Change-Id: I6eaa0803b95cc81f514a2176f4e06f1e3fff4077
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Mon Nov 24 13:06:46 CET 2014 on sn-devel-104

9 years agosam: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:00:09 +0000 (09:00 -0800)]
sam: Use samba.tests.subunitrun.

Change-Id: Ic2ac4b335cf805ddbd442a065c4eaf6ef2b210d9
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoUse samba.tests.subunitrun in dsdb ldap and ldap_schema tests.
Jelmer Vernooij [Sun, 2 Nov 2014 04:31:18 +0000 (21:31 -0700)]
Use samba.tests.subunitrun in dsdb ldap and ldap_schema tests.

Change-Id: I51ddc55720a23013a2c6ae20e3225f027348083c
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoUse samba.tests.subunitrun in urgent replication test.
Jelmer Vernooij [Sun, 2 Nov 2014 04:22:59 +0000 (21:22 -0700)]
Use samba.tests.subunitrun in urgent replication test.

Change-Id: I3e7a32876d557ac376326ab75e851298e874d584
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoInclude mimeparse, which is used by subunit/testtools.
Jelmer Vernooij [Sat, 1 Nov 2014 14:09:00 +0000 (07:09 -0700)]
Include mimeparse, which is used by subunit/testtools.

Change-Id: I984c82acc0bc82a165e8ea17d8948c465c786905
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sat Nov 22 04:44:11 CET 2014 on sn-devel-104

9 years agoldap: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:44:05 +0000 (09:44 -0800)]
ldap: Use samba.tests.subunitrun.

Change-Id: I872654afb31a5eda8c88aac716f9ce79816e5f05
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodeletetest: use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:39:17 +0000 (09:39 -0800)]
deletetest: use samba.tests.subunitrun.

Change-Id: I13565c7c14ea186709ce1de9038ef840c5b766b8
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoldap_syntaxes: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:32:58 +0000 (09:32 -0800)]
ldap_syntaxes: Use samba.tests.subunitrun.

Change-Id: Ib62b747876b4408fdc8ff44e9b4c63578e1a6408
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopassword lockout: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:30:50 +0000 (09:30 -0800)]
password lockout: Use samba.tests.subunitrun.

Change-Id: I848099d22acd4a0ce7d589de48eb72e2d180ceae
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agopasswords: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 17:13:06 +0000 (09:13 -0800)]
passwords: Use samba.tests.subunitrun.

Change-Id: Ib806f63ef412fec264445eefd82146e5140b0bac
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosec_descriptor: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:57:37 +0000 (08:57 -0800)]
sec_descriptor: Use samba.tests.subunitrun.

Change-Id: I5caba3e27ad21cc5381883a823e0ec5e2966a264
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agotoken_group: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:35:06 +0000 (08:35 -0800)]
token_group: Use samba.tests.subunitrun.

Change-Id: Id7c247451532eded1f44ef9b1aa1808dd18098c6
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosites: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:37:08 +0000 (08:37 -0800)]
sites: Use samba.tests.subunitrun.

Change-Id: Ic06e1a0f7174683b6b817a5412b8635145329c00
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agospeedtest: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:32:24 +0000 (08:32 -0800)]
speedtest: Use samba.tests.subunitrun.

Change-Id: Id842c3f74aec24faeab68e975ff4d9e9a0dc337b
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agocredentials test: Use samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 16:30:23 +0000 (08:30 -0800)]
credentials test: Use samba.tests.subunitrun.

Change-Id: I8970c66de9535cb8d48b17d88b2759b7d1e39cb8
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosec_descriptor test: Simplify, use samba.tests.subunitrun module.
Jelmer Vernooij [Sun, 2 Nov 2014 16:23:36 +0000 (08:23 -0800)]
sec_descriptor test: Simplify, use samba.tests.subunitrun module.

Change-Id: I4ffda49cf3e209eaa28fc83f6fd9ded47f0ad7ee
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoMove option handling into samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 04:17:39 +0000 (21:17 -0700)]
Move option handling into samba.tests.subunitrun.

Change-Id: I65a73b74854af636413f4f284147f3bcf28b6f82
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoMove option parsing to samba.tests.subunitrun.
Jelmer Vernooij [Sun, 2 Nov 2014 04:08:49 +0000 (21:08 -0700)]
Move option parsing to samba.tests.subunitrun.

Change-Id: I2939c1b6ebb9739530efa9bc4667668cff7a7aeb
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosubunitrun: Use new samba.tests.subunitrun module.
Jelmer Vernooij [Sun, 2 Nov 2014 03:57:09 +0000 (20:57 -0700)]
subunitrun: Use new samba.tests.subunitrun module.

Change-Id: Ie32f16d72c80c831adfd9a8d32735fa348962123
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoAdd convenience class for old-style Samba subunit python tests.
Jelmer Vernooij [Sun, 2 Nov 2014 03:51:46 +0000 (20:51 -0700)]
Add convenience class for old-style Samba subunit python tests.

Change-Id: I84a97cc71cfa99c14e0c93ec19ff9eea6149bb5a
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoAdd bundled copy of 'extras' python module used by newer versions of testtools/subunit.
Jelmer Vernooij [Sat, 25 Oct 2014 18:09:10 +0000 (11:09 -0700)]
Add bundled copy of 'extras' python module used by newer versions of testtools/subunit.

Change-Id: I5ad9222ccb4228a4b16d54a578276d4b9d4e6c4d
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoClean up more whitespace.
Guy Harris [Fri, 21 Nov 2014 15:52:32 +0000 (15:52 +0000)]
Clean up more whitespace.

Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Kamen Mazdrashki <kamenim@samba.org>
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
9 years agovfs_streams_xattr: check stream type
Ralph Boehme [Fri, 21 Nov 2014 13:56:08 +0000 (14:56 +0100)]
vfs_streams_xattr: check stream type

Only allow access to the stream type "$DATA". vfs_streams_depot does
this too and it fixes the failing test "smb2.streams.names".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 22 01:07:54 CET 2014 on sn-devel-104

9 years agovfs_streams_xattr: initialize pointer
Ralph Boehme [Fri, 21 Nov 2014 13:54:17 +0000 (14:54 +0100)]
vfs_streams_xattr: initialize pointer

Intitialize pointer to NULL, otherwise we talloc_free() an unitialized
pointer in the error code path.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agovfs_streams_xattr: fix check with samba_private_attr_name()
Ralph Boehme [Thu, 20 Nov 2014 15:33:22 +0000 (16:33 +0100)]
vfs_streams_xattr: fix check with samba_private_attr_name()

We want to check with samba_private_attr_name() whether the xattr name
is a private one, unfortunately it flags xattrs that begin with the
default streams prefix as private.  By only calling
samba_private_attr_name() in case the xattr does NOT begin with the
default prefix, we know that if it returns 'true' it definitely one of
our internal xattr like "user.DOSATTRIB".

This fixes a bug introduced in 634bcb09a08b927fd79ae0e16aeee2a123605f94
that denied all access to valid stream xattrs.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4-dns: dlz-bind: Add trailing '.' to all fqdn strings
Amitay Isaacs [Mon, 3 Nov 2014 00:57:50 +0000 (11:57 +1100)]
s4-dns: dlz-bind: Add trailing '.' to all fqdn strings

BIND 9.10.x is strict when sending records via putrr and putnamedrr.

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

Thanks to Guenter Kukkukk for identifying the problem and resolution.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Guenter Kukkukk <kukks@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Nov 21 06:14:55 CET 2014 on sn-devel-104

9 years agos3:libsmb: fix some function header comments.
Michael Adam [Thu, 20 Nov 2014 11:59:15 +0000 (12:59 +0100)]
s3:libsmb: fix some function header comments.

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): Thu Nov 20 18:45:28 CET 2014 on sn-devel-104

9 years agolib/ldb-samba: add ldif handler for msDS-TrustForestTrustInfo
Stefan Metzmacher [Wed, 19 Nov 2014 11:24:47 +0000 (12:24 +0100)]
lib/ldb-samba: add ldif handler for msDS-TrustForestTrustInfo

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotdb_wrap: Make mutexes easier to use
Volker Lendecke [Tue, 30 Sep 2014 11:04:21 +0000 (11:04 +0000)]
tdb_wrap: Make mutexes easier to use

This patch makes sure we work fine and open without mutexes if they
are not supported.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs.
Stefan Metzmacher [Tue, 4 Nov 2014 08:51:51 +0000 (09:51 +0100)]
tdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3:smbprofile: profile async pread/pwrite/fsync syscalls
Stefan Metzmacher [Sat, 15 Nov 2014 22:58:15 +0000 (23:58 +0100)]
s3:smbprofile: profile async pread/pwrite/fsync syscalls

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 19 23:13:10 CET 2014 on sn-devel-104

9 years agos3:smbprofile: track connect_count and disconnect_count
Stefan Metzmacher [Fri, 14 Nov 2014 11:47:01 +0000 (12:47 +0100)]
s3:smbprofile: track connect_count and disconnect_count

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: remove unused {START,END}_PROFILE_STAMP()
Stefan Metzmacher [Mon, 17 Nov 2014 19:05:09 +0000 (20:05 +0100)]
s3:smbprofile: remove unused {START,END}_PROFILE_STAMP()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: report idle state of 'idle_count' and 'idle_time'
Stefan Metzmacher [Mon, 17 Nov 2014 11:58:25 +0000 (12:58 +0100)]
s3:smbprofile: report idle state of 'idle_count' and 'idle_time'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: improve profiling for the security context switching.
Stefan Metzmacher [Mon, 17 Nov 2014 11:52:35 +0000 (12:52 +0100)]
s3:smbprofile: improve profiling for the security context switching.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'
Stefan Metzmacher [Fri, 14 Nov 2014 11:42:51 +0000 (12:42 +0100)]
s3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smb2_server: use async smbprofile macros
Stefan Metzmacher [Fri, 31 Oct 2014 10:15:50 +0000 (11:15 +0100)]
s3:smb2_server: use async smbprofile macros

This improves profiling and corrently counts the total and idle time for async
requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: rewrite the internal macros
Stefan Metzmacher [Thu, 23 Oct 2014 16:06:15 +0000 (18:06 +0200)]
s3:smbprofile: rewrite the internal macros

We now autogenerate a lot of code using
SMBPROFILE_STATS_ALL_SECTIONS macro which expands to
different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros.

This also allows async profiling using:

   struct mystate {
       ...

       SMBPROFILE_BASIC_ASYNC_STATE(profile_state);
       ...
   };

   ...

   SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate->profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate->profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate->profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate->profile_state);

The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:smbd: Use "smbd profiling level"
Volker Lendecke [Fri, 10 Oct 2014 11:38:27 +0000 (13:38 +0200)]
s3:smbd: Use "smbd profiling level"

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoparam: add "smbd profiling level" option
Volker Lendecke [Thu, 9 Oct 2014 12:56:28 +0000 (12:56 +0000)]
param: add "smbd profiling level" option

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: Make "status_profile.h" a proper header
Volker Lendecke [Fri, 10 Oct 2014 12:18:50 +0000 (14:18 +0200)]
s3:smbprofile: Make "status_profile.h" a proper header

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: Make smbprofile.h includable on its own
Volker Lendecke [Thu, 9 Oct 2014 12:41:03 +0000 (12:41 +0000)]
s3:smbprofile: Make smbprofile.h includable on its own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbd: improve writecache profiling
Stefan Metzmacher [Wed, 5 Nov 2014 14:54:02 +0000 (15:54 +0100)]
s3:smbd: improve writecache profiling

In order to have useful profiling counters should never be decremented.
We need a separate counter for deallocation events.

The current value can be calculated by allocations - deallocations.

We also use better names and avoid having an array for the flush reasons.
This will simplify further profiling improvements a lot.

The value writecache_num_write_caches (this was similar to writecache_allocations)
is replaced by writecache_cached_writes, which counts the amount of writes which
were completely handled by the cache.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:wscript_build: remove unused to dependency from 'smbtree' to 'PROFILE'
Stefan Metzmacher [Fri, 7 Nov 2014 14:18:44 +0000 (15:18 +0100)]
s3:wscript_build: remove unused to dependency from 'smbtree' to 'PROFILE'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: remove unused nmbd related counters
Stefan Metzmacher [Wed, 5 Nov 2014 12:13:35 +0000 (13:13 +0100)]
s3:smbprofile: remove unused nmbd related counters

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:nmbd: remove START/END_PROFILE() calls
Stefan Metzmacher [Wed, 5 Nov 2014 12:10:49 +0000 (13:10 +0100)]
s3:nmbd: remove START/END_PROFILE() calls

nmbd never calls profile_setup() and never collects any profiling data.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:modules: make use of END_PROFILE_BYTES() when START_PROFILE_BYTES() was used
Stefan Metzmacher [Thu, 23 Oct 2014 16:31:09 +0000 (18:31 +0200)]
s3:modules: make use of END_PROFILE_BYTES() when START_PROFILE_BYTES() was used

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbprofile: add END_PROFILE_BYTES() marco
Stefan Metzmacher [Thu, 23 Oct 2014 16:30:41 +0000 (18:30 +0200)]
s3:smbprofile: add END_PROFILE_BYTES() marco

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agofilter-subunit: Consistently use spaces rather than tabs.
Jelmer Vernooij [Sun, 26 Oct 2014 18:31:38 +0000 (11:31 -0700)]
filter-subunit: Consistently use spaces rather than tabs.

Change-Id: I760399cb4bf0aa9753f5f1e842919b386e1caca9
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Wed Nov 19 20:50:29 CET 2014 on sn-devel-104

9 years agoSupport using system ldbmodify.
Jelmer Vernooij [Sat, 1 Nov 2014 17:17:23 +0000 (10:17 -0700)]
Support using system ldbmodify.

Fixes this test when bin/ldbmodify isn't built because we're using the
system ldbmodify.

Change-Id: I2ff0d9808245353006c6be4989976a3edad8f98e
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoFix subunit test suite name.
Jelmer Vernooij [Sat, 1 Nov 2014 22:57:35 +0000 (15:57 -0700)]
Fix subunit test suite name.

Only run it when testscenarios is installed, as it depends on that.

Change-Id: I1e1284024cf94f909e585a55b8a15e33273f167b
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodsdb.tests.acl: Create and run a single testsuite, should easy migration to regulary...
Jelmer Vernooij [Sun, 2 Nov 2014 03:06:52 +0000 (20:06 -0700)]
dsdb.tests.acl: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: I89072d3af1d90e87a47c197d28943f47cedc5deb
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodsdb.tests.ldap: Create and run a single testsuite, should easy migration to regulary...
Jelmer Vernooij [Sun, 2 Nov 2014 03:07:02 +0000 (20:07 -0700)]
dsdb.tests.ldap: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: I07216ff1063e127b541bf4e5d6349d5a75cec678
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agospeedtest: Create and run a single testsuite, should easy migration to regulary Pytho...
Jelmer Vernooij [Sun, 2 Nov 2014 03:09:12 +0000 (20:09 -0700)]
speedtest: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: Ib31eb26b8f6094a51cd4985b9ae98d018ae95c2d
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodirsync test: Create and run a single testsuite, should easy migration to regulary...
Jelmer Vernooij [Sun, 2 Nov 2014 03:27:30 +0000 (20:27 -0700)]
dirsync test: Create and run a single testsuite, should easy migration to regulary Python unit tests.

Change-Id: I6fbffd6453f8af966938943f2895bd6d93f8fb59
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoAdd 'make randomized-test' rule.
Jelmer Vernooij [Sun, 16 Nov 2014 15:44:33 +0000 (15:44 +0000)]
Add 'make randomized-test' rule.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
9 years agoRemove tabs in python file, unnecessary 'pass'.
Jelmer Vernooij [Sun, 16 Nov 2014 14:43:29 +0000 (14:43 +0000)]
Remove tabs in python file, unnecessary 'pass'.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
9 years agopidl: White space cleanups in Conformance.pm and NDR.pm
Guy Harris [Sat, 1 Nov 2014 15:50:43 +0000 (08:50 -0700)]
pidl: White space cleanups in Conformance.pm and NDR.pm

Change-Id: Ibf106d023c50a7f3caf8f416e9927ac4a040f2c0
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10842
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Wed Nov 19 05:06:33 CET 2014 on sn-devel-104

9 years agoRewrite show_test_time in python and support --limit argument.
Jelmer Vernooij [Sat, 1 Nov 2014 21:33:37 +0000 (14:33 -0700)]
Rewrite show_test_time in python and support --limit argument.

Change-Id: I6c3f28ed52cc8597251aa195ec3c7e38587c2573
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoformat-subunit: Remove remaining tabs.
Jelmer Vernooij [Sat, 1 Nov 2014 15:38:31 +0000 (08:38 -0700)]
format-subunit: Remove remaining tabs.

Change-Id: I70eabda60e3d4eede874eb5e95bf455eddfb0992
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoRemove unused imports.
Jelmer Vernooij [Sat, 1 Nov 2014 13:56:09 +0000 (06:56 -0700)]
Remove unused imports.

Change-Id: I8915f62206edb53ffc2d89434e46d9e71db8bb9a
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoDisplay total number of tests in format-subunit, not just number of test suites.
Jelmer Vernooij [Sat, 1 Nov 2014 19:51:31 +0000 (12:51 -0700)]
Display total number of tests in format-subunit, not just number of test suites.

Change-Id: Iae17df773f380b13d2b3f69e83593139c01c4a6d
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agolib: Add proper {} to tcopy_passwd
Volker Lendecke [Tue, 18 Nov 2014 09:37:15 +0000 (10:37 +0100)]
lib: Add proper {} to tcopy_passwd

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): Tue Nov 18 21:45:40 CET 2014 on sn-devel-104

9 years agolib: Use talloc_pooled_object in tcopy_passwd
Volker Lendecke [Tue, 18 Nov 2014 09:36:50 +0000 (10:36 +0100)]
lib: Use talloc_pooled_object in tcopy_passwd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoctdb-scripts: Fix stack dumping when debugging hung scripts
Martin Schwenke [Mon, 17 Nov 2014 03:15:14 +0000 (14:15 +1100)]
ctdb-scripts: Fix stack dumping when debugging hung scripts

There are parentheses missing that stop the default pattern from
matching commands with trailing garbage (e.g. "exportfs.orig").

A careful check of POSIX (and running GNU sed with --posix) suggests
that "\|" isn't a supported way of specifying alternation in a regular
expression.  Therefore, it is clearer to switch to extended regular
expressions so that this has a chance of being portable (even though
the point is to print /proc/<pid>/stack, which only works on Linux).

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 Nov 18 06:37:45 CET 2014 on sn-devel-104

9 years agoctdb-scripts: Try to restart statd after every 10 failures
Martin Schwenke [Fri, 14 Nov 2014 05:42:01 +0000 (16:42 +1100)]
ctdb-scripts: Try to restart statd after every 10 failures

Also add and update tests for statd stack dumps.  Update the existing
60.ganesha statd test to do more iterations.  Duplicate the result as
a new test for 60.nfs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Add rpc.statd stack dumping to Ganesha restart
Martin Schwenke [Fri, 14 Nov 2014 05:39:07 +0000 (16:39 +1100)]
ctdb-scripts: Add rpc.statd stack dumping to Ganesha restart

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Dump stack traces for hung mountd, rquotad, statd processes
Martin Schwenke [Fri, 14 Nov 2014 02:59:16 +0000 (13:59 +1100)]
ctdb-scripts: Dump stack traces for hung mountd, rquotad, statd processes

Add a corresponding new unit test for statd.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Add optional program name argument to nfs_dump_some_threads()
Martin Schwenke [Fri, 14 Nov 2014 02:48:16 +0000 (13:48 +1100)]
ctdb-scripts: Add optional program name argument to nfs_dump_some_threads()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Factor out new function program_stack_traces()
Martin Schwenke [Fri, 14 Nov 2014 02:31:03 +0000 (13:31 +1100)]
ctdb-scripts: Factor out new function program_stack_traces()

In the process, fix a bug where an extra trace would be printed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agos4:dns_server: allocate substructures of struct dns_request_state on the correct...
Stefan Metzmacher [Tue, 14 Oct 2014 07:34:29 +0000 (09:34 +0200)]
s4:dns_server: allocate substructures of struct dns_request_state on the correct TALLOC_CTX

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agos4:dns_server: add some const to dns_server_process_update/dns_update_allowed arguments
Stefan Metzmacher [Tue, 14 Oct 2014 07:30:43 +0000 (09:30 +0200)]
s4:dns_server: add some const to dns_server_process_update/dns_update_allowed arguments

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agosamba: pass down size_t instead of int to add_string_to_array().
Günther Deschner [Fri, 14 Nov 2014 13:12:26 +0000 (14:12 +0100)]
samba: pass down size_t instead of int to add_string_to_array().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Nov 17 19:53:22 CET 2014 on sn-devel-104

9 years agolib/util: use size_t for add_string_to_array().
Günther Deschner [Fri, 14 Nov 2014 12:27:45 +0000 (13:27 +0100)]
lib/util: use size_t for add_string_to_array().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agos3-proto: remove duplicate proto for add_string_to_array().
Günther Deschner [Fri, 14 Nov 2014 12:47:16 +0000 (13:47 +0100)]
s3-proto: remove duplicate proto for add_string_to_array().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agodbwrap_ctdb: Pass on mutex flags to tdb_open
Volker Lendecke [Thu, 6 Nov 2014 10:59:34 +0000 (11:59 +0100)]
dbwrap_ctdb: Pass on mutex flags to tdb_open

Without this, ctdb can create a tdb file with mutex activated, but the
local tdb_open will not open the tdb due to strict flags checks whether
mutexes are possible.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Nov 16 12:13:54 CET 2014 on sn-devel-104

9 years agos3:lib: fix const warnings in popt_common.c
Stefan Metzmacher [Wed, 26 Feb 2014 19:16:26 +0000 (20:16 +0100)]
s3:lib: fix const warnings in popt_common.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 15 01:46:13 CET 2014 on sn-devel-104

9 years agos3:auth: add some const to user_in_list()
Stefan Metzmacher [Wed, 26 Feb 2014 19:16:26 +0000 (20:16 +0100)]
s3:auth: add some const to user_in_list()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:auth: add missing auth_samba4_init() prototype
Stefan Metzmacher [Wed, 26 Feb 2014 19:16:26 +0000 (20:16 +0100)]
s3:auth: add missing auth_samba4_init() prototype

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonsswitch: avoid some compiler warnings
Stefan Metzmacher [Thu, 27 Feb 2014 08:38:39 +0000 (09:38 +0100)]
nsswitch: avoid some compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>