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

7250 Commits

Author SHA1 Message Date
Volker Lendecke
2f3435085e messaging3: Make messaging_dgm_cleanup return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-18 18:51:13 +02:00
Volker Lendecke
e6b33ce611 messaging3: Make the _send function return 0/errno
This is to eventually make messaging_dgm usable in ctdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-18 18:51:13 +02:00
Andrew Bartlett
b359b0c160 passdb: Allow a passdb module to do idmap for everything
This patch seems odd, but the pdb_samba_dsdb module has exactly this
semantics.  That is, the pdb_samba_dsdb is responsible for all IDMAP
values, due to backing on to the idmap.ldb allocator.  This option is
added so we can continue to support the mappings written into that
database even when switching winbindd implementations - the source4/
winbind code would only ask the idmap_ldb code, no matter what the
SID.

Almost all of the behaviour for this is already in winbindd, but we
need this extra flag function so as to avoid (currently intentional)
errors at startup due to not having a per-domain allocation
configured in the smb.conf.

Andrew Bartlett

Change-Id: I6b0d7a1463fe28dfd36715af0285911ecc07585c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
2014-06-16 00:26:26 +02:00
Michael Adam
9f6c4c4da2 vfs: update a bit-rotten comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-06-13 17:29:10 +02:00
Andrew Bartlett
597d2a7a29 auth: Provide a way to use the auth stack for winbindd authentication
This adds in flags that allow winbindd to request authentication
without directly calling into the auth_sam module.

That in turn will allow winbindd to call auth_samba4 and so permit
winbindd operation in the AD DC.

Andrew Bartlett

Change-Id: I27d11075eb8e1a54f034ee2fdcb05360b4203567
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Christian Ambach
558850c495 s3:lib/afs move afs_settoken.c to common lib dir
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-06-04 20:09:38 +02:00
Christian Ambach
89961ca297 s3:lib/afs move afs.c to common lib dir
some of the code in afs.c is needed by wbinfo that lives in the toplevel
nsswitch directory, so move the afs.c file to a new top-level lib/afs
directory. Use the name afs_funcs to avoid collisions with the afs.h
header from OpenAFS

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-06-04 20:09:38 +02:00
Andrew Bartlett
191d754091 s3-param: Add lp_dnsdomain() for use by winbindd
Change-Id: I987aa533ebe11c93b9e836fafc7b19c81bf600a5
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Volker Lendecke
c487937b01 messaging3: Make messaging_context private
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:18 +02:00
Volker Lendecke
8ddbf18115 messaging3: Add and use messaging_tevent_context()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Volker Lendecke
56a7ddd777 messaging3: Introduce messaging_local_backend()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Volker Lendecke
331296df94 messaging3: The backend send_fn doesn't need a messaging_context
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Michael Adam
e4453bdc37 s3:messaging: change messaging_backend to use iovec instead of data blob in send_fn
This also changes the layering

messaging_send_iov -> messaging_send_buf -> messaging_send

to

messaging_send_buf -> messaging_send -> messaging_send_iov

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-30 00:03:20 +02:00
Mathias Dietz
8935242489 Add protocol version to smbstatus output
Signed-off-by: Mathias Dietz <mdietz@de.ibm.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 22 18:37:27 CEST 2014 on sn-devel-104
2014-05-22 18:37:27 +02:00
Andrew Bartlett
6c37cd6544 auth: Allow auth_samba4 to be forced to run a specific auth module
This will allow new tests to be written to validate winbindd authentication results

Andrew Bartlett

Change-Id: I008eba1de349b17ee4eb9f11be08338557dffecc
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-16 10:23:26 +02:00
Volker Lendecke
a6e49f9cda messaging3: Add messaging_dgm_register_tevent_context
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-08 09:10:12 +02:00
Volker Lendecke
7a266c575a messaging3: Add messaging_filtered_read
This delegates the decision whether to read a message to a callback

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-08 09:10:12 +02:00
Garming Sam
98dbc38efa move str_list_make_v3 out of s3 code
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Garming Sam
509cc45c95 param: add extra default parameter to get_parametrics_by_service
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Garming Sam
3845138731 param: remove unused lp_set_option
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Garming Sam
4a86b693fd param: remove lp_string_is_valid_boolean
This call is never made in the code and should in fact crash if it was ever called with a valid boolean

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/106
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:14 +02:00
Volker Lendecke
d0590eec7e messaging3: Fix messaging_read_send/recv
messaging_read_send/recv was okay for just one handler in the queue. For
multiple handlers it was pretty broken.

A handler that deletes itself as part of the callback (pretty typical use
case...) drops the message for a subsequent handler that responds to the same
message type. In messaging_dispatch_rec we walk the array, however
messaging_read_cleanup has already changed the array. tevent_req_defer_callback
does not help here: It only defers the callback, it does not defer the cleanup
function.

This also happens when a callback deletes a different handler

A handler that re-installs itself in the callback might get a message twice.

This patch changes the code such that only messaging_dispatch_rec adds records
to msg_ctx->waiters, new waiters are put into a staging area first
(msg_ctx->new_waiters). Also messaging_read_cleanup does not move anything
around in msg_ctx->waiters, it only nulls out itself. messaging_dispatch_rec is
changed to cope with this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-30 14:52:08 +02:00
Michael Adam
0df8988c08 autorid: add high_id to range config and fill it where we also fill range->low_id.
This corresponds to low_id for convenience and allows
for computations without going back to the global config.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-25 15:35:09 +02:00
Volker Lendecke
843f094628 s3: messaging: Add infrastructure to clean up orphaned sockets every 15 minutes as a background task.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:09 +02:00
Volker Lendecke
6874e4a0f2 messaging_dgm: Add messaging_dgm_wipe
This walks all sockets and wipes the left-overs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:09 +02:00
Volker Lendecke
cdc99c145d messaging3: Add messaging_send_iov
This uses a copy, will be replaced by a direct iovec call through to
sendmsg on the unix domain socket

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
e2683605b0 lib: Add iov_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
7009b4921c lib: Introduce iov_buflen
.. with overflow protection

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
b022038cdc lib: Remove messages_local
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
29603d1cd9 lib: Add messaging_dgm
Messaging based on unix domain datagram sockets

