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

92677 Commits

Author SHA1 Message Date
Stefan Metzmacher
b8fdeb8ca7 libcli/auth: reject computer_name longer than 15 chars
This matches Windows, it seems they use a fixed size field to store
netlogon_creds_CredentialState.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-22 17:12:14 +01:00
Stefan Metzmacher
387ed2e15d libcli/auth: don't alter the computer_name in cluster mode.
This breaks NTLMv2 authentication.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-22 17:12:05 +01:00
Stefan Metzmacher
8cf4eff201 s3:rpc_client: use db_open() to open "netlogon_creds_cli.tdb"
This uses dbwrap_ctdb if running in a cluster.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-22 17:11:54 +01:00
Stefan Metzmacher
ece3ba10a1 libcli/auth: add netlogon_creds_cli_set_global_db()
This can be used to inject a db_context from dbwrap_ctdb.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-22 17:11:19 +01:00
Volker Lendecke
c427b29be9 messaging3: Remove unused messaging_tdb_event
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jan 21 10:07:21 CET 2014 on sn-devel-104
2014-01-21 10:07:21 +01:00
Volker Lendecke
9801072ce2 messaging3: remove msg_channel
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-01-21 08:11:08 +01:00
Volker Lendecke
2779e78078 smbd: Use messaging_read_send in smbXsrv_session.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-01-21 08:11:05 +01:00
Volker Lendecke
017609767f dbwrap_watch: Use messaging_read_send/recv
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-01-21 08:11:01 +01:00
Volker Lendecke
5f3ccfc16b messaging3: Add messaging_read_send/recv
This is made to replace the msg_channel abstraction.

msg_channel was created to not miss any messages. For this, some
complex queueing was installed. This complexity has caused quite a
few problems in the past (see bug 10284 for example).

