1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

96067 Commits

Author SHA1 Message Date
Martin Schwenke
a0a21af918 ctdb-build: Add some missing configure checks
Fail configure if thread_setsched() is unavailable on AIX or if
sched_setscheduler() is unavailable on other platforms.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-17 07:29:10 +02:00
Amitay Isaacs
d692be0363 ctdb-build: Improve platform check
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-17 07:29:10 +02:00
Martin Schwenke
fb9c49f2ce ctdb-util: Log an error if there is no way to set scheduler
Although configure should catch this, logging a run-time error is
better than being mystified when ctdbd silently exits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-17 07:29:10 +02:00
Volker Lendecke
6ce6262014 lib: Make nt_err_code_struct private
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 Sep 17 02:56:54 CEST 2014 on sn-devel-104
2014-09-17 02:56:54 +02:00
Volker Lendecke
b3cc5e204d replace: Make EWOULDBLOCK always available
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-17 00:31:21 +02:00
Volker Lendecke
4b788ffe65 lib: Avoid a talloc in write_data_iov
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-17 00:31:21 +02:00
Volker Lendecke
4be583493a lib: Remove unused file_lines_slashcont
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-17 00:31:21 +02:00
Volker Lendecke
e8996582c6 lib: Move "large_file_support()" to the source4 smb server
That's the only place where it's used, make it static there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-17 00:31:21 +02:00
Michael Adam
1f7da1ca7f tdb: change version to 1.3.1
* internal code cleanup
* improved free record detection with a highly contended freelist
  on tdb's with dead record support (TDB_VOLATILE).
* implicit defragmentation of the free list.

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 Sep 16 12:13:31 CEST 2014 on sn-devel-104
2014-09-16 12:13:31 +02:00
Stefan Metzmacher
5355f5e4e0 tdb:tools: fix a compiler warning
../../tdb/tools/tdbtool.c: In function ‘do_command’:
   ../../tdb/tools/tdbtool.c:717: error: declaration of ‘count’ shadows a global declaration
   ../../tdb/tools/tdbtool.c:597: error: shadowed declaration is here

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-16 09:47:05 +02:00
Jeremy Allison
df800ea6fb Add test suite for iconv conversion fail of bad names over SMB1/SMB3.
Bug 10775 - smbd crashes when accessing garbage filenames

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

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 Sep 16 04:21:49 CEST 2014 on sn-devel-104
2014-09-16 04:21:49 +02:00
Jeremy Allison
6d03aed15e s3: smbd: Fix a couple of tricky slow-path cases - don't return a mangled name for a name that cannot be converted.
For a name that contains an illegal Windows character, the
directory listing code returns the mangled 8.3 name as the
primary name for the file.

If the original (non-mangled) filename cannot be converted
to UCS2 on the wire via iconv due to conversion error, we
should skip that name when returning a directory listing,
as we can't map back from a returned 8.3 name to a usable
non-mangled filename if the client sends it back to us.

As this is only done in a very slow path (name must be mangled)
or in the old DOS protocol listing code I don't feel too bad
about using a talloc/free pair here.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
2fc8d0e0e8 s3: smbd: Change get_lanman2_dir_entry() to return the full NTSTATUS.
Handle the errors correctly at the level above inside the SMB1 server.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
c9877eaf1b s3: smbd: Remove unneeded 'out_of_space' parameter from smbd_dirptr_lanman2_entry().
This can now be handled by checking for the STATUS_MORE_ENTRIES error return.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
5293dd2f63 s3: smbd: SMB2 - change smbd_dirptr_lanman2_entry() to return an NTSTATUS.
Handle the errors correctly at the top level inside the SMB2 server.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
d17fc79ee6 s3: smbd: smbd_marshall_dir_entry() no longer needs explicit 'out_of_space' parameter.
Handle this in the caller when it returns STATUS_MORE_ENTRIES.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
2bddcee5cb s3: smbd: Change smbd_marshall_dir_entry() to return an NTSTATUS. Returns STATUS_MORE_ENTRIES on out of space.
Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
0519088c53 s3: smbd: Change the function signature of srvstr_push() from returning a length to returning an NTSTATUS with a length param.
srvstr_push_fn() now returns an NTSTATUS reporting any
string conversion failure.

