sfrench/samba-autobuild/.git
10 years agos4:libnet: make use of dcerpc_binding_[g|s]et_*() in libnet_join.c
Stefan Metzmacher [Thu, 30 Jan 2014 21:04:11 +0000 (22:04 +0100)]
s4:libnet: make use of dcerpc_binding_[g|s]et_*() in libnet_join.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:libnet: use 'const struct dcerpc_binding' for local readonly variables
Stefan Metzmacher [Wed, 12 Feb 2014 11:22:11 +0000 (12:22 +0100)]
s4:libnet: use 'const struct dcerpc_binding' for local readonly variables

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:libnet: make use of dcerpc_binding_get_*() in libnet_rpc.c
Stefan Metzmacher [Thu, 30 Jan 2014 21:02:49 +0000 (22:02 +0100)]
s4:libnet: make use of dcerpc_binding_get_*() in libnet_rpc.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:srv_epmapper: make use of dcerpc_binding_get_abstract_syntax()
Stefan Metzmacher [Tue, 4 Feb 2014 01:32:29 +0000 (02:32 +0100)]
s3:srv_epmapper: make use of dcerpc_binding_get_abstract_syntax()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:srv_epmapper: make use of dcerpc_binding_*() functions in build_ep_list()
Stefan Metzmacher [Fri, 31 Jan 2014 20:10:41 +0000 (21:10 +0100)]
s3:srv_epmapper: make use of dcerpc_binding_*() functions in build_ep_list()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:srv_epmapper: use dcerpc_binding_get_abstract_syntax() in _epm_Insert()
Stefan Metzmacher [Fri, 31 Jan 2014 20:10:41 +0000 (21:10 +0100)]
s3:srv_epmapper: use dcerpc_binding_get_abstract_syntax() in _epm_Insert()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:srv_epmapper: use dcerpc_binding_get_transport() in _epm_Insert() and _epm_Delete()
Stefan Metzmacher [Fri, 31 Jan 2014 20:10:41 +0000 (21:10 +0100)]
s3:srv_epmapper: use dcerpc_binding_get_transport() in _epm_Insert() and _epm_Delete()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:srv_epmapper: make use of dcerpc_binding_*() functions in endpoints_match()
Stefan Metzmacher [Fri, 31 Jan 2014 22:26:43 +0000 (23:26 +0100)]
s3:srv_epmapper: make use of dcerpc_binding_*() functions in endpoints_match()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:dcerpc_ep: make use of dcerpc_binding_set_abstract_syntax()
Stefan Metzmacher [Tue, 4 Feb 2014 01:31:44 +0000 (02:31 +0100)]
s3:dcerpc_ep: make use of dcerpc_binding_set_abstract_syntax()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:dcerpc_ep: make use of dcerpc_binding helper functions
Stefan Metzmacher [Thu, 30 Jan 2014 11:52:34 +0000 (12:52 +0100)]
s3:dcerpc_ep: make use of dcerpc_binding helper functions

We should not dereference 'struct dcerpc_binding'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpc_server: make use of dcerpc_binding_set_abstract_syntax()
Stefan Metzmacher [Thu, 30 Jan 2014 22:09:50 +0000 (23:09 +0100)]
s3:rpc_server: make use of dcerpc_binding_set_abstract_syntax()

This is better than accessing the dcerpc_binding internals.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpcclient: make use of dcerpc_binding_get_string_option("host")
Stefan Metzmacher [Tue, 4 Feb 2014 11:14:37 +0000 (12:14 +0100)]
s3:rpcclient: make use of dcerpc_binding_get_string_option("host")

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpcclient: make use of dcerpc_binding_set_abstract_syntax() in cmd_epmapper.c
Stefan Metzmacher [Thu, 30 Jan 2014 21:05:51 +0000 (22:05 +0100)]
s3:rpcclient: make use of dcerpc_binding_set_abstract_syntax() in cmd_epmapper.c