This makes every process participating in messaging bind on a unix domain
datagram socket, similar to the source4 based messaging. The details are a bit
different though:

Retry after EWOULDBLOCK is done with a blocking thread, not by polling. This
was the only way I could in experiments avoid a thundering herd or high load
under Linux in extreme overload situations like many thousands of processes
sending to one blocked process. If there are better ideas to do this in a
simple way, I'm more than happy to remove the pthreadpool dependency again.

There is only one socket per process, not per task. I don't think that per-task
sockets are really necessary, we can do filtering in user space. The message
contains the destination server_id, which contains the destination task_id. I
think we can rebase the source4 based imessaging on top of this, allowing
multiple imessaging contexts on top of one messaging_context. I had planned to
do this conversion before this goes in, but Jeremy convinced me that this has
value in itself :-)

Per socket we also create a fcntl-based lockfile to allow race-free cleanup of
orphaned sockets. This lockfile contains the unique_id, which in the future
will make the server_id.tdb obsolete.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Volker Lendecke
3e24e07467 lib: Move full_path_tos to util_str.c
This can be useful elsewhere

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Andreas Schneider
15feb84273 s3-lib: Add root_mode() which can deal with uid_wrapper.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Andrew Bartlett
cec833063e auth: Remove plaintext OSF1 password support
The WAF build does not have the code to detect getprpwnam on which
this is based, and so this is dead code.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-04-15 10:13:12 +02:00
Jeremy Allison
837671f476 s3: messages: Implement cleanup of dead records.
When a smbd process dies, pending messages.tdb records for this process
might not get cleaned up. Implement a cleanup for dead records that is
triggered after a smbd dies uncleanly; the records for that PID are
deleted.

Based on a patchset from Christof Schmitt <cs@samba.org>.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-04-03 06:22:13 +02:00
Michael Adam
9e519d97c3 autorid: split idmap_autorid_db_open and idmap_autorid_init_hwms out of idmap_autorid_db_init
These will be used separately in the full initialization function.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-03 00:26:28 +02:00
Stefan Metzmacher
74b359c616 s3:build: remove global CLUSTER_SUPPORT define
All ctdb specific code is isolated in samba-cluster-support.so now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Mar 24 19:08:44 CET 2014 on sn-devel-104
2014-03-24 19:08:44 +01:00
Stefan Metzmacher
24054b5f8b s3:param: move lp_ctdbd_socket() to ctdbd_conn.c
This allows us to use CTDB_PATH only in ctdbd_conn.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:10 +01:00
Stefan Metzmacher
e5b5775b81 s3:ctdbd_conn: add ctdb_serverids_exist_supported()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:10 +01:00
Volker Lendecke
8c01dbc058 gencache: Add gencache values to memcache
gencache_parse calling tdb shows up in profiles when we do a lot of open/close
traffic with large ACLs. For every file we convert unix ids to sids, and in the
domain member case this goes through gencache.

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 Mar 11 19:56:47 CET 2014 on sn-devel-104
2014-03-11 19:56:46 +01:00
Ralph Boehme
e7856ed58d Add usable stream name defines
Add stream name defines that are usable with Samba's way of storing
stream names internally.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2014-03-11 10:12:57 +00:00
Ralph Boehme
8424d35919 Fix a typo
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2014-03-11 10:11:33 +00:00
Stefan Metzmacher
032621d5bf s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
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 Mar  5 22:53:34 CET 2014 on sn-devel-104
2014-03-05 22:53:34 +01:00
Stefan Metzmacher
7f3faa1f18 s3:include: let CLI_BUFFER_SIZE be an alias of SMB_BUFFER_SIZE_MAX
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-05 10:06:24 -08:00
Stefan Metzmacher
9677fae6aa s3:lib/ctdbd_conn: let release_ip_handler return bool
If it returns true the passed ip address matched and we
let a nested ctdb operation fail with NT_STATUS_ADDRESS_CLOSED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-02-21 12:48:31 +01:00
Garming Sam
8246e53bb6 param: remove lp_dnsdomain from s3
With the use of the shared globals structure, lp_dnsdomain is no longer used in the code and removing it would remove a notable special case

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I59526c40c58e132a134d67fa7944dfeacd05f4c6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:24 +13:00
Aurélien Aptel
5fbe36cbaf clitar.h: delete file
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-19 18:22:28 +01:00
Volker Lendecke
69594dfb8c auth: Make new_server_id_task() static to auth_samba4
This is not used in other parts of source3, so this patch improves
modularity and isolation of features.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 21:47:51 +01:00
Garming Sam
6e954a5605 param: move SMB2 defaults to lib/param and use in loadparm_init
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 13:17:14 +13:00
Andrew Bartlett
0c7ed5a8ab param: No longer have a special case for lp_configfile
This parameter is renamed because it does not normally return the current smb.conf file, but
instead returns the next one, as found in a config file = directive, to be loaded.

This avoids a conflict with the lpcfg_configfile from lib/param, which does refer to the
current smb.conf path.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 13:17:13 +13:00
Garming Sam
526cf3c119 param: use generate_param.py to generate param_proto.h
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 13:17:13 +13:00