We need to get serious about returning character set conversion errors
inside smbd.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
c7b89bb9e5 s3: smbd: Ensure types for all variables called 'len' used in srvstr_push() are correct.
Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
5c7e272190 s3: smbd: srvstr_push() was changed to never return -1, so don't check for that as an error.
Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
6bce3d81e1 s3: utils: Don't directly manipulate errno inside strupper_m().
Let the internal character conversion routines set it.

Caller code paths don't depend on this (checked by
David Disseldorp ddiss@suse.de).

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Volker Lendecke
c56a88da6e vfs_gpfs: Fix the build with profiling-data
This fails with -Werror=declaration-after-statement

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 Sep 16 01:55:57 CEST 2014 on sn-devel-104
2014-09-16 01:55:57 +02:00
Jeremy Allison
92da0b243c s3: winbindd: Old NT Domain code sets struct winbind_domain->alt_name to be NULL. Ensure this is safe with modern AD-DCs.
There are places in the code where we're not checking that alt_name is NULL
and then calling into the DC lookup code with a NULL name request. This can
happen in offline mode.

Fixes bug #10717 - Winbind crash on losing VPN connection

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Sep 15 23:29:00 CEST 2014 on sn-devel-104
2014-09-15 23:29:00 +02:00
Volker Lendecke
7bc2e2d0d4 messaging_dgm: Don't expose the messaging_dgm_context
Right now we can only support one messaging_dgm_context per process
anyway, the code has checks for this. I would like to keep it that
way, in the future we will have multiple messaging_context's or
imessaging_context's filtering based upon the dst server_id.

Why this change? messaging_dgm's lockfile contains the
serverid->unique_id. When designing messaging_dgm, I had in mind to
remove the serverid.tdb and replace it with the dgm lockfiles for server
lookup and enumeration. I have a WIP-patchset that gets rid of almost
all users of serverid.tdb. The problem is serverid_exists. Here we don't
have a messaging_context available, and it would be pretty intrusive
to make it so. This problem has plagued us since ctdb was developed,
see for example the comment

/*
 * This is a Samba3 hack/optimization. Routines like process_exists need to
 * talk to ctdbd, and they don't get handed a messaging context.
 */

in messaging_ctdb.c. This patchset removes this problem in a radical way:
Treat the messaging_dgm context as one globally available structure and
be done with it. The ctdb socket could go the same way in the future.

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 Sep 14 16:29:30 CEST 2014 on sn-devel-104
2014-09-14 16:29:30 +02:00
Volker Lendecke
9269a8e5d4 messaging_dgm: Avoid a talloc
Not really required, but it removes a NULL check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
Volker Lendecke
55a894c71d messaging_dgm: Avoid a talloc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
Volker Lendecke
c95d9a55d1 messaging_dgm: messaging_dgm_lockfile_remove does not use tmp_ctx anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
Volker Lendecke
9c5b1eeaf6 messaging_dgm: messaging_dgm_lockfile_create does not use tmp_ctx anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
Volker Lendecke
c3f98b9789 messaging_dgm: Avoid talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
Volker Lendecke
2858c666b5 messaging_dgm: Reformatting
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
Volker Lendecke
188120b08c messaging_dgm: Remove an unnecessary cast
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-14 14:04:06 +02:00
David Disseldorp
0cd4561ab1 namecache: fix uninitialised pointer returns
asprintf_strupper_m() doesn't set *strp on error.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep 13 03:21:39 CEST 2014 on sn-devel-104
2014-09-13 03:21:39 +02:00
Björn Jacke
27b2ddcdde docs: mention incompatibility between kernel oplocks and streams_xattr
See BUG https://bugzilla.samba.org/show_bug.cgi?id=7537 for details.

