From 22e3004829fe742efdbf750611749b9aaf585515 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 29 Jan 2009 22:54:55 +0100 Subject: Add the "SMBD" rpc transport The idea of this is that all client utils like smbpasswd and also for example "net join" do not access our internal databases like passdb and secrets.tdb directly anymore but pass everything throught the well-established RPC interfaces. The way you use this is the following: With rpc_cli_smbd_conn_init() or its async variant you initialize a "struct rpc_cli_smbd_conn". This structure is the link to a freshly forked smbd, ready to be used for RPC services. You should only ever have one such structure in your program. More don't hurt, but are plainly unnecessary. If you want to use the SAMR pipe to change a passwort, you connect to that pipe with rpc_pipe_open_local. Do you normal rpccli_samr calls on that and your locally forked smbd will connect to passdb for you. GD, this might make the distinction between the _l and _r calls in libnetapi mostly unnecessary. At least it is intended to do so... :-) --- source3/include/proto.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source3/include/proto.h') diff --git a/source3/include/proto.h b/source3/include/proto.h index 60e80bd87d..d30eb09f6a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5326,6 +5326,10 @@ NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli, NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli, DATA_BLOB *session_key); +NTSTATUS rpc_pipe_open_local(TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn *conn, + const struct ndr_syntax_id *syntax, + struct rpc_pipe_client **presult); /* The following definitions come from rpc_client/rpc_transport_np.c */ @@ -5341,6 +5345,36 @@ NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli, struct rpc_cli_transport **presult); struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p); +/* The following definitions come from rpc_client/rpc_transport_smbd.c */ + +struct async_req *rpc_cli_smbd_conn_init_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + void (*stdout_callback)(char *buf, + size_t len, + void *priv), + void *priv); +NTSTATUS rpc_cli_smbd_conn_init_recv(struct async_req *req, + TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn **pconn); +NTSTATUS rpc_cli_smbd_conn_init(TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn **pconn, + void (*stdout_callback)(char *buf, + size_t len, + void *priv), + void *priv); + +struct async_req *rpc_transport_smbd_init_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct rpc_cli_smbd_conn *conn, + const struct ndr_syntax_id *abstract_syntax); +NTSTATUS rpc_transport_smbd_init_recv(struct async_req *req, + TALLOC_CTX *mem_ctx, + struct rpc_cli_transport **presult); +NTSTATUS rpc_transport_smbd_init(TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn *conn, + const struct ndr_syntax_id *abstract_syntax, + struct rpc_cli_transport **presult); + /* The following definitions come from rpc_client/rpc_transport_sock.c */ NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd, -- cgit