1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

s3: Do not reference ndr_table when calling rpc_srv_register

This commit is contained in:
Volker Lendecke 2009-11-08 11:35:53 +01:00
parent 98fb71782e
commit 494b2aff88
20 changed files with 27 additions and 23 deletions

View File

@ -1927,5 +1927,5 @@ NTSTATUS rpc_netdfs_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_netdfs_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", &ndr_table_netdfs, api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", NDR_NETDFS_UUID, NDR_NETDFS_VERSION, api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct));
}

View File

@ -926,5 +926,5 @@ NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS rpc_dssetup_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", &ndr_table_dssetup, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", NDR_DSSETUP_UUID, NDR_DSSETUP_VERSION, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct));
}

View File

@ -910,5 +910,5 @@ NTSTATUS rpc_rpcecho_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS rpc_rpcecho_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", &ndr_table_rpcecho, api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", NDR_RPCECHO_UUID, NDR_RPCECHO_VERSION, api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct));
}

View File

@ -729,5 +729,5 @@ NTSTATUS rpc_epmapper_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS rpc_epmapper_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", &ndr_table_epmapper, api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", NDR_EPMAPPER_UUID, NDR_EPMAPPER_VERSION, api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct));
}

View File

@ -2177,5 +2177,5 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS rpc_eventlog_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", &ndr_table_eventlog, api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", NDR_EVENTLOG_UUID, NDR_EVENTLOG_VERSION, api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct));
}

View File

@ -273,5 +273,5 @@ NTSTATUS rpc_initshutdown_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
NTSTATUS rpc_initshutdown_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", &ndr_table_initshutdown, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", NDR_INITSHUTDOWN_UUID, NDR_INITSHUTDOWN_VERSION, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct));
}

View File

@ -7153,5 +7153,5 @@ NTSTATUS rpc_lsarpc_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_lsarpc_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", &ndr_table_lsarpc, api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", NDR_LSARPC_UUID, NDR_LSARPC_VERSION, api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct));
}

View File

@ -4540,5 +4540,5 @@ NTSTATUS rpc_netlogon_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS rpc_netlogon_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", &ndr_table_netlogon, api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION, api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct));
}

View File

@ -5314,5 +5314,5 @@ NTSTATUS rpc_ntsvcs_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_ntsvcs_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "ntsvcs", "ntsvcs", &ndr_table_ntsvcs, api_ntsvcs_cmds, sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "ntsvcs", "ntsvcs", NDR_NTSVCS_UUID, NDR_NTSVCS_VERSION, api_ntsvcs_cmds, sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct));
}

View File

@ -6263,5 +6263,5 @@ NTSTATUS rpc_samr_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, con
NTSTATUS rpc_samr_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "samr", "samr", &ndr_table_samr, api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "samr", "samr", NDR_SAMR_UUID, NDR_SAMR_VERSION, api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct));
}

View File

@ -9724,5 +9724,5 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS rpc_spoolss_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss", &ndr_table_spoolss, api_spoolss_cmds, sizeof(api_spoolss_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss", NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, api_spoolss_cmds, sizeof(api_spoolss_cmds) / sizeof(struct api_struct));
}

View File

@ -4684,5 +4684,5 @@ NTSTATUS rpc_srvsvc_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_srvsvc_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "srvsvc", "srvsvc", &ndr_table_srvsvc, api_srvsvc_cmds, sizeof(api_srvsvc_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "srvsvc", "srvsvc", NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, api_srvsvc_cmds, sizeof(api_srvsvc_cmds) / sizeof(struct api_struct));
}

View File

@ -4174,5 +4174,5 @@ NTSTATUS rpc_svcctl_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_svcctl_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", &ndr_table_svcctl, api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct));
}

View File

@ -3129,5 +3129,5 @@ NTSTATUS rpc_winreg_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_winreg_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", &ndr_table_winreg, api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", NDR_WINREG_UUID, NDR_WINREG_VERSION, api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct));
}