messaging_read_send/recv is able to achieve the same goal with a
lot less complexity. The messaging_read_send atomically installs
the reader into the messaging_context, we will not miss any messages
while this installed. messaging_send_recv will deinstall that
listener, but in the callback function you can directly call
messaging_read_send again without going through the tevent_loop_once.
As long as this is always made sure, no messages will be lost.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-01-21 08:10:41 +01:00
Amitay Isaacs
eee450fec2 ctdb-daemon: Simplify listing event scripts using scandir
Instead of using RB tree for sorting the script names (incorrectly since
it's only using the leading numbers in the script name), use scandir
with alphasort.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jan 21 06:41:25 CET 2014 on sn-devel-104
2014-01-21 06:41:25 +01:00
Amitay Isaacs
cbffbb7c2f ctdb-daemon: Do not run monitor event if any other event is already running
Any currently running monitor events are cancelled if any other events
are scheduled.  However, this does not stop monitor events to be run
when other events are already running.

Keep track of the number of active events and schedule monitor event
only if there are no active events.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-01-21 11:30:41 +11:00
Andrew Bartlett
e758f41113 kdc: Add belts-and-braces check that we fail if the hdb version changes
This checks both if host system run-time Heimdal has changed version,
and that the build-time version is supported.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jan 20 22:26:49 CET 2014 on sn-devel-104
2014-01-20 22:26:49 +01:00
Jeffrey Clark
368208069e Support for Heimdal's unified krb5 and hdb plugin system.
Fixes exportkeytab and a kdc crash when building against heimdal master.

Bug-Debian: http://bugs.debian.org/732342

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2014-01-21 08:30:36 +13:00
David Disseldorp
1db4d383c1 s3-winbind: separate child response sock write
For consistency with request read side.

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan 20 14:23:10 CET 2014 on sn-devel-104
2014-01-20 14:23:09 +01:00
David Disseldorp
8f3cf00c20 s3-winbind: only pass needed args to child_read_request
The socket and request are the only arguments required, the entire
winbind child state structure is not needed.
This allows for the separation of the request and response structures,
which is useful for asynchronous conversion.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-20 12:29:13 +01:00
Shekhar Amlekar
dad72a3b7a s3: rpc_server/srvsvc: Avoiding the loop around locking tdb traversal.
The current code for determining the number of open files iterates
over the session list and for each session it traverses the locking
tdb to get the open files. This scales badly for a large server
with many sessions and open files. Instead, get the list of
sessions first, and then determine the number of open files on all
sessions in a single traversal of locking tdb.

Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan 18 01:11:32 CET 2014 on sn-devel-104
2014-01-18 01:11:32 +01:00
Shekhar Amlekar
de899754ac s3: rpc_server/srvsvc: Adding functions to determine open files on all sessions.
Introduce helper functions for counting the number of open files on an
array of sessions.

Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-17 14:12:58 -08:00
Jeremy Allison
090f010006 s3: rpc_server/srvsvc: Ensure we don't continually realloc inside init_srv_sess_info_1().
Just allocate the return value directly. Makes iteration of open files much easier.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-17 14:12:48 -08:00
Christian Ambach
da891e2101 waf:lib/replace gettext configure checks
Make sure we only try to work with gettext if we found
the prototypes and were able to link

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri Jan 17 19:30:33 CET 2014 on sn-devel-104
2014-01-17 19:30:33 +01:00
Christian Ambach
31db0c8acd waf:lib/replace fix gettext detection
if the user has specified a path for gettext, add it to CFLAGS and LDFLAGS
so we can find it during configure and build

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-03 05:04:44 +01:00
Christian Ambach
a83f491810 waf:lib/replace change detection of gettext
convert this to an automatic check: if no option is given, try to find gettext
and if found, use it
if user has specified --with-gettext, then bail out if it could not be found
in case of --without-gettext, skip all gettext related configure checks

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-03 05:04:44 +01:00
Christian Ambach
df6ddcfbfc waf:lib/replace fix up libintl related checks
on a default installation of AIX, libintl.a exists but
libintl.h does not
So check for the declarations of those functions as well
to make sure that the build works.

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-03 05:04:44 +01:00
Christian Ambach
1a42ff7d8d waf:lib/replace correct detection of libiconv
add -liconv as a complete command line argument,
not all characters on their own

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-03 05:04:44 +01:00
Christian Ambach
15b2d1a658 waf: improve iconv checks
there are broken iconv implementations around (e.g. on AIX) that you
can compile against but that refuse any mapping requests

make sure we do the same as the autoconf-based build did and
fall back to our own code

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-03 05:04:44 +01:00
Andreas Schneider
c20753ce7a selftest: Use the absolute path to libnss_winbind.so.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 17 16:45:27 CET 2014 on sn-devel-104
2014-01-17 16:45:27 +01:00
Andreas Schneider
5daf540782 s3-smbd: Log user change information.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2014-01-17 14:50:30 +01:00
Andreas Schneider
fa8c2b1578 libcli: Fix the comment for the address.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2014-01-17 14:50:30 +01:00
Stefan Metzmacher
741cb24f7a s3:lib/tldap: make use of tevent_req_set_cleanup_fn()
This is more better than a custom tevent_req destructor.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jan 17 14:34:06 CET 2014 on sn-devel-104
2014-01-17 14:34:06 +01:00
Stefan Metzmacher
5fd9eab20f s3:lib/tldap: make use of tevent_req_defer_callback()
In tldap_msg_received() we call tevent_req_error() for more than
one request, if we do that we need to use tevent_req_defer_callback()
otherwise we're likely to crash, as a triggered callback may
invalidate our state.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:09 +01:00
Stefan Metzmacher
c84fe17ba9 s3:lib/fncall: make use of tevent_req_set_cleanup_fn()
This is more better than a custom tevent_req destructor.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
f08c0b2ef1 libcli/smb: make use of tevent_req_set_cleanup_fn()
This is more better than a custom tevent_req destructor.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
c4c88d1ee8 tevent: version 0.9.21
This fixes a the following bugs:
- fix a crash bug in tevent_queue_immediate_trigger()
- add missing tevent_num_signals() and
  tevent_sa_info_queue_count() prototypes
  including documentation.

This adds the following new features:

- tevent_req_set_cleanup_fn()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
50b9f154d2 tevent: add tevent_req_set_cleanup_fn()
Note that some callers used their own destructor for their
tevent_req instance, they'll just overwrite this,
which is not intended, but works without problems.

The intended way is to specify a cleanup function
and handle the TEVENT_REQ_RECEIVED state as destructor.

Note that the TEVENT_REQ_RECEIVED cleanup event might
be triggered by an explicit tevent_req_received()
in the _recv() function. The TEVENT_REQ_RECEIVED event
is only triggered once as tevent_req_received()
will remove the destructor.

So the difference compared to a custom destructor
is that the struct tevent_req itself can continue
to be there, while tevent_req_received() removed
all internal state.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
0ed93e099a tevent: add/use tevent_req_destructor
This makes sure we call tevent_req_received(req) on talloc_free()
and cleanup things in a defined order.

Note that some callers used their own destructor for their
tevent_req instance, they'll just overwrite this,
which is not intended, but works without problems.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
7502a309e8 tevent: add doxygen comments for tevent_num_signals() and tevent_sa_info_queue_count()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Volker Lendecke
fd80e54416 tevent: Add prototypes
... doxygen docs to be filled in :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-01-17 12:38:08 +01:00
Volker Lendecke
e7d4b7deda tevent: Only build "std_fallback_to_poll" when epoll is around
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
7fe5584e2a tevent: fix crash bug in tevent_queue_immediate_trigger()
Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()).
If triggerA() removes itself tevent_queue_entry_destructor() will be called
for A, this schedules the immediate event to call triggerB().
If triggerA() then also removes B by an explicit of implizit talloc_free(),
q->list is NULL, but the immediate event is still scheduled and can't be unscheduled.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Martin Schwenke
b7bfe46636 ctdb/eventscripts: Move all eventscript state under $CTDB_VARDIR/state
Services can be flagged for reconfigure when they release IPs at
shutdown.  The flag is never removed and the service is prematurely
reconfigured during the first "ipreallocated" event, before any IPs
are hosted and before the "startup" event has actually started the
services.

