summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-08 10:51:34 +0100
committerVolker Lendecke <vl@samba.org>2009-11-08 13:12:14 +0100
commit98fb71782e05ae72cd6abeb38b6e0b96a50c1761 (patch)
treed70c44840e3cc9b69911d779a0f61a29d76ffb00 /source3
parent9621306351cdb469ef393a6d8cbeea456bc4bd9f (diff)
downloadsamba-98fb71782e05ae72cd6abeb38b6e0b96a50c1761.tar.gz
samba-98fb71782e05ae72cd6abeb38b6e0b96a50c1761.tar.bz2
samba-98fb71782e05ae72cd6abeb38b6e0b96a50c1761.zip
s3: Do not reference the ndr_tables in the server calls directly
This involves storing the interface table in the pipes_struct
Diffstat (limited to 'source3')
-rw-r--r--source3/include/ntdomain.h2
-rw-r--r--source3/librpc/gen_ndr/srv_wbint.c46
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c5
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c13
-rw-r--r--source3/winbindd/winbindd_dual_ndr.c1
5 files changed, 38 insertions, 29 deletions
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index bbe653b8bd..10cd32170d 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -169,7 +169,7 @@ typedef struct pipes_struct {
struct auth_serversupplied_info *server_info;
- struct ndr_syntax_id syntax;
+ const struct ndr_interface_table *interface;
/* linked list of rpc dispatch tables associated
with the open rpc contexts */
diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c
index 08a346a3f6..a7112cb94b 100644
--- a/source3/librpc/gen_ndr/srv_wbint.c
+++ b/source3/librpc/gen_ndr/srv_wbint.c
@@ -15,7 +15,7 @@ static bool api_wbint_Ping(pipes_struct *p)
DATA_BLOB blob;
struct wbint_Ping *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_PING];
+ call = &p->interface->calls[NDR_WBINT_PING];
r = talloc(talloc_tos(), struct wbint_Ping);
if (r == NULL) {
@@ -95,7 +95,7 @@ static bool api_wbint_LookupSid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_LookupSid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPSID];
+ call = &p->interface->calls[NDR_WBINT_LOOKUPSID];
r = talloc(talloc_tos(), struct wbint_LookupSid);
if (r == NULL) {
@@ -187,7 +187,7 @@ static bool api_wbint_LookupName(pipes_struct *p)
DATA_BLOB blob;
struct wbint_LookupName *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPNAME];
+ call = &p->interface->calls[NDR_WBINT_LOOKUPNAME];
r = talloc(talloc_tos(), struct wbint_LookupName);
if (r == NULL) {
@@ -273,7 +273,7 @@ static bool api_wbint_Sid2Uid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_Sid2Uid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_SID2UID];
+ call = &p->interface->calls[NDR_WBINT_SID2UID];
r = talloc(talloc_tos(), struct wbint_Sid2Uid);
if (r == NULL) {
@@ -353,7 +353,7 @@ static bool api_wbint_Sid2Gid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_Sid2Gid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_SID2GID];
+ call = &p->interface->calls[NDR_WBINT_SID2GID];
r = talloc(talloc_tos(), struct wbint_Sid2Gid);
if (r == NULL) {
@@ -433,7 +433,7 @@ static bool api_wbint_Uid2Sid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_Uid2Sid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_UID2SID];
+ call = &p->interface->calls[NDR_WBINT_UID2SID];
r = talloc(talloc_tos(), struct wbint_Uid2Sid);
if (r == NULL) {
@@ -513,7 +513,7 @@ static bool api_wbint_Gid2Sid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_Gid2Sid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_GID2SID];
+ call = &p->interface->calls[NDR_WBINT_GID2SID];
r = talloc(talloc_tos(), struct wbint_Gid2Sid);
if (r == NULL) {
@@ -593,7 +593,7 @@ static bool api_wbint_AllocateUid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_AllocateUid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_ALLOCATEUID];
+ call = &p->interface->calls[NDR_WBINT_ALLOCATEUID];
r = talloc(talloc_tos(), struct wbint_AllocateUid);
if (r == NULL) {
@@ -673,7 +673,7 @@ static bool api_wbint_AllocateGid(pipes_struct *p)
DATA_BLOB blob;
struct wbint_AllocateGid *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_ALLOCATEGID];
+ call = &p->interface->calls[NDR_WBINT_ALLOCATEGID];
r = talloc(talloc_tos(), struct wbint_AllocateGid);
if (r == NULL) {
@@ -753,7 +753,7 @@ static bool api_wbint_QueryUser(pipes_struct *p)
DATA_BLOB blob;
struct wbint_QueryUser *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSER];
+ call = &p->interface->calls[NDR_WBINT_QUERYUSER];
r = talloc(talloc_tos(), struct wbint_QueryUser);
if (r == NULL) {
@@ -833,7 +833,7 @@ static bool api_wbint_LookupUserAliases(pipes_struct *p)
DATA_BLOB blob;
struct wbint_LookupUserAliases *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERALIASES];
+ call = &p->interface->calls[NDR_WBINT_LOOKUPUSERALIASES];
r = talloc(talloc_tos(), struct wbint_LookupUserAliases);
if (r == NULL) {
@@ -913,7 +913,7 @@ static bool api_wbint_LookupUserGroups(pipes_struct *p)
DATA_BLOB blob;
struct wbint_LookupUserGroups *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERGROUPS];
+ call = &p->interface->calls[NDR_WBINT_LOOKUPUSERGROUPS];
r = talloc(talloc_tos(), struct wbint_LookupUserGroups);
if (r == NULL) {
@@ -993,7 +993,7 @@ static bool api_wbint_QuerySequenceNumber(pipes_struct *p)
DATA_BLOB blob;
struct wbint_QuerySequenceNumber *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_QUERYSEQUENCENUMBER];
+ call = &p->interface->calls[NDR_WBINT_QUERYSEQUENCENUMBER];
r = talloc(talloc_tos(), struct wbint_QuerySequenceNumber);
if (r == NULL) {
@@ -1073,7 +1073,7 @@ static bool api_wbint_LookupGroupMembers(pipes_struct *p)
DATA_BLOB blob;
struct wbint_LookupGroupMembers *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPGROUPMEMBERS];
+ call = &p->interface->calls[NDR_WBINT_LOOKUPGROUPMEMBERS];
r = talloc(talloc_tos(), struct wbint_LookupGroupMembers);
if (r == NULL) {
@@ -1153,7 +1153,7 @@ static bool api_wbint_QueryUserList(pipes_struct *p)
DATA_BLOB blob;
struct wbint_QueryUserList *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSERLIST];
+ call = &p->interface->calls[NDR_WBINT_QUERYUSERLIST];
r = talloc(talloc_tos(), struct wbint_QueryUserList);
if (r == NULL) {
@@ -1233,7 +1233,7 @@ static bool api_wbint_QueryGroupList(pipes_struct *p)
DATA_BLOB blob;
struct wbint_QueryGroupList *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_QUERYGROUPLIST];
+ call = &p->interface->calls[NDR_WBINT_QUERYGROUPLIST];
r = talloc(talloc_tos(), struct wbint_QueryGroupList);
if (r == NULL) {
@@ -1313,7 +1313,7 @@ static bool api_wbint_DsGetDcName(pipes_struct *p)
DATA_BLOB blob;
struct wbint_DsGetDcName *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_DSGETDCNAME];
+ call = &p->interface->calls[NDR_WBINT_DSGETDCNAME];
r = talloc(talloc_tos(), struct wbint_DsGetDcName);
if (r == NULL) {
@@ -1393,7 +1393,7 @@ static bool api_wbint_LookupRids(pipes_struct *p)
DATA_BLOB blob;
struct wbint_LookupRids *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPRIDS];
+ call = &p->interface->calls[NDR_WBINT_LOOKUPRIDS];
r = talloc(talloc_tos(), struct wbint_LookupRids);
if (r == NULL) {
@@ -1473,7 +1473,7 @@ static bool api_wbint_CheckMachineAccount(pipes_struct *p)
DATA_BLOB blob;
struct wbint_CheckMachineAccount *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_CHECKMACHINEACCOUNT];
+ call = &p->interface->calls[NDR_WBINT_CHECKMACHINEACCOUNT];
r = talloc(talloc_tos(), struct wbint_CheckMachineAccount);
if (r == NULL) {
@@ -1546,7 +1546,7 @@ static bool api_wbint_ChangeMachineAccount(pipes_struct *p)
DATA_BLOB blob;
struct wbint_ChangeMachineAccount *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_CHANGEMACHINEACCOUNT];
+ call = &p->interface->calls[NDR_WBINT_CHANGEMACHINEACCOUNT];
r = talloc(talloc_tos(), struct wbint_ChangeMachineAccount);
if (r == NULL) {
@@ -1619,7 +1619,7 @@ static bool api_wbint_SetMapping(pipes_struct *p)
DATA_BLOB blob;
struct wbint_SetMapping *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_SETMAPPING];
+ call = &p->interface->calls[NDR_WBINT_SETMAPPING];
r = talloc(talloc_tos(), struct wbint_SetMapping);
if (r == NULL) {
@@ -1692,7 +1692,7 @@ static bool api_wbint_RemoveMapping(pipes_struct *p)
DATA_BLOB blob;
struct wbint_RemoveMapping *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_REMOVEMAPPING];
+ call = &p->interface->calls[NDR_WBINT_REMOVEMAPPING];
r = talloc(talloc_tos(), struct wbint_RemoveMapping);
if (r == NULL) {
@@ -1765,7 +1765,7 @@ static bool api_wbint_SetHWM(pipes_struct *p)
DATA_BLOB blob;
struct wbint_SetHWM *r;
- call = &ndr_table_wbint.calls[NDR_WBINT_SETHWM];
+ call = &p->interface->calls[NDR_WBINT_SETHWM];
r = talloc(talloc_tos(), struct wbint_SetHWM);
if (r == NULL) {
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index 4233b6f0e6..8b4b4a9252 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -81,10 +81,11 @@ bool init_pipe_handle_list(pipes_struct *p, const struct ndr_syntax_id *syntax)
for (plist = get_first_internal_pipe();
plist;
plist = get_next_internal_pipe(plist)) {
- if (ndr_syntax_id_equal(syntax, &plist->syntax)) {
+ if (ndr_syntax_id_equal(syntax,
+ &plist->interface->syntax_id)) {
break;
}
- if (is_samr_lsa_pipe(&plist->syntax)
+ if (is_samr_lsa_pipe(&plist->interface->syntax_id)
&& is_samr_lsa_pipe(syntax)) {
/*
* samr and lsa share a handle space (same process
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index e7d94d70ec..8bc2bdd505 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -57,7 +57,8 @@ pipes_struct *get_next_internal_pipe(pipes_struct *p)
const char *get_pipe_name_tos(struct pipes_struct *p)
{
- return get_pipe_name_from_syntax(talloc_tos(), &p->syntax);
+ return get_pipe_name_from_syntax(talloc_tos(),
+ &p->interface->syntax_id);
}
/****************************************************************************
@@ -119,6 +120,14 @@ static struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
return NULL;
}
+ p->interface = get_iface_from_syntax(syntax);
+ if (p->interface == NULL) {
+ DEBUG(10, ("Could not find ndr table for syntax\n"));
+ TALLOC_FREE(p->mem_ctx);
+ TALLOC_FREE(p);
+ return NULL;
+ }
+
if (!init_pipe_handle_list(p, syntax)) {
DEBUG(0,("open_rpc_pipe_p: init_pipe_handles failed.\n"));
talloc_destroy(p->mem_ctx);
@@ -161,8 +170,6 @@ static struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
*/
prs_init_empty(&p->out_data.rdata, p->mem_ctx, MARSHALL);
- p->syntax = *syntax;
-
DEBUG(4,("Created internal pipe %s (pipes_open=%d)\n",
get_pipe_name_from_syntax(talloc_tos(), syntax), pipes_open));
diff --git a/source3/winbindd/winbindd_dual_ndr.c b/source3/winbindd/winbindd_dual_ndr.c
index eb018aa87e..916499ad9c 100644
--- a/source3/winbindd/winbindd_dual_ndr.c
+++ b/source3/winbindd/winbindd_dual_ndr.c
@@ -267,6 +267,7 @@ enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
ZERO_STRUCT(p);
p.mem_ctx = talloc_stackframe();
+ p.interface = &ndr_table_wbint;
p.in_data.data.buffer_size = state->request->extra_len;
p.in_data.data.data_p = state->request->extra_data.data;
prs_init(&p.out_data.rdata, 0, state->mem_ctx, false);