We should not use dcerpc_binding internals.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpcclient: make use of dcerpc_binding_[g|s]et_*() in rpcclient.c
Stefan Metzmacher [Thu, 30 Jan 2014 21:06:53 +0000 (22:06 +0100)]
s3:rpcclient: make use of dcerpc_binding_[g|s]et_*() in rpcclient.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpc_client: avoid using dcerpc_binding internals in rpc_pipe_get_tcp_port()
Stefan Metzmacher [Thu, 30 Jan 2014 08:26:26 +0000 (09:26 +0100)]
s3:rpc_client: avoid using dcerpc_binding internals in rpc_pipe_get_tcp_port()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: make use of dcerpc_binding_get_*() in dcerpc_connect.c
Stefan Metzmacher [Thu, 30 Jan 2014 21:00:44 +0000 (22:00 +0100)]
s4:librpc/rpc: make use of dcerpc_binding_get_*() in dcerpc_connect.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: remove unused dcerpc_pipe->assoc_group_id
Stefan Metzmacher [Tue, 4 Feb 2014 01:52:35 +0000 (02:52 +0100)]
s4:librpc/rpc: remove unused dcerpc_pipe->assoc_group_id

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:libnet_become_dc: make use of dcerpc_binding_[g|s]et_assoc_group_id()
Stefan Metzmacher [Tue, 4 Feb 2014 01:51:16 +0000 (02:51 +0100)]
s4:libnet_become_dc: make use of dcerpc_binding_[g|s]et_assoc_group_id()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:rpc_server/remote: make use of dcerpc_binding_get_assoc_group_id()
Stefan Metzmacher [Tue, 4 Feb 2014 01:50:18 +0000 (02:50 +0100)]
s4:rpc_server/remote: make use of dcerpc_binding_get_assoc_group_id()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:torture/rpc: make use of dcerpc_binding_get_assoc_group_id() in handles.c
Stefan Metzmacher [Tue, 4 Feb 2014 01:49:58 +0000 (02:49 +0100)]
s4:torture/rpc: make use of dcerpc_binding_get_assoc_group_id() in handles.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:torture/rpc: make use of dcerpc_binding_set_*() in torture_rpc_connection_transport()
Stefan Metzmacher [Thu, 30 Jan 2014 18:06:28 +0000 (19:06 +0100)]
s4:torture/rpc: make use of dcerpc_binding_set_*() in torture_rpc_connection_transport()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: make use of dcerpc_binding_[g|s]et_assoc_group_id()
Stefan Metzmacher [Tue, 4 Feb 2014 01:51:16 +0000 (02:51 +0100)]
s4:librpc/rpc: make use of dcerpc_binding_[g|s]et_assoc_group_id()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: make use of dcerpc_binding_[g|s]et_* functions in dcerpc_epm_map_bindi...
Stefan Metzmacher [Sat, 25 Jan 2014 10:14:36 +0000 (11:14 +0100)]
s4:librpc/rpc: make use of dcerpc_binding_[g|s]et_* functions in dcerpc_epm_map_binding_send()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: always call dcerpc_binding_set_abstract_syntax() in dcerpc_epm_map_bin...
Stefan Metzmacher [Sat, 25 Jan 2014 10:14:36 +0000 (11:14 +0100)]
s4:librpc/rpc: always call dcerpc_binding_set_abstract_syntax() in dcerpc_epm_map_binding_send()

We should always set the abstract syntax even if we don't ask the endpoint
mapper.

By using dcerpc_binding_set_abstract_syntax() instead of calling
binding->object = table->syntax_id, we will be able to separate
the abstract_syntax from the object uuid in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: the table argument to dcerpc_epm_map_binding_send() isn't optional
Stefan Metzmacher [Wed, 12 Feb 2014 07:58:08 +0000 (08:58 +0100)]
s4:librpc/rpc: the table argument to dcerpc_epm_map_binding_send() isn't optional

