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

173 Commits

Author SHA1 Message Date
Günther Deschner
313a2bfa52 s3-netlogon: remove init_netr_SamInfo functions.
Guenther
2009-06-25 12:19:17 +02:00
Günther Deschner
f62d9f5b57 s3-netlogon: fix validation level 2 support in netr_SamLogon and friends.
Guenther
2009-06-25 12:19:10 +02:00
Volker Lendecke
a8e02b591b Add "err_on_readability" to writev_send
A socket where the other side has closed only becomes readable. To catch
errors early when sitting in a pure writev, we need to also test for
readability.
2009-05-24 13:47:29 +02:00
Volker Lendecke
8bc88aae5d Move serverinfo_to_SamInfo3() to rpc_server/
Normally I hate moving around stuff, but this function is only called from the
RPC server side and it pulls in passdb when trying to link in our rpc client
routines. That seems unnecessary to me.
2009-04-22 12:33:46 +02:00
Volker Lendecke
4b88f2c17e Fix external np read after conversion to tevent_req 2009-03-27 21:12:17 +01:00
Volker Lendecke
bce98d8c03 Convert np_read to tevent_req 2009-03-17 17:31:22 +01:00
Volker Lendecke
89543d6c78 Convert np_write to tevent_req 2009-03-17 17:31:22 +01:00
Volker Lendecke
fe486d7b9f Add "queue" to writev_send
Unless higher levels queue themselves somehow, writev will *always* be queued.
So the queueing should be done at the right level.
2009-03-08 11:20:59 +01:00
Simo Sorce
67d41d0fc7 Make struct tevent_req opaque
Move struct tevent_req in tevent_internal, and ad getters and setters
for private data and the callback function.
This patch also renames 'private_state' into 'data'. What is held in this
pointer is in fact data and not a state like enum tevent_req_state.
Calling it 'state' is confusing.

The functions addedd are:
tevent_req_set_callback() - sets req->async.fn and req->async.private_data
tevent_req_set_print_fn() - sets req->private_print
tevent_req_callback_data() - gets req->async.private_data
tevent_req_data() - gets rea->data

This way it is much simpler to keep API/ABI compatibility in the future.
2009-03-02 11:02:09 -05:00
Volker Lendecke
5d653f69de Replace read_pkt by read_packet in np_read 2009-02-24 20:40:47 +01:00
Volker Lendecke
70f788ba7e Use async_writev in np_write 2009-02-24 20:40:47 +01:00
Jeremy Allison
49b52ec16f Parameterize in local.h the MAX_RPC_DATA_SIZE, and ensure
that "offered" read from the rpc packet in spoolss is under
that size. Tidyup from analysis from Veracode.
Jeremy.
2009-02-13 16:06:17 -08:00
Volker Lendecke
bbb665501a Add queueing to np_write 2009-02-10 18:29:34 +01:00
Volker Lendecke
f6e9f1e7ea Add queueing to np_read_state, simulate message-type named pipes.
The problem with msg-type pipes is that we have to return short reads when a
message ends before the read request. When reading from the unix domain socket,
the message limits are lost. So we would happily return more than a message,
which confuses for example the s4 rpc client horribly. I'd expect other np rpc
clients also to blow up over this.