Signed-off-by: Bjoern Jacke <bj@sernet.de>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Sep 12 18:29:37 CEST 2014 on sn-devel-104
2014-09-12 18:29:37 +02:00
Volker Lendecke
bc5a75a83c ntvfs: Skip the new smb2.oplock.batch26 test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 12 14:39:00 CEST 2014 on sn-devel-104
2014-09-12 14:39:00 +02:00
Hemanth Thummala
6a795c0a84 Adding new oplock test 'batch26'.
Signed-off-by: Hemanth Thummala <hemanth.thummala@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-12 12:16:10 +02:00
Volker Lendecke
c6e726f719 s3: smbd: streams - Ensure share mode validation ignores internal opens (op_mid == 0).
Fixes bug 10797 - smbd panic at find_oplock_types

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-12 12:16:10 +02:00
Amitay Isaacs
d744eb03c5 ctdb-doc: Add reference to new magepage ctdb-statistics
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): Fri Sep 12 11:13:56 CEST 2014 on sn-devel-104
2014-09-12 11:13:56 +02:00
Amitay Isaacs
efd34bb274 ctdb-doc: Add ctdb-statistics manual page
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-12 08:46:15 +02:00
Amitay Isaacs
f5f11e1a05 ctdb-daemon: Decrement pending calls statistics when calls are deferred
Deferred calls should not be treated as pending calls since they are
re-processed from the beginning.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-12 08:46:14 +02:00
Amitay Isaacs
3c1bae1221 ctdb-tests: Do not expect real-time priority when running local daemons
Local daemons are started mainly for testing and usually not as root.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-12 08:46:14 +02:00
Amitay Isaacs
d410b20601 ctdb-daemon: Make sure ctdb runs with real-time priority
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-12 08:46:14 +02:00
Martin Schwenke
7ae7a9c463 ctdb-locking: Fork lock helper with vfork_with_logging()
Otherwise errors printed by the lock helper get lost.

lock_helper_args() no longer adds the program name to the list of
arguments, since vfork_with_logging() does that.  Update the lock
helper to handle the extra log_fd parameter passed by
vfork_with_logging() and send stdout/stderr there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-12 08:46:14 +02:00
Martin Schwenke
2e17b0ecdd ctdb-locking: Add argc parameter to lock_helper_args()
To make this sane, also add an argv parameter and change the return
type to bool.  Anticipating a subsequent change, make the type of argv
match what is needed by vfork_with_logging() and cast it when passing
to execv().  This also means changing the type of the name member of
struct db_namelist.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-12 08:46:14 +02:00
Volker Lendecke
8c1b1435fe media_harmony: Fix a crash bug
Now that the dust has settled, fix a crash bug that was hidden behind
the warnings...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep 12 02:45:40 CEST 2014 on sn-devel-104
2014-09-12 02:45:40 +02:00
Volker Lendecke
4038eb8968 media_harmony: Fix warnings
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-12 00:17:21 +02:00
Jeremy Allison
518247bf80 s3: smbd - open logic fix.
As we atomically create using O_CREAT|O_EXCL,
then if new_file_created is true, then
file_existed *MUST* have been false (even
if the file was previously detected as being
there.

We use the variable file_existed again in logic
below this statement, so we must set file_existed = false,
if new_file_created returns are true from open_file().

Based on a fix from Michael Adam.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Sep 11 22:29:22 CEST 2014 on sn-devel-104
2014-09-11 22:29:22 +02:00
Amitay Isaacs
4e5a6b154e ctdb-locking: Set real-time priority for lock helpers
To avoid lock helper starvation when userspace robust mutexes are
enabled.

Commit 6f072f85a1 removed reset_scheduler(),
to avoid resetting scheduler priority.  However, that is not sufficient
because of commit 1be8564e55, which sets
SCHED_RESET_ON_FORK flag.  With SCHED_RESET_ON_FORK, all CTDB child
processes will automatically have normal scheduling priority.

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 Sep 11 11:31:10 CEST 2014 on sn-devel-104
2014-09-11 11:31:10 +02:00
Amitay Isaacs
e6127a9ece ctdb-daemon: Increment pending calls statistics correctly
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-11 09:04:11 +02:00
Andrew Bartlett
01d4c0e804 torture: Provide enough space for test EA name in raw.eas test
The issue is that previously bad_ea_name[5] was the last element on
the array, and so when we later did a strlen() on it, we read past the
end of the stack array.  We need bad_ea_name[5] to be the second-last
element, followed by the \0 placed there by the strlcpy().

Found by AddressSanitizer

Change-Id: I871c08200aa2591c612dfa44da92b83132f83d88
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Sep 11 08:50:16 CEST 2014 on sn-devel-104
2014-09-11 08:50:16 +02:00
Martin Schwenke
1c00533bc0 ctdb-build: Remove unnecessary lib/util include path from tests
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): Thu Sep 11 06:22:33 CEST 2014 on sn-devel-104
2014-09-11 06:22:33 +02:00