We already dereference it unchecked later, so we can avoid some indentation.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: make use of dcerpc_binding_set*() in dcerpc_binding_from_tower()
Stefan Metzmacher [Mon, 3 Feb 2014 08:11:32 +0000 (09:11 +0100)]
librpc/rpc: make use of dcerpc_binding_set*() in dcerpc_binding_from_tower()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: use dcerpc_binding_get_*() in dcerpc_default_transport_endpoint()
Stefan Metzmacher [Thu, 30 Jan 2014 08:09:04 +0000 (09:09 +0100)]
librpc/rpc: use dcerpc_binding_get_*() in dcerpc_default_transport_endpoint()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/tests: add dcerpc_binding assoc_group_id tests
Stefan Metzmacher [Tue, 11 Feb 2014 06:28:53 +0000 (07:28 +0100)]
s4:librpc/tests: add dcerpc_binding assoc_group_id tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/tests: add dcerpc_binding target_hostname/target_principal tests
Stefan Metzmacher [Tue, 11 Feb 2014 06:28:53 +0000 (07:28 +0100)]
s4:librpc/tests: add dcerpc_binding target_hostname/target_principal tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/tests: use dcerpc_binding_get*() functions
Stefan Metzmacher [Fri, 7 Feb 2014 15:17:04 +0000 (16:17 +0100)]
s4:librpc/tests: use dcerpc_binding_get*() functions

We should not dereference struct dcerpc_binding.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: avoid loosing data with dcerpc_binding_string() -> dcerpc_parse_binding()
Stefan Metzmacher [Fri, 7 Feb 2014 13:50:11 +0000 (14:50 +0100)]
librpc/rpc: avoid loosing data with dcerpc_binding_string() -> dcerpc_parse_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_[g|s]et_abstract_syntax()
Stefan Metzmacher [Sat, 25 Jan 2014 10:31:14 +0000 (11:31 +0100)]
librpc/rpc: add dcerpc_binding_[g|s]et_abstract_syntax()

For now this is just an alternate wrapper to
access binding->object.

Currently callers are reusing binding->object to store the
abstract syntax id instead of just the object uuid.

Some services on Windows use the same GUID for the
'object' and the 'abstract syntax', but they are completely
different things!

Most services use a null object guid, some reuse the
guid of the abstract syntax and use it like a 'class' object.

But the object guid is only really used by DCOM,
in order to call functions relative to an object instance,
which a dynamically allocated object guid.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: allow "assoc_group_id" in dcerpc_binding_[g|s]et_string()
Stefan Metzmacher [Tue, 11 Feb 2014 18:33:09 +0000 (19:33 +0100)]
librpc/rpc: allow "assoc_group_id" in dcerpc_binding_[g|s]et_string()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_[g|s]et_assoc_group_id()
Stefan Metzmacher [Sat, 25 Jan 2014 10:22:52 +0000 (11:22 +0100)]
librpc/rpc: add dcerpc_binding_[g|s]et_assoc_group_id()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_[g|s]et_transport()
Stefan Metzmacher [Sat, 25 Jan 2014 09:39:55 +0000 (10:39 +0100)]
librpc/rpc: add dcerpc_binding_[g|s]et_transport()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_[g|s]et_object()
Stefan Metzmacher [Fri, 24 Jan 2014 15:56:34 +0000 (16:56 +0100)]
librpc/rpc: add dcerpc_binding_[g|s]et_object()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_[g|s]et_flags()
Stefan Metzmacher [Fri, 24 Jan 2014 15:43:57 +0000 (16:43 +0100)]
librpc/rpc: add dcerpc_binding_[g|s]et_flags()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_get_auth_info()
Stefan Metzmacher [Fri, 24 Jan 2014 15:38:01 +0000 (16:38 +0100)]
librpc/rpc: add dcerpc_binding_get_auth_info()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: simplify dcerpc_parse_binding()
Stefan Metzmacher [Thu, 23 Jan 2014 11:13:14 +0000 (12:13 +0100)]
librpc/rpc: simplify dcerpc_parse_binding()

