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

972 Commits

Author SHA1 Message Date
Stefan Metzmacher
27da35f8df CVE-2015-5370: s4:librpc/rpc: maintain dcecli_security->auth_{type,level,context_id}
This will simplify the following commits and avoids dereferencing
dcecli_security->auth_info.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:28 +02:00
Stefan Metzmacher
335b3cee5c CVE-2015-5370: s4:librpc/rpc: send a dcerpc_sec_verification_trailer if needed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:28 +02:00
Stefan Metzmacher
9085300e90 CVE-2016-2118: s4:librpc: use integrity by default for authenticated binds
ncacn_ip_tcp:server should get the same protection as ncacn_np:server
if authentication and smb signing is used.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2016-04-12 19:25:27 +02:00
Stefan Metzmacher
b6debbcfec CVE-2016-2115: s4:librpc/rpc: make use of "client ipc *" options for ncacn_np
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11756

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-04-12 19:25:26 +02:00
Stefan Metzmacher
45ff760cf3 CVE-2016-2113: s4:librpc/rpc: verify the rpc_proxy certificate and hostname if configured
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11752

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:25 +02:00
Stefan Metzmacher
64a9cd2a38 CVE-2016-2113: s4:lib/tls: implement infrastructure to do peer verification
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11752

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:25 +02:00
Stefan Metzmacher
5a397216d4 s4:librpc/rpc: dcerpc_generic_session_key() should only be available on local transports
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:31 +01:00
Stefan Metzmacher
960b0adfb3 s4:librpc/rpc: map alter context SEC_PKG_ERROR to NT_STATUS_LOGON_FAILURE
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:26 +01:00
Andrew Bartlett
9e07f3a13b pidl: Fix our python reference handling
The new talloc.BaseObject allow us to hold a talloc context per
python object (there may be many referring to the same C object)
and the talloc context that the actual object pointer is under.

