summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /source4/librpc
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/opendb.idl2
-rw-r--r--source4/librpc/idl/s4_notify.idl58
-rw-r--r--source4/librpc/idl/server_id4.idl12
-rw-r--r--source4/librpc/idl/wscript_build4
-rw-r--r--source4/librpc/rpc/dcerpc.c4
-rw-r--r--source4/librpc/rpc/dcerpc.h2
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c32
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c51
-rw-r--r--source4/librpc/rpc/pyrpc_util.c6
-rwxr-xr-xsource4/librpc/wscript_build22
10 files changed, 35 insertions, 158 deletions
diff --git a/source4/librpc/idl/opendb.idl b/source4/librpc/idl/opendb.idl
index 4973cd0982..b76992960a 100644
--- a/source4/librpc/idl/opendb.idl
+++ b/source4/librpc/idl/opendb.idl
@@ -7,7 +7,7 @@
ntvfs/common/opendb.c
*/
-import "server_id4.idl";
+import "server_id.idl";
[
pointer_default(unique)
diff --git a/source4/librpc/idl/s4_notify.idl b/source4/librpc/idl/s4_notify.idl
deleted file mode 100644
index 89ade2991c..0000000000
--- a/source4/librpc/idl/s4_notify.idl
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "idl_types.h"
-
-/*
- IDL structures for notify change code
-
- this defines the structures used in the notify database code, and
- the change notify buffers
-*/
-
-import "server_id4.idl";
-
-[
- pointer_default(unique)
-]
-interface notify
-{
-
- /* structure used in the notify database */
- typedef [public] struct {
- server_id server;
- uint32 filter; /* filter to apply in this directory */
- uint32 subdir_filter; /* filter to apply in child directories */
- utf8string path;
- uint32 path_len; /* saves some computation on search */
- pointer private_data;
- } notify_entry;
-
- /*
- to allow for efficient search for matching entries, we
- divide them by the directory depth, with a separate array
- per depth. The entries within each depth are sorted by path,
- allowing for a bisection search.
-
- The max_mask and max_mask_subdir at each depth is the
- bitwise or of the filters and subdir filters for all entries
- at that depth. This allows a depth to be quickly skipped if
- no entries will match the target filter
- */
- typedef struct {
- uint32 max_mask;
- uint32 max_mask_subdir;
- uint32 num_entries;
- notify_entry entries[num_entries];
- } notify_depth;
-
- typedef [public] struct {
- uint32 num_depths;
- notify_depth depth[num_depths];
- } notify_array;
-
- /* structure sent between servers in notify messages */
- typedef [public] struct {
- uint32 action;
- utf8string path;
- pointer private_data;
- } notify_event;
-
-}
diff --git a/source4/librpc/idl/server_id4.idl b/source4/librpc/idl/server_id4.idl
deleted file mode 100644
index 486143546b..0000000000
--- a/source4/librpc/idl/server_id4.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-[
- pointer_default(unique)
-]
-interface server_id
-{
- /* id used to identify a endpoint, possibly in a cluster */
- typedef [public] struct {
- hyper id;
- uint32 id2;
- uint32 node;
- } server_id;
-}
diff --git a/source4/librpc/idl/wscript_build b/source4/librpc/idl/wscript_build
index 6fe3690b33..59b16766ea 100644
--- a/source4/librpc/idl/wscript_build
+++ b/source4/librpc/idl/wscript_build
@@ -5,8 +5,8 @@ import os
topinclude=os.path.join(bld.srcnode.abspath(), 'librpc/idl')
bld.SAMBA_PIDL_LIST('PIDL',
- source='''irpc.idl nfs4acl.idl s4_notify.idl ntp_signd.idl
- opendb.idl sasl_helpers.idl server_id4.idl winbind.idl
+ source='''irpc.idl nfs4acl.idl ntp_signd.idl
+ opendb.idl sasl_helpers.idl winbind.idl
winsif.idl winsrepl.idl winstation.idl''',
options="--includedir=%s --header --ndr-parser --client --python --server" % topinclude,
output_dir='../gen_ndr')
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index cc72866866..110da57c93 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -76,9 +76,9 @@ struct rpc_request {
} async;
};
-_PUBLIC_ NTSTATUS dcerpc_init(struct loadparm_context *lp_ctx)
+_PUBLIC_ NTSTATUS dcerpc_init(void)
{
- return gensec_init(lp_ctx);
+ return gensec_init();
}
static void dcerpc_connection_dead(struct dcecli_connection *conn, NTSTATUS status);
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index 5ca6246343..22afdf880f 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -198,7 +198,7 @@ NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
struct loadparm_context *lp_ctx,
uint8_t auth_level);
struct tevent_context *dcerpc_event_context(struct dcerpc_pipe *p);
-NTSTATUS dcerpc_init(struct loadparm_context *lp_ctx);
+NTSTATUS dcerpc_init(void);
struct smbcli_tree *dcerpc_smb_tree(struct dcecli_connection *c);
uint16_t dcerpc_smb_fnum(struct dcecli_connection *c);
NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 842ef43206..c236399b52 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -186,16 +186,18 @@ static void continue_pipe_open_smb2(struct composite_context *ctx)
/*
Stage 2 of ncacn_np_smb2: Open a named pipe after successful smb2 connection
*/
-static void continue_smb2_connect(struct composite_context *ctx)
+static void continue_smb2_connect(struct tevent_req *subreq)
{
struct composite_context *open_req;
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
+ struct composite_context *c =
+ tevent_req_callback_data(subreq,
+ struct composite_context);
struct pipe_np_smb2_state *s = talloc_get_type(c->private_data,
struct pipe_np_smb2_state);
/* receive result of smb2 connect request */
- c->status = smb2_connect_recv(ctx, c, &s->tree);
+ c->status = smb2_connect_recv(subreq, c, &s->tree);
+ TALLOC_FREE(subreq);
if (!composite_is_ok(c)) return;
/* prepare named pipe open parameters */
@@ -220,7 +222,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
{
struct composite_context *c;
struct pipe_np_smb2_state *s;
- struct composite_context *conn_req;
+ struct tevent_req *subreq;
struct smbcli_options options;
/* composite context allocation and setup */
@@ -247,17 +249,17 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
lpcfg_smbcli_options(lp_ctx, &options);
/* send smb2 connect request */
- conn_req = smb2_connect_send(mem_ctx, s->io.binding->host,
+ subreq = smb2_connect_send(s, c->event_ctx,
+ s->io.binding->host,
lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL),
- "IPC$",
- s->io.resolve_ctx,
- s->io.creds,
- c->event_ctx,
- &options,
- lpcfg_socket_options(lp_ctx),
- lpcfg_gensec_settings(mem_ctx, lp_ctx)
- );
- composite_continue(c, conn_req, continue_smb2_connect, c);
+ "IPC$",
+ s->io.resolve_ctx,
+ s->io.creds,
+ &options,
+ lpcfg_socket_options(lp_ctx),
+ lpcfg_gensec_settings(mem_ctx, lp_ctx));
+ if (composite_nomem(subreq, c)) return c;
+ tevent_req_set_callback(subreq, continue_smb2_connect, c);
return c;
}
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index f0451ac674..1dd993d94b 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -371,10 +371,7 @@ struct pipe_tcp_state {
};
-#if 0 /* disabled till we can resolve names to ipv6 addresses */
-static void continue_ipv6_open_socket(struct composite_context *ctx);
-#endif
-static void continue_ipv4_open_socket(struct composite_context *ctx);
+static void continue_ip_open_socket(struct composite_context *ctx);
static void continue_ip_resolve_name(struct composite_context *ctx);
static void continue_ip_resolve_name(struct composite_context *ctx)
@@ -383,62 +380,28 @@ static void continue_ip_resolve_name(struct composite_context *ctx)
struct composite_context);
struct pipe_tcp_state *s = talloc_get_type(c->private_data,
struct pipe_tcp_state);
- struct composite_context *sock_ipv4_req;
+ struct composite_context *sock_ip_req;
c->status = resolve_name_recv(ctx, s, &s->address);
if (!composite_is_ok(c)) return;
/* prepare server address using host ip:port and transport name */
- s->srvaddr = socket_address_from_strings(s->conn, "ipv4", s->address, s->port);
+ s->srvaddr = socket_address_from_strings(s->conn, "ip", s->address, s->port);
if (composite_nomem(s->srvaddr, c)) return;
- /* resolve_nbt_name gives only ipv4 ... - send socket open request */
- sock_ipv4_req = dcerpc_pipe_open_socket_send(c, s->conn, s->localaddr,
+ sock_ip_req = dcerpc_pipe_open_socket_send(c, s->conn, s->localaddr,
s->srvaddr, s->target_hostname,
NULL,
NCACN_IP_TCP);
- composite_continue(c, sock_ipv4_req, continue_ipv4_open_socket, c);
+ composite_continue(c, sock_ip_req, continue_ip_open_socket, c);
}
-/*
- Stage 2 of dcerpc_pipe_open_tcp_send: receive result of pipe open request
- on IPv6 and send the request on IPv4 unless IPv6 transport succeeded.
-*/
-#if 0 /* disabled till we can resolve names to ipv6 addresses */
-static void continue_ipv6_open_socket(struct composite_context *ctx)
-{
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
- struct pipe_tcp_state *s = talloc_get_type(c->private_data,
- struct pipe_tcp_state);
- struct composite_context *sock_ipv4_req;
-
- /* receive result of socket open request */
- c->status = dcerpc_pipe_open_socket_recv(ctx);
- if (NT_STATUS_IS_OK(c->status)) {
- composite_done(c);
- return;
- }
-
- talloc_free(s->srvaddr);
-
- /* prepare server address using host:ip and transport name */
- s->srvaddr = socket_address_from_strings(s->conn, "ipv4", s->address, s->port);
- if (composite_nomem(s->srvaddr, c)) return;
-
- /* try IPv4 if IPv6 fails */
- sock_ipv4_req = dcerpc_pipe_open_socket_send(c, s->conn, s->localaddr,
- s->srvaddr, s->target_hostname,
- NCACN_IP_TCP);
- composite_continue(c, sock_ipv4_req, continue_ipv4_open_socket, c);
-}
-#endif
/*
Stage 2 of dcerpc_pipe_open_tcp_send: receive result of pipe open request
- on IPv4 transport.
+ on IP transport.
*/
-static void continue_ipv4_open_socket(struct composite_context *ctx)
+static void continue_ip_open_socket(struct composite_context *ctx)
{
struct composite_context *c = talloc_get_type(ctx->async.private_data,
struct composite_context);
diff --git a/source4/librpc/rpc/pyrpc_util.c b/source4/librpc/rpc/pyrpc_util.c
index 3821638fb3..385acc87e5 100644
--- a/source4/librpc/rpc/pyrpc_util.c
+++ b/source4/librpc/rpc/pyrpc_util.c
@@ -72,9 +72,9 @@ static NTSTATUS pyrpc_irpc_connect(TALLOC_CTX *mem_ctx, const char *irpc_server,
struct loadparm_context *lp_ctx,
struct dcerpc_binding_handle **binding_handle)
{
- struct messaging_context *msg;
+ struct imessaging_context *msg;
- msg = messaging_client_init(mem_ctx, lpcfg_messaging_path(mem_ctx, lp_ctx), event_ctx);
+ msg = imessaging_client_init(mem_ctx, lpcfg_imessaging_path(mem_ctx, lp_ctx), event_ctx);
NT_STATUS_HAVE_NO_MEMORY(msg);
*binding_handle = irpc_binding_handle_by_name(mem_ctx, msg, irpc_server, table);
@@ -119,7 +119,7 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py
return NULL;
}
- status = dcerpc_init(lp_ctx);
+ status = dcerpc_init();
if (!NT_STATUS_IS_OK(status)) {
PyErr_SetNTSTATUS(status);
talloc_free(mem_ctx);
diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index ce015ccaa5..39541b6a33 100755
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -4,13 +4,6 @@ bld.RECURSE('../../librpc/idl')
bld.RECURSE('../../librpc/tools')
bld.RECURSE('idl')
-bld.SAMBA_SUBSYSTEM('NDR_SERVER_ID4',
- source='gen_ndr/ndr_server_id4.c',
- deps='ndr',
- public_headers='gen_ndr/server_id4.h',
- header_path='gen_ndr'
- )
-
bld.SAMBA_SUBSYSTEM('NDR_WINSTATION',
source='gen_ndr/ndr_winstation.c',
@@ -50,12 +43,6 @@ bld.SAMBA_SUBSYSTEM('NDR_OPENDB',
)
-bld.SAMBA_SUBSYSTEM('NDR_NOTIFY',
- source='gen_ndr/ndr_s4_notify.c',
- public_deps='ndr NDR_SERVER_ID4'
- )
-
-
bld.SAMBA_SUBSYSTEM('NDR_NTP_SIGND',
source='gen_ndr/ndr_ntp_signd.c',
public_deps='ndr'
@@ -76,7 +63,7 @@ bld.SAMBA_SUBSYSTEM('NDR_WINBIND',
# create a grouping library to consolidate our samba4 specific NDR code
bld.SAMBA_LIBRARY('ndr-samba4',
source=[],
- deps='NDR_WINBIND NDR_IRPC NDR_NFS4ACL NDR_OPENDB NDR_NOTIFY ndr-table',
+ deps='NDR_WINBIND NDR_IRPC NDR_NFS4ACL NDR_OPENDB ndr-table',
private_library=True,
grouping_library=True
)
@@ -92,11 +79,6 @@ bld.SAMBA_LIBRARY('dcerpc-samba4',
bld.SAMBA_PIDL_TABLES('GEN_NDR_TABLES', 'gen_ndr/tables.c')
-if bld.env.enable_s3build:
- s3_ndr = "NDR_WBINT"
-else:
- s3_ndr = ""
-
bld.SAMBA_SUBSYSTEM('ndr-table',
source='../../librpc/ndr/ndr_table.c gen_ndr/tables.c',
public_deps='''ndr-standard NDR_AUDIOSRV NDR_DSBACKUP NDR_EFS
@@ -109,7 +91,7 @@ bld.SAMBA_SUBSYSTEM('ndr-table',
NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI
NDR_FRSTRANS NDR_NFS4ACL NDR_NTP_SIGND NDR_DCOM NDR_WMI
NDR_NAMED_PIPE_AUTH NDR_NTLMSSP NDR_DFSBLOBS NDR_DNSP
- NDR_NTPRINTING NDR_DNS NDR_BACKUPKEY NDR_PREG ''' + s3_ndr,
+ NDR_NTPRINTING NDR_DNS NDR_BACKUPKEY NDR_PREG NDR_WBINT''',
depends_on='GEN_NDR_TABLES'
)