We now make a copy of the given string, so that we can mark chunks
inline. Then we call dcerpc_binding_set_string_option() in order
to set the elements.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: handle ncacn_options in dcerpc_binding_[s|g]et_string_option()
Stefan Metzmacher [Thu, 23 Jan 2014 12:55:10 +0000 (13:55 +0100)]
librpc/rpc: handle ncacn_options in dcerpc_binding_[s|g]et_string_option()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: set more things via dcerpc_binding_set_string_option()
Stefan Metzmacher [Thu, 23 Jan 2014 11:13:14 +0000 (12:13 +0100)]
librpc/rpc: set more things via dcerpc_binding_set_string_option()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add ncacn_option_by_name()
Stefan Metzmacher [Thu, 23 Jan 2014 13:26:04 +0000 (14:26 +0100)]
librpc/rpc: add ncacn_option_by_name()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: remove dcerpc_binding->localaddress and store it in the options array
Stefan Metzmacher [Thu, 23 Jan 2014 08:45:47 +0000 (09:45 +0100)]
librpc/rpc: remove dcerpc_binding->localaddress and store it in the options array

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: let derpc_binding_string() add ncacn_options before key=value options
Stefan Metzmacher [Fri, 24 Jan 2014 08:24:49 +0000 (09:24 +0100)]
librpc/rpc: let derpc_binding_string() add ncacn_options before key=value options

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: use dcerpc_binding_[g|set]_string_option("localaddress")
Stefan Metzmacher [Thu, 16 Jan 2014 14:39:55 +0000 (15:39 +0100)]
s4:librpc/rpc: use dcerpc_binding_[g|set]_string_option("localaddress")

We should avoid deferencing struct dcerpc_binding if possible.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: handle "localaddress" in dcerpc_binding_[s|g]et_string_option()
Stefan Metzmacher [Thu, 16 Jan 2014 13:20:04 +0000 (14:20 +0100)]
librpc/rpc: handle "localaddress" in dcerpc_binding_[s|g]et_string_option()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: keep talloc hierachie sane in dcerpc_parse_binding()
Stefan Metzmacher [Wed, 15 Jan 2014 14:22:47 +0000 (15:22 +0100)]
librpc/rpc: keep talloc hierachie sane in dcerpc_parse_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_copy_string_option()
Stefan Metzmacher [Thu, 23 Jan 2014 13:59:48 +0000 (14:59 +0100)]
librpc/rpc: add dcerpc_binding_copy_string_option()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_set_string_option()
Stefan Metzmacher [Thu, 16 Jan 2014 10:10:46 +0000 (11:10 +0100)]
librpc/rpc: add dcerpc_binding_set_string_option()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add dcerpc_binding_get_string_option()
Stefan Metzmacher [Wed, 15 Jan 2014 14:15:35 +0000 (15:15 +0100)]
librpc/rpc: add dcerpc_binding_get_string_option()

This allows get value string of a [key=value] option
of the dcerpc_binding.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: only interpret the first option as endpoint if there's no '=' in it.
Stefan Metzmacher [Wed, 15 Jan 2014 13:43:51 +0000 (14:43 +0100)]
librpc/rpc: only interpret the first option as endpoint if there's no '=' in it.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: remove the options array in dcerpc_parse_binding() if not needed
Stefan Metzmacher [Wed, 15 Jan 2014 13:43:12 +0000 (14:43 +0100)]
librpc/rpc: remove the options array in dcerpc_parse_binding() if not needed

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agolibrpc/rpc: add some talloc checks to dcerpc_binding_string()
Stefan Metzmacher [Wed, 15 Jan 2014 13:22:22 +0000 (14:22 +0100)]
librpc/rpc: add some talloc checks to dcerpc_binding_string()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpc_server: make use of dcerpc_parse_binding() to create a binding.
Stefan Metzmacher [Thu, 30 Jan 2014 22:09:50 +0000 (23:09 +0100)]
s3:rpc_server: make use of dcerpc_parse_binding() to create a binding.

This makes sure binding is talloc'ed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos3:rpcclient: make use of dcerpc_parse_binding() to create the binding
Stefan Metzmacher [Thu, 30 Jan 2014 21:05:51 +0000 (22:05 +0100)]
s3:rpcclient: make use of dcerpc_parse_binding() to create the binding