Another advantage is that talloc.BaseObject(), has less of
an ABI surface.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Andrew Bartlett
627fdf0468 pyrpc: Clarify failure mode after pytalloc_reference_ex() improvements
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Andrew Bartlett
623bf4230c pyrpc: Add warning about abuse of py_return_ndr_struct()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:25 +01:00
Michael Adam
476672b647 dlist: remove unneeded type argument from DLIST_ADD_END()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Andrew Bartlett
516ec3005a pyrpc: Adjust to use of PY_SSIZE_T_CLEAN
This changes the type used for # arguments to PyArg_ParseTupleAndKeywords

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2016-01-07 23:33:10 +01:00
Andrew Bartlett
374d73617d lib/tls: Add new 'tls priority' option
This adds a new option to the smb.conf to allow administrators to disable
TLS protocols in GnuTLS without changing the code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11076
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-07-20 03:08:26 +02:00
Volker Lendecke
be9c4f9033 librpc: Fix a "ignoring asprint return" warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Stefan Metzmacher
ee5e25b5b3 librpc/idl: add winbind_LogonControl()
This will be used by the netr_LogonControl()
in order to contact remote domains via winbindd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
8c22f81e9b s4:librpc/rpc: add dcerpc_secondary_auth_connection()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
3cdac4a855 s4:pyrpc: remove pointless alter_context() method
This will always result in a rpc protocol error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
8c9612e114 s4:pyrpc: add base.bind_time_features_syntax(features)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
114c52e73e s4:librpc/rpc: fix padding caclucation in ncacn_push_request_sign()
This is simplified by using DCERPC_AUTH_PAD_LENGTH() and changes the behaviour
so that we will use no padding if the stub_length is already aligned
to DCERPC_AUTH_PAD_ALIGNMENT (16 bytes).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-23 14:38:53 +02:00
Stefan Metzmacher
48f2c383e1 s4:librpc/rpc: let ncacn_push_request_sign() handle sig_size == 0 with auth_info as internal error
Don't send plaintext on the wire because of an internal error...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-23 14:38:53 +02:00
Stefan Metzmacher
fc249d542f s4:librpc/rpc: let dcerpc_ship_next_request() use a sig_size for a padded payload
The sig_size could differ depending on the aligment/padding.
So should use the same alignment as we use for the payload.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-23 14:38:53 +02:00
Stefan Metzmacher
ef801bae95 s4:librpc/rpc: let dcerpc_ship_next_request() use DCERPC_AUTH_PAD_ALIGNMENT define
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11061

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-23 14:38:53 +02:00
Stefan Metzmacher
79b1041651 s4:librpc: add auth_type=ncalrpc_as_system as binding option
In future we may want another way to trigger this,
but our current rpc libraries need a lot of cleanup before.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-12 17:13:43 +01:00
Petr Viktorin
02980268e8 Remove use of the "staticforward" macro
This macro was used for compatibility with broken compilers.
Since Python 2.3, it is always defined as `static`, and only exists
"for source compatibility with old C extensions".

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-01-22 10:51:07 +01:00
Stefan Metzmacher
f65c1f0e2f s4:librpc: use authenticated epmapping for ncacn_http
We need to authenticate against the RpcProxy.
In future we could have a way to specify alternative credentials
for the RpcProxy and HttpProxy.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep 23 01:34:05 CEST 2014 on sn-devel-104
2014-09-23 01:34:05 +02:00
Samuel Cabrero
594d036afd ncacn_http: DCERPC pipe open using http transport
Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-09-22 23:09:08 +02:00
Samuel Cabrero
d617230888 ncacn_http: Client implementation
Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-09-22 23:09:08 +02:00
Volker Lendecke
7f36828fcc librpc: Fix a "ignoring asprintf return" warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date(master): Thu Jun  5 22:28:16 CEST 2014 on sn-devel-104
2014-06-05 22:28:16 +02:00
Stefan Metzmacher
13b36be68f s4:librpc/rpc: allow a shortcut in dcerpc_pipe_connect_ncacn_np_smb[2]_send()
If the caller provided smbXcli * pointers of an existing connection,
we can use it.

This will be used later in order to allow multiple dcerpc connections
over the same smb connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
a13eebac7d s4:librpc/rpc: split out continue_smb_open()
The smb and smb2 code pathes are the same.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
35192e8316 s4:librpc/rpc: remove pipe_np_smb2_state and use pipe_np_smb_state
There's no need for two almost identical structures.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
7ea04759d7 s4:librpc/rpc: remember some smbXcli_* pointers within struct dcerpc_pipe_connect
This will simplify further improvements.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
ae406ac668 s4:librpc/rpc: use DCERPC_REQUEST_TIMEOUT for smb opens
There's no need to make the connect timeout dynamic.
We implicitly used SMB_REQUEST_TIMEOUT which is also 60 seconds before.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
d1b5016572 s4:librpc/rpc: remove some unused functions and structures from dcerpc_sock.c
Now we just dcerpc_sock.c doesn't need to maintain 'struct sock_private'
in p->transport.private_data anymore, we're just using a raw tstream_context
as p->transport.stream.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
e4f7b90295 s4:librpc/rpc: avoid using dcerpc_socket_peer_addr()
We use information stored in the dcerpc_binding in order
to open a secondary connection.

The goals are:
- dcerpc_secondary_connection_* should just use the dcerpc_binding
  information for the first connection and just call dcerpc_pipe_connect_*
- Get rid of dcerpc_pipe->transport.* and just use a tstream_context.
  All other details should be maintained only by the higher levels.
- Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle.
- Have just one entry point to create a new connection. For source4/librpc
  this will be dcerpc_pipe_connect_*. For source3/rpc_client we need
  a similar function.
- We'll have a new dcerpc_connection layer, with also just one
  entry point to create a new connection.
- Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer.
- Replace rpc_pipe_client with the new dcerpc_connection layer.
- When the client side is unified we can change the server
  as it needs to act as a client in order to register the endpoint mappings.
