s3: Do not reference ndr_table when calling rpc_srv_register
authorVolker Lendecke <vl@samba.org>
Sun, 8 Nov 2009 10:35:53 +0000 (11:35 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Nov 2009 12:12:15 +0000 (13:12 +0100)
20 files changed:
librpc/gen_ndr/srv_dfs.c
librpc/gen_ndr/srv_dssetup.c
librpc/gen_ndr/srv_echo.c
librpc/gen_ndr/srv_epmapper.c
librpc/gen_ndr/srv_eventlog.c
librpc/gen_ndr/srv_initshutdown.c
librpc/gen_ndr/srv_lsa.c
librpc/gen_ndr/srv_netlogon.c
librpc/gen_ndr/srv_ntsvcs.c
librpc/gen_ndr/srv_samr.c
librpc/gen_ndr/srv_spoolss.c
librpc/gen_ndr/srv_srvsvc.c
librpc/gen_ndr/srv_svcctl.c
librpc/gen_ndr/srv_winreg.c
librpc/gen_ndr/srv_wkssvc.c
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
source3/include/proto.h
source3/librpc/gen_ndr/srv_wbint.c
source3/rpc_server/srv_pipe.c
source3/winbindd/winbindd_dual_ndr.c

index f3cdbadfd7346381b78f63b791c73e7368a41a87..d6917536120a9f8fdaf1262c39ef69cda4e4c958 100644 (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));
 }
index 5bdc6ed35cda5795757f285c1595aa4daff4a56c..361fbaaf87d8f8d28ec756b1e7386f763624e013 100644 (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));
 }
index ac8a9a3f36e9c467300a2402c372032a756ff9e5..fb62000a91134bbd98be3459aeacb636f95f53b5 100644 (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));
 }
index 8648b011df72c9b9f7c08649351699bf01051d1a..72f18c03bac80302c34285d2267786f1d659ec62 100644 (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));
 }
index 9b53d33da1f11cea8d8dbb5b19ac519b69f3e25e..0a0f92e99843fb47b7f48e7d5afcde811491deac 100644 (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));
 }
index d06f5628c3f0750f0fe5efa5f629bad5efc61f8c..9eba9d3035bcce15bd2b6af4b2a88a7eaeeee542 100644 (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));
 }
index 705d67b42b0270d8ae62c71a5ae7c2c564b64019..1b4faa75bc314d54225202332b52dfc736833c49 100644 (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));
 }
index a288c77cd6ee0bf602a1ae1299c890ae3dbb5908..fc1c85a40dfc04190886c3a81a9d2f9d8c84cec2 100644 (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));
 }
index 0b451b8d657a9fff7ad105a27fe53da410e8fec2..2b43c95a3a8efc25919c3877fd44495dee687b76 100644 (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));
 }
index 62a2aedea78a4d16870dc109348539f4010abb71..f6c47fa15de07dce862bb96f986589c54d7054d2 100644 (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));
 }
index 72132dc3120d0bfa05f1513dab9ad207aef316ec..97e84a13e1cb4d4e61c0865cc1dc421964960423 100644 (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));
 }
index f84bfd934bfef7d91460ca9887d5a8a5699b1b8a..6cf72707aff8a17d240899d9f1596eb727aa2347 100644 (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));
 }
index 8424a623548597db629b7ad8b573647345e8ad9b..895687f764d51e8a51a62f305c8d6ae2c9bfd100 100644 (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));
 }
index c45773229800211478327b5445458ddd15972429..453a1dbde73e10baafb485118750a6881fcb359d 100644 (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));
 }
index 8b0ea51bfedce61f404ce67dcec743159964dcb8..ce8250b581408f6bac49d1a986ac03160eec4b3d 100644 (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));
 }
index 560f28d0e3a7e970219032bb4342a0215aae85d8..ba592f5fd08836244eea29c56c0fdad00060d370 100644 (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\__ */";
index 3d62e505b36ff3cbbb29a9c2dba619842e2c6501..4f204d0c542e3a55e8a4ef5702c9be80abfdf081 100644 (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);
index a7112cb94bfac86079880bc80576bfb77c1d78b0..9144a467e02d4f56d689fc5c0e7217f773a0c311 100644 (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));
 }
index 17cc13edf5a39ba7c0a063b3ede1d89803cf3ff6..7e0eda1c54c5bff5eb4fd33773a9c3d860466bcb 100644 (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;
 
index 916499ad9ce489acf51f431e8ca7c9dc3e4f2ff8..3546a78fd61b7e1e41d89d213444c2581af74909 100644 (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;