This makes sure the binding is talloc'ed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:rpc_server/spoolss: use dcerpc_parse_binding() to create the notify binding
Stefan Metzmacher [Thu, 30 Jan 2014 18:02:16 +0000 (19:02 +0100)]
s4:rpc_server/spoolss: use dcerpc_parse_binding() to create the notify binding

This is much better than creating the binding by hand.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:torture/rpc: use dcerpc_parse_binding() in epmapper.c
Stefan Metzmacher [Thu, 30 Jan 2014 08:14:00 +0000 (09:14 +0100)]
s4:torture/rpc: use dcerpc_parse_binding() in epmapper.c

This makes sure binding is talloc'ed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:torture/rpc: use dcerpc_binding_dup() before modifying the given binding
Stefan Metzmacher [Wed, 12 Feb 2014 11:11:51 +0000 (12:11 +0100)]
s4:torture/rpc: use dcerpc_binding_dup() before modifying the given binding

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:librpc/rpc: use dcerpc_binding_dup() before modifying the given binding
Stefan Metzmacher [Wed, 12 Feb 2014 11:11:51 +0000 (12:11 +0100)]
s4:librpc/rpc: use dcerpc_binding_dup() before modifying the given binding

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:libnet: avoid compiler warnings in libnet_lookup.c
Stefan Metzmacher [Wed, 12 Feb 2014 11:22:37 +0000 (12:22 +0100)]
s4:libnet: avoid compiler warnings in libnet_lookup.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:rpc_server/remote: avoid compiler a compiler warning
Stefan Metzmacher [Wed, 12 Feb 2014 11:12:35 +0000 (12:12 +0100)]
s4:rpc_server/remote: avoid compiler a compiler warning

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:wrepl_server: avoid some compiler warnings
Stefan Metzmacher [Wed, 12 Feb 2014 11:10:56 +0000 (12:10 +0100)]
s4:wrepl_server: avoid some compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:torture/rpc: s/pipe/p/ in order to avoid compiler warnings
Stefan Metzmacher [Wed, 12 Feb 2014 11:09:53 +0000 (12:09 +0100)]
s4:torture/rpc: s/pipe/p/ in order to avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:client: fix some compiler warnings
Stefan Metzmacher [Wed, 12 Feb 2014 11:09:25 +0000 (12:09 +0100)]
s4:client: fix some compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agos4:auth/gensec: only include "librpc/gen_ndr/dcerpc.h"
Stefan Metzmacher [Wed, 12 Feb 2014 11:08:19 +0000 (12:08 +0100)]
s4:auth/gensec: only include "librpc/gen_ndr/dcerpc.h"

We only need some DCERPC_ defines.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agoauth/gensec: only include "librpc/gen_ndr/dcerpc.h"
Stefan Metzmacher [Wed, 12 Feb 2014 11:08:19 +0000 (12:08 +0100)]
auth/gensec: only include "librpc/gen_ndr/dcerpc.h"

We only need some DCERPC_ defines.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 years agobuild: allow some python variable overrides
Gustavo Zacarias [Wed, 12 Feb 2014 22:59:19 +0000 (14:59 -0800)]
build: allow some python variable overrides

The python variables (settings) are fetched from a running python
interpreter which usually isn't the target one when cross compiling,
hence libraries and flags aren't the same and can pollute the target build.
Allow some of these variables to be redefined via environment variables
in order to aid cross-compiling.
According to testing python_LDFLAGS and python_LIBDIR should be enough.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 13 06:03:26 CET 2014 on sn-devel-104

10 years agoctdb-tests: Handle interactions with monitor events
Martin Schwenke [Wed, 12 Feb 2014 04:33:19 +0000 (15:33 +1100)]
ctdb-tests: Handle interactions with monitor events

In the first case, reconfiguration can longer happen in a monitor
event, so this is no longer a problem.  Drop it.