- Then the core of the server will be changed to use the new dcerpc_connection
  layer.

As dcerpc_socket_peer_addr() uses p->transport.private_data
as 'struct sock_private', we should avoid it.
We can then remove dcerpc_unix_socket_path() and 'struct sock_private'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:28 +02:00
Stefan Metzmacher
3aebaf4c13 s4:librpc/rpc: set "localaddress" and reset "host" for ncacn_ip_tcp
We should remember local and remote ip address in dcerpc_pipe->binding.

Note: that we still have the "target_hostname" unmodified, if present.

This way dcerpc_pipe->binding can be used to create a secondary connection
that is a additional connection for the existing association group.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Stefan Metzmacher
374c5c4109 s4:librpc/rpc: return the local/remote ip from dcerpc_pipe_open_tcp_recv()
It's important that the caller can remember the ips,
so that a secondary connection can use the same addresses
in order to get association group binding to work.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Stefan Metzmacher
4c11fa68d4 s4:librpc/rpc: optionally return the local address from dcerpc_pipe_open_socket_recv()
The caller should be able to remember the local address that was used
for the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Stefan Metzmacher
dfee057447 s4:librpc/rpc: avoid using dcerpc_unix_socket_path()
We use information stored in the dcerpc_binding in order
to open a secondary connection.

The goals are:
- dcerpc_secondary_connection_* should just use the dcerpc_binding
  information for the first connection and just call dcerpc_pipe_connect_*
- Get rid of dcerpc_pipe->transport.* and just use a tstream_context.
  All other details should be maintained only by the higher levels.
- Hide dcerpc_pipe and dcecli_connection behind dcerpc_binding_handle.
- Have just one entry point to create a new connection. For source4/librpc
  this will be dcerpc_pipe_connect_*. For source3/rpc_client we need
  a similar function.
- We'll have a new dcerpc_connection layer, with also just one
  entry point to create a new connection.
- Replace dcerpc_pipe and dcecli_connection with the new dcerpc_connection layer.
- Replace rpc_pipe_client with the new dcerpc_connection layer.
- When the client side is unified we can change the server
  as it needs to act as a client in order to register the endpoint mappings.
- Then the core of the server will be changed to use the new dcerpc_connection
  layer.

As dcerpc_unix_socket_path() uses p->transport.private_data
as 'struct sock_private', we should avoid it.
We can then remove dcerpc_unix_socket_path() and 'struct sock_private'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-26 03:31:27 +02:00
Andrew Bartlett
6cbf3ecd66 s4:pyrpc: explicitly use dcerpc_binding_handle_set_sync_ev() for irpc
This indicates that we may use nested event loops...

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: Id014dcc68699c86cb99015a91a6979e30795f727
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-05-13 00:08:12 +02:00
Stefan Metzmacher
0dd648a54e s4:librpc/rpc: remember "ncalrpc_dir" on the dcerpc_pipe->binding
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 28 10:34:51 CET 2014 on sn-devel-104
2014-03-28 10:34:51 +01:00
Stefan Metzmacher
6d6427b7c8 s4:pyrpc: add base.transfer_syntax_ndr*()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-28 08:34:25 +01:00
Stefan Metzmacher
ae02bf6f06 s4:pyrpc: add py_dcerpc_syntax_init_helper()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-28 08:34:25 +01:00
Stefan Metzmacher
4f0d5981f1 s4:librpc: compile python bindings for dcerpc.idl
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-28 08:34:25 +01:00
Stefan Metzmacher
0153c013fc s4:librpc: make use of gensec_update_ev()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-27 00:36:31 +01:00
Stefan Metzmacher
547111b2cf s4:librpc/rpc: use dcerpc_binding_get_object() in order to pass the object to the epmapper
This way we'll be able to do epmapper lookups for the DFS-R (MS-FRS2) endpoint, by using
"5bc1ed07-f5f5-485f-9dfd-6fd0acf9a23c@ncacn_ip_tcp:hostname.exmple.com[krb5,seal]"
as binding.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 25 02:43:39 CET 2014 on sn-devel-104
2014-03-25 02:43:39 +01:00
Stefan Metzmacher
dbf37008e0 s4:librpc/rpc: correctly map the fault code of alter context to NTSTATUS
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Stefan Metzmacher
c2f731e324 s4:librpc/rpc: remove unused dcecli_connection->binding_string
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Stefan Metzmacher
bf1e65ceb8 s4:pyrpc: let dcerpc_interface_new() use py_dcerpc_interface_init_helper()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Feb 17 21:39:30 CET 2014 on sn-devel-104
2014-02-17 21:39:30 +01:00
Stefan Metzmacher
4f31b3db35 s4:pyrpc: fix talloc hierachy in py_dcerpc_interface_init_helper()
The tevent_context is cached under the connection,
so we need to make sure it stays arround as long as the connection.