View File

@ -2690,5 +2690,5 @@ NTSTATUS rpc_wkssvc_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
NTSTATUS rpc_wkssvc_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wkssvc", "wkssvc", &ndr_table_wkssvc, api_wkssvc_cmds, sizeof(api_wkssvc_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wkssvc", "wkssvc", NDR_WKSSVC_UUID, NDR_WKSSVC_VERSION, api_wkssvc_cmds, sizeof(api_wkssvc_cmds) / sizeof(struct api_struct));
}

View File

@ -306,7 +306,7 @@ sub ParseInterface($)
pidl_hdr "NTSTATUS rpc_$if->{NAME}_init(void);";
pidl "NTSTATUS rpc_$if->{NAME}_init(void)";
pidl "{";
pidl "\treturn rpc_srv_register(SMB_RPC_INTERFACE_VERSION, \"$if->{NAME}\", \"$if->{NAME}\", \&ndr_table_$if->{NAME}, api_$if->{NAME}_cmds, sizeof(api_$if->{NAME}_cmds) / sizeof(struct api_struct));";
pidl "\treturn rpc_srv_register(SMB_RPC_INTERFACE_VERSION, \"$if->{NAME}\", \"$if->{NAME}\", NDR_".$uif."_UUID, NDR_".$uif."_VERSION, api_$if->{NAME}_cmds, sizeof(api_$if->{NAME}_cmds) / sizeof(struct api_struct));";
pidl "}";
pidl_hdr "#endif /* __SRV_$uif\__ */";

View File

@ -5819,9 +5819,8 @@ NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
const char *srv,
const struct ndr_syntax_id *interface,
const struct api_struct *cmds, int size);
NTSTATUS rpc_srv_register(int version, const char *clnt,
const char *srv,
const struct ndr_interface_table *iface,
NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv,
const char *interface, uint32_t interface_version,
const struct api_struct *cmds, int size);
bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax);
bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p);

View File

@ -2140,5 +2140,5 @@ NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, co
NTSTATUS rpc_wbint_init(void)
{
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wbint", "wbint", &ndr_table_wbint, api_wbint_cmds, sizeof(api_wbint_cmds) / sizeof(struct api_struct));
return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wbint", "wbint", NDR_WBINT_UUID, NDR_WBINT_VERSION, api_wbint_cmds, sizeof(api_wbint_cmds) / sizeof(struct api_struct));
}

View File

@ -1034,15 +1034,20 @@ static bool check_bind_req(struct pipes_struct *p,
*******************************************************************/
NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv,
const struct ndr_interface_table *iface,
const char *interface, uint32_t interface_version,
const struct api_struct *cmds, int size)
{
struct rpc_table *rpc_entry;
struct ndr_syntax_id syntax;
if (!clnt || !srv || !cmds) {
return NT_STATUS_INVALID_PARAMETER;
}
if (!ndr_syntax_from_string(interface, interface_version, &syntax)) {
return NT_STATUS_INVALID_PARAMETER;
}
if (version != SMB_RPC_INTERFACE_VERSION) {
DEBUG(0,("Can't register rpc commands!\n"
"You tried to register a rpc module with SMB_RPC_INTERFACE_VERSION %d"
@ -1075,7 +1080,7 @@ NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv,
ZERO_STRUCTP(rpc_entry);
rpc_entry->pipe.clnt = SMB_STRDUP(clnt);
rpc_entry->pipe.srv = SMB_STRDUP(srv);
rpc_entry->rpc_interface = iface->syntax_id;
rpc_entry->rpc_interface = syntax;
rpc_entry->cmds = cmds;
rpc_entry->n_cmds = size;

View File

@ -293,7 +293,7 @@ enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
* Just a dummy to make srv_wbint.c happy
*/
NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv,
const struct ndr_interface_table *iface,
const char *interface, uint32_t interface_version,
const struct api_struct *cmds, int size)
{
return NT_STATUS_OK;