Running a monitor event by hand no longer cancels the existing monitor
event.  Instead the hand-run event fails.  So do this differently and
just wait for a monitor event before continuing.

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 Feb 13 04:05:57 CET 2014 on sn-devel-104

10 years agoctdb-recoverd: Fix a bug in the LCP2 rebalancing code
Martin Schwenke [Fri, 7 Feb 2014 06:19:20 +0000 (17:19 +1100)]
ctdb-recoverd: Fix a bug in the LCP2 rebalancing code

srcimbl gets changed on every iteration of the loop.  The value that
should be stored for the new imbalance of the source node is
minsrcimbl.

To help diagnose this, added some extra debug that can be left in.

The extra debug changes the output of a couple of tests.  Note that
the resulting IP allocations in those tests is unchanged - only the
debug output is changed.

Also add some new tests that illustrates the bug.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: New test to ensure "ctdb reloadips" manipulates IPs correctly
Martin Schwenke [Tue, 11 Feb 2014 22:49:11 +0000 (09:49 +1100)]
ctdb-tests: New test to ensure "ctdb reloadips" manipulates IPs correctly

This adds a lot of IPs (currently 100) in a new network and deletes
them in a few steps.  First the primary is deleted and then a check is
done to ensure that the remaining IPs are all correct.  Then about 1/2
of the IPs and deleted and remaining IPs are checked.  Then the
remaining IPs are deleted and a check is done to ensure they are all
gone.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests-eventscripts: Testing support for promote_secondaries
Martin Schwenke [Tue, 28 Jan 2014 05:08:50 +0000 (16:08 +1100)]
ctdb-tests-eventscripts: Testing support for promote_secondaries

Just enable this behaviour by default in the ip command stub, since
10.interface assumes/sets it.  The rc.local replacement for set_proc()
doesn't do anything...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-eventscripts: Deleting IPs should use the promote_secondaries option
Martin Schwenke [Tue, 28 Jan 2014 03:41:25 +0000 (14:41 +1100)]
ctdb-eventscripts: Deleting IPs should use the promote_secondaries option

If a primary IP address is being deleted from an interface, the
secondaries are remembered and added back after the primary is
deleted.  This is done under a lock shared by the add/del script code.
It is necessary because, by default, Linux deletes secondaries when
the corresponding primary is deleted.

There is a race here between ctdbd and the scripts, since ctdbd
doesn't know about the lock.  If ctdbd receives a release IP control
and the IP address is not on an interface then it is regarded as a
"Redundant release of IP" so no "releaseip" event is generated.  This
can occur if the IP address in question is a secondary that has been
temporarily dropped.  It is more likely if the number of secondaries
is large.

Since Linux 2.6.12 (i.e. 2005) Linux has supported a
promote_secondaries option on interfaces.  This option is currently
undocumented but that will change in Linux 3.14.  With
promote_secondaries enabled the kernel will not drop secondaries but
will promote a corresponding secondary instead.  The kernel does all
necessary locking.

Use promote_secondaries to simplify the code, avoid re-adding
secondaries, avoid re-adding routes and provide improved performance.

This could be done conditionally, with a fallback to legacy
secondary-re-adding code, but no supported Linux distribution is
running a pre-2.6.12 kernel so this is unnecessary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agowaf:lib/replace fix iconv checks on HP/UX
Christian Ambach [Wed, 29 Jan 2014 19:48:38 +0000 (20:48 +0100)]
waf:lib/replace fix iconv checks on HP/UX

we need to copy away the list of LDFLAGS
to be tried before modifying it instead of
just creating a new reference and then continuing
with a modified list while it should have been
reset back to the original value

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): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 13 02:01:03 CET 2014 on sn-devel-104

10 years agosmbXsrv_open.c: Initialize local variable.
Christopher R. Hertel (crh) [Wed, 12 Feb 2014 20:08:12 +0000 (14:08 -0600)]
smbXsrv_open.c: Initialize local variable.

Coverity fix.  Initialize status to NT_STATUS_OK.  Otherwise, there are
code paths that would cause the smbXsrv_open_cleanup() function to
return an uninitialized value.