Otherwise it will segfault while dereferencing the tevent_context
on deallocation if a secondary connection is arround.

This completes commit 4cc3388c03,
which only fixed it in dcerpc_interface_new().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-17 13:35:38 +01:00
Stefan Metzmacher
4d4e4ef619 s4:librpc/rpc: make dcerpc_pipe->binding const
This should not be changed after the connection is
ready for requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
0cc3e945b5 s4:librpc/rpc: pass dcerpc_binding arround as 'const'
This should only be modified by the owner.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
30fa344604 s4:librpc/rpc: only pass down dcecli_connection to the low level connect functions
They don't need dcerpc_pipe.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
2a68f5d4dd s4:librpc/rpc: don't create a ncacn_np: binding
It's up to the caller to store the dcerpc_pipe->binding.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
79c76ee54d s4:librpc/rpc: use dcerpc_binding_get_string_option() for "host" and "target_hostname"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
4afe367c08 s4:librpc/rpc: use dcerpc_binding_get_string_option("target_principal")
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
f309d67fcd s4:librpc/rpc: make use of dcerpc_binding_get_string_option("endpoint")
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:18 +01:00
Stefan Metzmacher
26c2a27c2d s4:librpc/rpc: make use of dcerpc_binding_get_flags()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-13 11:54:17 +01:00
Stefan Metzmacher
00073465df 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>
2014-02-13 11:54:16 +01:00
Stefan Metzmacher
a281574c9f 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>
2014-02-13 11:54:15 +01:00
Stefan Metzmacher
cef6b2d9d7 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>
2014-02-13 11:54:15 +01:00
Stefan Metzmacher
16de18e5a2 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>
2014-02-13 11:54:15 +01:00
Stefan Metzmacher
c50664f68f 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>
2014-02-13 11:54:15 +01:00
Stefan Metzmacher
8ccebf3a27 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>
2014-02-13 11:54:15 +01:00
Stefan Metzmacher
91a367dce5 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>
2014-02-13 11:54:14 +01:00
Stefan Metzmacher
1228a935ac 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>
2014-02-13 11:54:13 +01:00
Stefan Metzmacher
e42a674625 s4:librpc/rpc: make use of dcerpc_binding_dup() in dcerpc_epm_map_binding_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:32 +01:00
Stefan Metzmacher
4340590ae9 s4:librpc/rpc: fix memory hierachie in dcerpc_epm_map_binding_send()
We should allocate on 's' the internal state, not on the callers
mem_ctx.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:32 +01:00
Stefan Metzmacher
4cf691ce1f s4:librpc/rpc: avoid some indentation levels in dcerpc_epm_map_binding_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:32 +01:00
Stefan Metzmacher
6e813ab897 s4:librpc/rpc: use dcerpc_binding_dup() in dcerpc_schannel_key_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:32 +01:00
Stefan Metzmacher
327c060666 s4:librpc/rpc: remove prototypes which are already in librpc/rpc/rpc_common.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:28 +01:00
Stefan Metzmacher
d791f3354e s4:librpc/rpc: use the correct _recv function in continue_open_pipe()
We start with dcerpc_pipe_open_unix_stream_send() so we need
to call dcerpc_pipe_open_unix_stream_recv().