$CTDB_VARDIR/state directly contained the service state subdirectories
and is already removed in the "init" event.  Just push the service
state subdirectories down a level and put everything else in a
subdirectory.

This way all the eventscript state gets cleaned up every time CTDB
starts up.

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 Jan 17 09:58:26 CET 2014 on sn-devel-104
2014-01-17 09:58:26 +01:00
Martin Schwenke
e6304d1e1a ctdb/daemon: Untangle serialisation of 1st recovery -> startup -> monitor
At the moment ctdb_check_healthy() is overloaded to wait until the
first recovery is complete, handle the "startup" event and also
actually handle monitoring.  This is untidy and hard to follow.

Instead, have the daemon explicitly wait for 1st recovery after the
"setup" event.  When first recovery is complete, schedule a function
to handle the "startup" event.  When the "startup" event succeeds then
explicitly enable monitoring.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-01-17 17:59:41 +11:00
Martin Schwenke
50e00b3e52 ctdb/eventscripts: Print a count if killing TCP connections times out
Also update related test

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-01-17 17:59:34 +11:00
Martin Schwenke
8eb20c2347 ctdb/eventscripts: Reconfigure lock should be released quickly
Currently the lock is held until the corresponding eventscript
completes, since the process still exists.  If the regular part of an
eventscript hangs then the lock might unnecessarily be held for a long
time.  The pathological case is when a monitor event gets stuck in
D-wait state and the script times out but can't be killed so the lock
is still held.  This can cause an unwanted monitor replay.

Change this so that the lock is released immediately after the
reconfiguration is complete.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-01-17 17:59:26 +11:00
Martin Schwenke
e77d5f99e3 ctdb/recoverd: Do not refuse disabling takeover runs on inactive nodes
Failure might be expected when disabling takeover runs on banned
nodes, since they might be suffering from performance problems or
similar.  More broadly, administrators who reconfigure a cluster that
isn't in a happy state aren't necessarily doing something sensible.

However, allowing takeover runs to be disabled on inactive nodes stops
reconfiguration of stopped nodes.  This is probaby an unreasonable
limitation, so drop it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-01-17 17:59:19 +11:00
Martin Schwenke
a955d0bedc ctdb-recoverd: Ignore failed ipreallocated controls to inactive nodes
Currently timeouts for controls to inactive nodes can cause banning
credits to be applied.  This should not happen.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-01-17 17:59:08 +11:00
Volker Lendecke
1a43778433 s3-winbind: Improve performance of wb_fill_pwent_sid2uid_done().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=2191

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 16 20:17:24 CET 2014 on sn-devel-104
2014-01-16 20:17:24 +01:00
Andreas Schneider
7d339dfe70 Add missing include dirs to .clang_complete.
Signed-off-by: Andreas Schneider <asn@samba.org>
2014-01-16 18:24:23 +01:00
Stefan Metzmacher
dc561b7e2d dcerpc.idl: make use of union dcerpc_bind_ack_reason and fix all callers.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Jan 16 18:21:40 CET 2014 on sn-devel-104
2014-01-16 18:21:40 +01:00
Stefan Metzmacher
7a62a35577 s4:librpc/rpc: change dcerpc_map_reason() into dcerpc_map_nak_reason()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-01-16 16:22:53 +01:00
Stefan Metzmacher
0648f6e66e s4:librpc/rpc: add dcerpc_map_ack_reason()
This is not the value as dcerpc_bind_ack_reason values are not the same
as dcerpc_bind_nak_reason values.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-01-16 16:22:53 +01:00
Stefan Metzmacher
572ea36c79 dcerpc.idl: make use of dcerpc_bind_nak_reason
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-01-16 16:22:53 +01:00