Cov: 1168008

Signed-off-by: Christopher R. Hertel (crh) <crh@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Feb 12 23:57:05 CET 2014 on sn-devel-104

10 years agoauth: Make new_server_id_task() static to auth_samba4
Volker Lendecke [Wed, 12 Feb 2014 14:47:26 +0000 (14:47 +0000)]
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>
10 years agosmbd: Slightly simplify vfswrap_fsctl
Volker Lendecke [Wed, 12 Feb 2014 14:22:26 +0000 (14:22 +0000)]
smbd: Slightly simplify vfswrap_fsctl

We have the MIN macro, so use it :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agosmbd: Fix an uninitialized read
Volker Lendecke [Thu, 6 Feb 2014 15:40:46 +0000 (15:40 +0000)]
smbd: Fix an uninitialized read

We have to ship 64 bytes, and we have to initialize the whole thing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agocmdline: Remove dynconfig hooks in command line processing
Andrew Bartlett [Wed, 8 Jan 2014 00:35:34 +0000 (13:35 +1300)]
cmdline: Remove dynconfig hooks in command line processing

This removes the ability to set paths like the sbindir, bindir, and changes the tool for setting lockdir
statedir etc to be via --option="lock dir=/var/lock".

These were originally added by commit 90a6873b0570f2691ba8d8fd11154c856bdd4415
by James Peach <jpeach@samba.org>

The important use case, qemu, does not use these options, but specifies these directories via an smb.conf.

They are being removed to remove a layer from the loadparm system, now that options
can be specified from the command line.  It will also make it easier to generate the affected
parameters from the XML documentation if this layer of indirection is removed.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Feb 12 16:42:14 CET 2014 on sn-devel-104

10 years agoctdb-daemon: Consult CTDB_DEBUG_HUNG_SCRIPT variable before running debug script
Amitay Isaacs [Tue, 11 Feb 2014 06:29:26 +0000 (17:29 +1100)]
ctdb-daemon: Consult CTDB_DEBUG_HUNG_SCRIPT variable before running debug script

If CTDB_DEUB_HUNG_SCRIPT is set, use that instead of the default
debug script.  This code was dropped by mistake in commit
18c1f432102f1a5093927be9276d001180539e50.

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): Wed Feb 12 08:47:47 CET 2014 on sn-devel-104

10 years agoctdb-eventscripts: Create extra files for ganesha recovery
Srikrishan Malik [Mon, 10 Feb 2014 05:49:08 +0000 (11:19 +0530)]
ctdb-eventscripts: Create extra files for ganesha recovery

This adds new files for Ganesha's recovery.  myreleaseip_* are used by
the recovery thread on the node where IP is released. The releaseip_*
and tekeip_* files are used by recovery thread where IP is taken over.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoctdb-eventscripts: Run mmlsconfig only once and use cached results
Srikrishan Malik [Mon, 10 Feb 2014 05:40:48 +0000 (11:10 +0530)]
ctdb-eventscripts: Run mmlsconfig only once and use cached results

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
10 years agoparam: change share backend to use a constant string
Garming Sam [Thu, 16 Jan 2014 21:10:48 +0000 (10:10 +1300)]
param: change share backend to use a constant string

Substitution is not necessary for this parameter.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Feb 12 03:17:39 CET 2014 on sn-devel-104

10 years agoparam: change fstype to use a constant string
Garming Sam [Thu, 16 Jan 2014 02:58:31 +0000 (15:58 +1300)]
param: change fstype to use a constant string

