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

94844 Commits

Author SHA1 Message Date
Volker Lendecke
e750e2b1ea messaging3: Fix messaging_filtered_read_send
If we register an additional tevent context, we can now properly do
nested event contexts, listening for just one message type inside a
tevent_req_poll.

At this point this only enhances things without ctdb, but I'm working fixing
that soon.

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
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
dca572ff1c lib: Enhance poll_funcs_tevent for multiple tevent_contexts
With this patch it will be possible to use nested event contexts with
messaging_filtered_read_send/recv. Before this patchset only the one and only
event context a messaging_context is initialized with is able to receive
datagrams from the unix domain socket. So if you want to code a synchronous
RPC-like operation using a nested event context, you will not see the reply,
because the nested event context does not have the required tevent_fd's.
Unfortunately, this patchset has to add some advanced array voodoo. The idea
is that state->watches[] contains what we hand out with watch_new, and
state->contexts contains references to the tevent_contexts. For every watch we
need a tevent_fd in every event context, and the routines make sure that the
arrays are properly maintained.

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
5601576d9d messaging3: Add comments about not touching "waiters"
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
8e71945691 messaging3: Fix 80-char line limit
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
8d65512e69 dbwrap: Use messaging_filtered_read
This does not really save any code lines, but IMHO the code is simpler
this way. Also, in case we have lots of watchers this will be slightly
cheaper, because we don't have to re-establish a tevent_req.

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
Alexander Bokovoy
06c25eb25e wbclient: ensure response struct is initialized
Prior to asking for a winbindd private pipe we need to initialize
response structure to deal with a possible response failure.

winbind_open_pipe_sock() issues two winbindd requests:
 - asks for interface version
 - asks for a private pipe

The first call returns interface version in a response structure (which
is a union). The second call might fail -- in this case response
structure will not be initialized or filled in with any information.

As result, if the second call failed, response structure will have data
from an interface string interpreted as a pointer to a string during
SAFE_FREE() at the end of the winbind_open_pipe_sock().

To avoid that, ensure response struct is initialized before asking for
a private pipe.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  8 04:24:53 CEST 2014 on sn-devel-104
2014-05-08 04:24:53 +02:00
Christof Schmitt
a5b96ee5fb s3-krb5: Limit search for old kvno to 8bits
Some keytab files store the kvno only in 8bits. Limit the compare to
8bits, so that we don't miss old keys and delete them. This fixes the
problem that updates to the keytab file removed all previous keys.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Thu May  8 00:54:15 CEST 2014 on sn-devel-104
2014-05-08 00:54:15 +02:00
Andrew Bartlett
7736c96935 param: Use an explicit talloc_stackframe() in lp_load_ex for clarity and certainty
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May  7 22:14:21 CEST 2014 on sn-devel-104
2014-05-07 22:14:21 +02:00
Andrew Bartlett
9fdcf7888b param: Use an explicit talloc_stackframe() in lp_do_parameter for clarity and certainty.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:18 +02:00
Garming Sam
fa48d527b5 param: replace P_OCTAL variable setting with s3 version which uses sscanf
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:18 +02:00
Garming Sam
b2ce4e7549 lib/param: change set_variable to be more consistent with s3 loadparm
Correctly frees CMDLIST memory and uses lp_int instead of atoi.

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:17 +02:00
Garming Sam
f4d090f145 param: correctly return false when parsing invalid octal in lp_do_parameter
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:17 +02:00
Garming Sam
994bb15a37 lib/param: change a comment regarding helper parametric functions
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:17 +02:00
Garming Sam
dfc999ef90 lib/param: remove unnecessary get_parametric s3 helper function
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:17 +02:00
Garming Sam
c517150ec0 lib/param: use get_parametric_helper in lpcfg_get_parametric
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:17 +02:00
Garming Sam
886e44f159 param: remove unused 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:17 +02:00
Garming Sam
9d90969a37 param: copy parametric option helper to lib/param
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:17 +02:00
Garming Sam
66338032c2 param: tidy up get_parametrics_by_service
Reorders the search to check the service first, then check the globals
if it fails, or if none is specified, for better clarity.

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:17 +02:00
Garming Sam
687b35931d lib/param: clean up lpcfg_get_parametric
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:17 +02:00
Andrew Bartlett
b93ed0a73b param: Provide a talloc_stackframe() to external users of lp_set_cmdline()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:17 +02:00
Garming Sam
dc08cfacc9 param: refactor lp_set_cmdline_helper to not call store_lp_set_cmdline
Currently worthless without a shared do_parameter.

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:17 +02:00
Garming Sam
48a6624ddd param: fix incorrect return on lp_set_cmdline_helper
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:17 +02:00
Andrew Bartlett
5487f70e3f lib/param: Remove unused static variable defaults_saved
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:17 +02:00
Andrew Bartlett
b709304a21 lib/param: Make lpcfg_equal_parameter static (again)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:17 +02:00
Andrew Bartlett
3d6a0270e4 lib/param: Make and use lpcfg_dump_a_service() in common
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:17 +02:00
Garming Sam
412a387357 Add a comment regarding strwicmp only being an ASCII string compare
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:17 +02:00
Garming Sam
99767924ba param: remove NUMPARAMETERS macro from lib/param
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:17 +02:00
Garming Sam
978b815f8c param: remove NUMPARAMETERS macro in s3
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:17 +02:00
Garming Sam
b6b9f0821a docs: enable checking of parametric options assignment
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:17 +02:00
Garming Sam
20159a5b64 lib/param: use strwicmp instead of strlower_talloc
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:17 +02:00
Garming Sam
aea7d62b1a lib/param: fix an error in the is_default method in lib/param
This means that list values stored by s3 loadparm can still be detected as
default or not.

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:17 +02:00
Garming Sam
a900fa09ec param: move parametric parameter dumping to lpcfg_dump_a_parameter
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:17 +02:00
Garming Sam
8363106d9a param: remove fstring from dump_a_parameter
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:17 +02:00
Garming Sam
671d13fbd8 s3:loadparm: Fix dump a parameter to use the file indicated
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:17 +02:00
Garming Sam
8d70514faa param: fix copy service to copy over cmdlist
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <abartlet@samba.org>
2014-05-07 19:49:17 +02:00
Garming Sam
ad09b3e608 param: correctly use param_table.c as a regular C file
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
db19d74479 param: use a single special handler for idmap parameters
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
84ed1853eb param: add lp_do_parameter to s3 helpers
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
1189724ec4 param: use a single handle_netbios_aliases function
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
c03b8eba51 param: include set_netbios_aliases in s3 helpers
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
47ae38c4f1 param: setup ctx variable in loadparm globals
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
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
f4d7f12986 param: have a single handle_ldap_debug_level function
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
64eb985457 param: include init_ldap_debugging in the s3 helpers
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
5376e6a1bc param: make lp_do_parameter_parametric use set_param_opt
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
dce3bcd00f param: move handle printing into lib/param
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
74e0a37fd3 param: setup more variables in for the temporary loadparm context for the special functions
In doing so, the loadparm context definition is now also moved to the loadparm.h header.

This means that the loadparm context is no longer private to the
lib/param code and that the source3 code can now override the values
within it.

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