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

181 Commits

Author SHA1 Message Date
Isaac Boukris
339bfcd67a Add dcerpc_transport_encrypted()
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-11-06 10:02:35 +00:00
Andrew Bartlett
1af1ebe54a librpc: Unify packet dumping on ndr_pull() failure
There were two duplicate implementations of packet dumping just for the s4 RPC server!

This unifies them and makes them easier to find because they are not triggered
from the generated server stub any more.

The behaviour have unified on setting "dcesrv:stubs directory" and
being compiled with --enable-developer.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Nov 20 02:14:56 UTC 2019 on sn-devel-184
2019-11-20 02:14:56 +00:00
Andrew Bartlett
71cc89833f libnet: Remove unused source4/libnet/libnet_sam{dump,sync}:
The last caller was removed in samba-tool: Remove C version of samba-tool
(e2af384151) by Amitay Isaacs in 2011

This was a tool to dump a genine NT4 DC (never Samba) into smbpasswd file.

It did work against Windows AD, but DRS replication is much
more comprehensive.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>

Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon May  6 07:11:51 UTC 2019 on sn-devel-184
2019-05-06 07:11:51 +00:00
Stefan Metzmacher
27aacf9288 Revert "s4:librpc: simplify dcerpc_connect_timeout_handler() logic"
This reverts commit 2c3e99d169.

As the source4 backends for kerberos still use nested event loops,
we need to restore this for now.

We should reapply this once all backends are fully async.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-05-30 08:06:07 +02:00
Stefan Metzmacher
2c3e99d169 s4:librpc: simplify dcerpc_connect_timeout_handler() logic
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-05-21 21:05:13 +02:00
Stefan Metzmacher
b5abc7cadc s4:librpc/rpc: pass the object guid to the binding handle if required
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-10-26 11:20:18 +02:00
Stefan Metzmacher
6917a1c28f s4:librpc/rpc: implement bind_time_feature negotiation
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-10-26 11:20:13 +02:00
Stefan Metzmacher
7413e73c53 s4:librpc/rpc: allow a total reassembled response payload of 240 MBytes
This will replace DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte),
The limit of DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte) was too
strict for some workloads, e.g. DRSUAPI replication with large objects.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-06-23 00:50:17 +02:00
Stefan Metzmacher
ace23643d1 CVE-2015-5370: s4:librpc/rpc: avoid using dcecli_security->auth_info and use per request values
We now avoid reusing the same auth_info structure for incoming and outgoing
values. We need to make sure that the remote server doesn't overwrite our own
values.

This will trigger some failures with our currently broken server,
which will be fixed in the next commits.

The broken server requires an dcerpc_auth structure with no credentials
in order to do an alter_context request that just creates a presentation
context without doing authentication.

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
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
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
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
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
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
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
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
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
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
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
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
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
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
d610339028 s4:librpc/rpc: remove unused dcerpc_smb_tree()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:55 +13:00
Stefan Metzmacher
07ec60ce72 s4:librpc/rpc: add dcerpc_secondary_smb_send/recv()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:54 +13:00
Stefan Metzmacher
ecb3150587 s4:librpc/rpc: remove unused dcerpc_smb_fnum()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:53 +13:00
Andrew Bartlett
02a356ea77 s4-librpc: Ensure we do not call call the decrpc timeout handler during gensec_update()
This avoids a situation where we could destroy pointers on the stack due to
a nested event loop.

This is certainly not a final, generic solution, but it is a minimal change
while we work to make gensec and gensec_gssapi async.

Andrew Bartlett
2012-07-18 09:32:53 +02:00
Stefan Metzmacher
080549f467 s4:librpc/rpc: ship requests via an immediate event
Deep inside dcerpc_ship_next_request() some code path
could trigger dcerpc_connection_dead(), which means
it's not safe to do any processing after calling dcerpc_ship_next_request().

metze
2012-03-15 07:35:28 +01:00
Andrew Bartlett
907cdb5de7 s4-modules Remove lp_ctx from init functions that no longer need it
Now that we don't allow the smb.conf to change the modules dir, many
functions that simply load modules or initialise a subsytem that may
load modules no longer need an lp_ctx.

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Günther Deschner
b903c28939 librpc: bring more librpc prototypes in common.
Guenther
2011-03-23 23:59:11 +01:00
Stefan Metzmacher
72c1fe0081 librpc/rpc: move DCERPC_ flags to rpc_common.h
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Mar 13 20:45:53 CET 2011 on sn-devel-104
2011-03-13 20:45:53 +01:00
Stefan Metzmacher
c1a2fd1cd1 s4:librpc/rpc: finaly make struct rpc_request and enum rpc_request_state private
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Mar 13 17:46:02 CET 2011 on sn-devel-104
2011-03-13 17:46:02 +01:00
Stefan Metzmacher
81063f9a26 s4:librpc/rpc: remove unused dcerpc_request()
metze
2011-03-13 17:01:00 +01:00
Stefan Metzmacher
08dca92499 librpc/rpc: move struct dcerpc_binding to rpc_common.h
metze
2011-03-13 16:53:05 +01:00
Stefan Metzmacher
83c55ac67e librpc/rpc: move enum dcerpc_transport_t to rpc_common.h
metze
2011-03-13 16:33:06 +01:00
Stefan Metzmacher
b0d54da746 s4:librpc/rpc: s/dcerpc_security/dcecli_security
We'll use 'dcerpc_security' for the generic dcerpc
client and server code.

metze
2011-03-13 16:33:06 +01:00
Stefan Metzmacher
4d4c6315fa s4:librpc/rpc: remove unused dcerpc_ndr_request* code
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Mar 13 11:19:59 CET 2011 on sn-devel-104
2011-03-13 11:19:59 +01:00
Stefan Metzmacher
b738e092a2 librpc/rpc: move dcerpc_binding_handle stuff to rpc_common.h
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Mar 11 12:28:08 CET 2011 on sn-devel-104
2011-03-11 12:28:08 +01:00
Stefan Metzmacher
c774a50aaf s4:librpc/rpc: s/struct dcerpc_connection/struct dcecli_connection/g
The name 'struct dcerpc_connection' will be used in the new generic
dcerpc code. It will be used for client and server.

metze
2011-03-11 11:02:23 +01:00
Andrew Tridgell
9bae4cd3d9 s4-rpc: added target_principal binding handle option
this allows you to specify a target SPN for a connection

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-01 22:31:57 -07:00
Julien Kerihuel
e5e5a1110f Add unique IP address binding for client connections (EPM and ncacn_ip_tcp levels)
This allows for binding strings like this:

  ncacn_ip_tcp:host[localaddress=192.168.2.1,seal]

which will force the connection to be locally bound to the specified
IP address

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-07 09:55:14 +10:00
Stefan Metzmacher
54d2dce7b1 librpc/rpc: add dcerpc_binding_handle_set_timeout()
metze
2010-09-04 09:01:19 +02:00