Substitution isn't really necessary for this parameter.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoparam: Move LOADPARM_EXTRA_GLOBALS to lib/param/loadparm.h to be shared between loadparms
Garming Sam [Thu, 16 Jan 2014 00:44:22 +0000 (13:44 +1300)]
param: Move LOADPARM_EXTRA_GLOBALS to lib/param/loadparm.h to be shared between loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoparam: move SMB2 defaults to lib/param and use in loadparm_init
Garming Sam [Thu, 16 Jan 2014 00:32:42 +0000 (13:32 +1300)]
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>
10 years agoparam: remove special cases for tls files
Garming Sam [Thu, 16 Jan 2014 00:13:11 +0000 (13:13 +1300)]
param: remove special cases for tls files

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoparam: use generate_param.py to generate loadparm_ctx_table.c
Garming Sam [Wed, 15 Jan 2014 04:55:56 +0000 (17:55 +1300)]
param: use generate_param.py to generate loadparm_ctx_table.c

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>
10 years agoparam: use generate_param.py to generate s3_param.h
Garming Sam [Wed, 15 Jan 2014 04:52:41 +0000 (17:52 +1300)]
param: use generate_param.py to generate s3_param.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>
10 years agoparam: use generate_param.py to generate param_local.h
Garming Sam [Wed, 15 Jan 2014 04:45:46 +0000 (17:45 +1300)]
param: use generate_param.py to generate param_local.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>
10 years agoparam: use generate_param.py to generate param_global.h
Garming Sam [Wed, 15 Jan 2014 04:39:48 +0000 (17:39 +1300)]
param: use generate_param.py to generate param_global.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>
10 years agoparam: No longer have a special case for lp_configfile
Andrew Bartlett [Wed, 15 Jan 2014 04:29:57 +0000 (17:29 +1300)]
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>
10 years agolib/param: generate the param_functions.h containing the prototypes
Garming Sam [Wed, 15 Jan 2014 04:18:13 +0000 (17:18 +1300)]
lib/param: generate the param_functions.h containing the prototypes

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>
10 years agoparam: use generate_param.py to generate param_proto.h
Garming Sam [Wed, 15 Jan 2014 04:05:51 +0000 (17:05 +1300)]
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>
10 years agolib/param: explicitly use mode=FUNCTIONS when running generate_param.py
Garming Sam [Wed, 15 Jan 2014 03:54:29 +0000 (16:54 +1300)]
lib/param: explicitly use mode=FUNCTIONS when running generate_param.py

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>
10 years agolib/param: update generate_param.py to generate more of loadparm
Garming Sam [Wed, 15 Jan 2014 03:49:50 +0000 (16:49 +1300)]
lib/param: update generate_param.py to generate more of loadparm

These files can now be generated directly from the xml rather than from param_functions.c

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agolib/param: Remove special handling for 'state dir' and 'cache dir'
Andrew Bartlett [Wed, 15 Jan 2014 02:59:54 +0000 (15:59 +1300)]
lib/param: Remove special handling for 'state dir' and 'cache dir'

The build system gives these two parameters different defaults
(compared with lock dir) in both the --enable-fhs and default mode, so
the logic to use lock dir no longer applies unless the build has been
very specially constructed.

Therefore, remove the special case handling and make these normal
parameters again.

Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agolib/param: Normalise "read raw" and "write raw" parameters
Andrew Bartlett [Wed, 15 Jan 2014 01:48:40 +0000 (14:48 +1300)]
lib/param: Normalise "read raw" and "write raw" parameters

They have been changed to function like normal parameters,
removing a special case in the loadparm system.

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>
10 years agoparam: auto generate param_functions.c at build time
Garming Sam [Tue, 14 Jan 2014 04:53:49 +0000 (17:53 +1300)]
param: auto generate param_functions.c at build time

generate_param.py reads the documentation to define which functions need to
be generated.

To add new parameters, edit the xml files in docs-xml/smbdotconf.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agobuild: don't execute tests/summary.c
Gustavo Zacarias [Thu, 30 Jan 2014 20:59:48 +0000 (17:59 -0300)]
build: don't execute tests/summary.c

tests/summary.c will never be able to be executed when cross compiling.
Use #error and #warning directives to fail or warn accordingly when
compiling it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agos3: vfs_dirsort module.
Jeremy Allison [Tue, 11 Feb 2014 18:39:04 +0000 (10:39 -0800)]
s3: vfs_dirsort module.

Add raw.search torture test on a share definition with:

vfs objects = dirsort

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>