The real solution is to properly implement a two-byte length field per message
on the unix domain socket, but this requires more changes there. And as we
right now only serve DCE/RPC over the named pipes, this implements a hack that
looks into the fragment headers to figure out hdr.frag_len.
2009-02-10 18:29:34 +01:00
Kai Blin
c3b9b6c8aa async_sock: Use unix errnos instead of NTSTATUS
This also switches wb_reqtrans to use wbcErr instead of NTSTATUS as it would
be pointless to convert to errno first and to wbcErr later.
2009-02-09 08:36:08 +01:00
Volker Lendecke
3a4c8cd492 Make prs_struct->out_data.current_pdu dynamically allocated
Another 4k per open pipe
2009-02-08 13:53:50 +01:00
Volker Lendecke
32a7529243 Most RPC requests do not need a full fragment, start smaller 2009-02-08 13:53:49 +01:00
Volker Lendecke
51dc7b9d82 Make current_in_pdu in pipes_struct allocated
This makes an open pipe about 4K cheaper
2009-02-07 19:25:34 +01:00
Volker Lendecke
a66828a37f Don't use recvall in the proxied np_read_send
We don't know how much we will get. Resort to a single recv syscall
2009-02-05 11:16:03 +01:00
Volker Lendecke
94d1dbbaf0 Restore correct handling of "is_data_available" for the socket transport
This fixes a valgrind error reading an uninitialized variable
2009-02-04 22:36:43 +01:00
Volker Lendecke
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00
Volker Lendecke
7967d8c779 Move rpc_pipe_open_internal to srv_pipe_hnd.c
This is a smbd-only function
2009-02-01 14:34:23 +01:00
Volker Lendecke
53394980ad Replace pipe names in pipes_struct by ndr_syntax_id
This was mainly used for debugging output
2009-02-01 14:34:23 +01:00
Volker Lendecke
99f021d0ef Fix the build on Solaris CC 2009-02-01 00:07:16 +01:00
Volker Lendecke
fa7ddc78b8 Remove unused np_read sync wrapper 2009-01-31 17:50:18 +01:00
Volker Lendecke
8b480b52ce Remove unused np_write sync wrapper 2009-01-31 17:50:18 +01:00
Volker Lendecke
e8b2b46cae Make-np_write-handle-0-byte-writes-as-NT_STATUS_OK 2009-01-31 17:50:18 +01:00
Volker Lendecke
b797c056a6 Add an async np_read wrapper 2009-01-31 17:50:18 +01:00
Volker Lendecke
e60d69d67d Add an async np_write wrapper 2009-01-31 17:50:18 +01:00
Volker Lendecke
520f88143b Remove some unused code 2009-01-20 16:41:32 +01:00
Volker Lendecke
b8b6cddb29 Remove some smb fsp knowledge from rpc_server/
np_open/read/write don't have to know about files_struct
2009-01-20 16:41:14 +01:00
Volker Lendecke
bd4718d281 Make use of TALLOC_FREE 2009-01-20 14:34:51 +01:00
Volker Lendecke
141b76d747 Remove unused argument "vuid" from make_internal_rpc_pipe_p 2009-01-03 15:25:00 +01:00
Volker Lendecke
2bb90b7a88 Remove "conn" parameter from np_open, smb_request contains it 2008-11-28 10:06:32 +01:00
Volker Lendecke
907f126d3e Get rid of pipes_struct->pipe_user, we have server_info now --- YESSS! 2008-11-24 11:39:03 +01:00
Volker Lendecke
ace87f16c0 For proxied named pipes, connect to np/<pipe_name> and send auth info
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-11-06 21:39:15 +01:00
Volker Lendecke
63da08d00f Apply some const to np_write() 2008-11-01 19:41:07 +01:00
Volker Lendecke
7bea6684c2 Add proxied named pipe support
This is a central piece of the "merged build" thing: Forward named pipes from
samba3 to samba4. This patch is not finished yet, as we will have to forward
the smb-level authentication information to samba4, but I'm pushing this patch
already to demonstrate the implementation without clutter.

It adds an intermediate parameter

np:proxy = srvsvc samr winreg wkssvc ... and so on

that states which of the pipes should be forwarded to the s4 unix domain socket
DEFAULT. The parameter is intermediate because once we have a proper endpoint
mapper implementation, this information will be retrieved out of a database.

If anybody wants to try this, do the merged build and configure s4 with

server services = samba3_smb, rpc, nbt, wrepl, ldap, cldap, kdc, drepl
samba3:smbd = /data/inst/sbin/smbd

and s3 with

auth methods = guest netlogond
np:proxy = srvsvc samr winreg wkssvc netlogon ntlsa ntsvcs lsass lsarpc netdfs \
rpcecho initshutdown epmapper svcctl eventlog drsuapi

Then run rpcclient against samba4. It will fork s3, which authenticates against
s4, and then forwards the rpc requests to s4.

Volker
2008-10-25 15:42:51 +02:00
Volker Lendecke
f87219d6e6 Move the is_known_pipename check into np_open 2008-10-25 15:23:36 +02:00
Volker Lendecke
ff211be696 Remove "pipe_handle_offset" -- pipes now use "struct files_struct" 2008-10-25 12:09:58 +02:00
Volker Lendecke
2b1bef7e87 Remove the current_spoolss_pipes_open thingy.
I looked at a checkout from 2002 and even there it did not what it was supposed
to do. Sadly this also removes one of the nicest comments in the whole Samba
code :-)
2008-10-13 20:59:35 +02:00
Volker Lendecke
76dfca1569 Make the internal pipe functions static 2008-10-13 20:59:34 +02:00
Volker Lendecke
a781b78417 Remove smb_np_struct 2008-10-13 20:59:33 +02:00
Volker Lendecke
ac126ea818 Use "struct files_struct" for pipes instead of smb_np_struct 2008-10-13 20:59:32 +02:00
Volker Lendecke
756b4b6048 Revert "Make get_rpc_pipe() static"
This reverts commit f25972832e.
2008-10-12 12:16:18 +02:00
Volker Lendecke
f25972832e Make get_rpc_pipe() static 2008-10-12 11:45:33 +02:00
Volker Lendecke
6b98c1b159 Remove unused #defines 2008-10-12 11:45:26 +02:00
Jeremy Allison
e29e81624e Fix duplicate gloabl warning.
Jeremy.
(This used to be commit 6da33797b0)
2008-07-30 15:01:33 -07:00
Volker Lendecke
33cbe2f88c make read/write to internal pipes available externally
(This used to be commit e11b5cb1e0)
2008-07-26 13:20:10 +02:00
Volker Lendecke
a803f0a920 Refactoring: Make close_internal_rpc_pipe_hnd a talloc destructor
(This used to be commit 10b47a0c2c)
2008-07-26 13:20:10 +02:00