It was just luck that it worked before...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:28 +01:00
Stefan Metzmacher
2e093cc0cc s4:librpc/rpc: only propose header signing if we use sign or seal
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:02:14 +01:00
Stefan Metzmacher
1137d62d9d s4:librpc/rpc: add forward declaration for struct resolve_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:02:14 +01:00
Garming Sam
63c24977ba param: rename lp function and variable from 'lockdir' to 'lock_directory'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:10 -08: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
9b2dc0e46c s4:librpc: remove dcerpc_event_context()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-01-16 16:22:52 +01:00
Gregor Beck
6b586c3cf6 s4:librpc: remove recv_data from transport
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan  7 12:42:32 CET 2014 on sn-devel-104
2014-01-07 12:42:32 +01:00
Gregor Beck
9d2557d6e4 s4:librpc: factor out xxx_send_request() to dcerpc_send_request()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:46 +01:00
Gregor Beck
445913133a s4:librpc: factor out xxx_send_read() to dcerpc_send_read()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:46 +01:00
Gregor Beck
9832eb6bbf s4:librpc: factor out xxx_shutdown_pipe() to dcerpc_shutdown_pipe()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:46 +01:00
Gregor Beck
30ca477c71 s4:librpc: factor out xxx_dead() to dcerpc_transport_dead()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:46 +01:00
Gregor Beck
3193c27256 s4:librpc: remove server_name from transport
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:45 +01:00
Stefan Metzmacher
383ba3dacf s4:librpc: make 'struct dcerpc_pipe_connect' private
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:45 +01:00
Stefan Metzmacher
27d0d32105 s4:librpc: remove unused dcerpc_smb2.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:45 +01:00
Stefan Metzmacher
a9bb84c4b0 s4:librpc: implement dcerpc_pipe_open_smb2() in dcerpc_smb.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:45 +01:00
Stefan Metzmacher
7352f7f91d s4:librpc: make use of dcerpc_pipe_open_smb_send/recv for SMB2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:44 +01:00
Stefan Metzmacher
45fc961932 s4:librpc: pass dcecli_connection instead of dcerpc_pipe to dcerpc_secondary_smb_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:44 +01:00
Stefan Metzmacher
bebc05a973 s4:librpc: use dcerpc_binding_dup() instead of talloc_reference()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:44 +01:00
Stefan Metzmacher
a08ee93a2f s4:librpc: pass smbXcli_{conn,session,tcon} to dcerpc_pipe_open_smb_send()
This will allow it to be used also for smb2 later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:44 +01:00
Stefan Metzmacher
f7b1ff2cf4 s4:librpc: don't talloc_reference smbcli_tree
It's the job of the caller to make sure it stays for the
whole lifetime of the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:43 +01:00
Stefan Metzmacher
e6474ba2c2 s4:librpc: keep smbcli_tree/smb2_tree as talloc child of dcecli_connection
This will avoid the need of talloc_reference later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:43 +01:00
Gregor Beck
d230f73e97 s4:librpc: use tstream_smbXcli_np in dcerpc_smb.c
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:43 +01:00
Gregor Beck
2ec65ea1e7 s4:librpc: use tstream in dcerpc_sock.c
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:43 +01:00
Stefan Metzmacher
01ea63e1a1 s4:librpc: make it possible for the transport to specify the max_xmit/recv_size
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:42 +01:00
Stefan Metzmacher
d821661484 s4:librpc/rpc: update alloc_hint for each fragment
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:36 +01:00
Stefan Metzmacher
ce84ade56c s4:librpc/rpc: remove unused rpc_request->ndr structure
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:36 +01:00