diff options
author | Ralph Boehme <rb@sernet.de> | 2014-07-23 09:58:45 +0200 |
---|---|---|
committer | Ralph Böhme <slow@samba.org> | 2015-07-07 17:34:28 +0200 |
commit | 63dd793cde70a3d3a5bf4144c316b764d687546b (patch) | |
tree | 710ebaa015156fef7ba53044b5862253aa527c92 | |
parent | 5c6e2b2b1fc4514f5f61dd16b6fdc59410edc815 (diff) | |
download | samba-63dd793cde70a3d3a5bf4144c316b764d687546b.tar.gz |
s3-mdssvc: add Spotlight RPC stubs
'mdssvc' aka 'Metadata Search Service' is an RPC service used by Apple
for passing marshalled Spotlight search queries and results between
client to server.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/rpc_server/mdssvc/mdssvc.c | 31 | ||||
-rw-r--r-- | source3/rpc_server/mdssvc/mdssvc.h | 21 | ||||
-rw-r--r-- | source3/rpc_server/mdssvc/srv_mdssvc_nt.c | 57 | ||||
-rw-r--r-- | source3/rpc_server/rpc_config.c | 1 | ||||
-rw-r--r-- | source3/rpc_server/rpc_service_setup.c | 29 | ||||
-rwxr-xr-x | source3/rpc_server/wscript_build | 8 |
6 files changed, 147 insertions, 0 deletions
diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c new file mode 100644 index 00000000000..20e45f17b4f --- /dev/null +++ b/source3/rpc_server/mdssvc/mdssvc.c @@ -0,0 +1,31 @@ +/* + Unix SMB/CIFS implementation. + Main metadata server / Spotlight routines + + Copyright (C) Ralph Boehme 2012-2014 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "includes.h" +#include "mdssvc.h" + +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_RPC_SRV + +int mds_dispatch(void) +{ + DEBUG(10, ("mds_dispatch\n")); + return 0; +} diff --git a/source3/rpc_server/mdssvc/mdssvc.h b/source3/rpc_server/mdssvc/mdssvc.h new file mode 100644 index 00000000000..f016e969c05 --- /dev/null +++ b/source3/rpc_server/mdssvc/mdssvc.h @@ -0,0 +1,21 @@ +/* + Unix SMB/CIFS implementation. + Main metadata server / Spotlight routines + + Copyright (C) Ralph Boehme 2012-2014 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +int mds_dispatch(void); diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c new file mode 100644 index 00000000000..3779e450a22 --- /dev/null +++ b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c @@ -0,0 +1,57 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines for mdssvc + * Copyright (C) Ralph Boehme 2014 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include "includes.h" +#include "mdssvc.h" +#include "ntdomain.h" +#include "../librpc/gen_ndr/srv_mdssvc.h" + +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_RPC_SRV + +void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r) +{ + DEBUG(10, ("%s\n", __func__)); + p->fault_state = DCERPC_FAULT_OP_RNG_ERROR; + return; +} + +void _mdssvc_unknown1(struct pipes_struct *p, struct mdssvc_unknown1 *r) +{ + DEBUG(10, ("%s\n", __func__)); + p->fault_state = DCERPC_FAULT_OP_RNG_ERROR; + return; +} + +void _mdssvc_cmd(struct pipes_struct *p, struct mdssvc_cmd *r) +{ + DEBUG(10, ("%s\n", __func__)); + p->fault_state = DCERPC_FAULT_OP_RNG_ERROR; + + mds_dispatch(); + + return; +} + +void _mdssvc_close(struct pipes_struct *p, struct mdssvc_close *r) +{ + DEBUG(10, ("%s\n", __func__)); + p->fault_state = DCERPC_FAULT_OP_RNG_ERROR; + return; +} diff --git a/source3/rpc_server/rpc_config.c b/source3/rpc_server/rpc_config.c index efc6668e91b..23c6f88eac4 100644 --- a/source3/rpc_server/rpc_config.c +++ b/source3/rpc_server/rpc_config.c @@ -31,6 +31,7 @@ struct rpc_service_defaults { const char *def_mode; } rpc_service_defaults[] = { { "epmapper", "disabled" }, + { "mdssvc", "disabled" }, /* { "spoolss", "embedded" }, */ /* { "lsarpc", "embedded" }, */ /* { "samr", "embedded" }, */ diff --git a/source3/rpc_server/rpc_service_setup.c b/source3/rpc_server/rpc_service_setup.c index b8bb8aef449..7395caa5c38 100644 --- a/source3/rpc_server/rpc_service_setup.c +++ b/source3/rpc_server/rpc_service_setup.c @@ -38,6 +38,7 @@ #include "../librpc/gen_ndr/srv_spoolss.h" #include "../librpc/gen_ndr/srv_svcctl.h" #include "../librpc/gen_ndr/srv_wkssvc.h" +#include "../librpc/gen_ndr/srv_mdssvc.h" #include "printing/nt_printing_migrate_internal.h" #include "rpc_server/eventlog/srv_eventlog_reg.h" @@ -443,6 +444,27 @@ static bool rpc_setup_initshutdown(struct tevent_context *ev_ctx, return rpc_setup_embedded(ev_ctx, msg_ctx, t, NULL); } +#ifdef WITH_SPOTLIGHT +static bool rpc_setup_mdssvc(struct tevent_context *ev_ctx, + struct messaging_context *msg_ctx) +{ + const struct ndr_interface_table *t = &ndr_table_mdssvc; + const char *pipe_name = "mdssvc"; + NTSTATUS status; + enum rpc_service_mode_e service_mode = rpc_service_mode(t->name); + if (service_mode != RPC_SERVICE_MODE_EMBEDDED) { + return true; + } + + status = rpc_mdssvc_init(NULL); + if (!NT_STATUS_IS_OK(status)) { + return false; + } + + return rpc_setup_embedded(ev_ctx, msg_ctx, t, pipe_name); +} +#endif + bool dcesrv_ep_setup(struct tevent_context *ev_ctx, struct messaging_context *msg_ctx) { @@ -526,6 +548,13 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx, goto done; } +#ifdef WITH_SPOTLIGHT + ok = rpc_setup_mdssvc(ev_ctx, msg_ctx); + if (!ok) { + goto done; + } +#endif + done: talloc_free(tmp_ctx); return ok; diff --git a/source3/rpc_server/wscript_build b/source3/rpc_server/wscript_build index 25c923dd555..25d85cb33c9 100755 --- a/source3/rpc_server/wscript_build +++ b/source3/rpc_server/wscript_build @@ -128,6 +128,13 @@ bld.SAMBA3_SUBSYSTEM('RPC_WKSSVC', ../../librpc/gen_ndr/srv_wkssvc.c''', deps='LIBNET') +bld.SAMBA3_SUBSYSTEM('RPC_MDSSVC', + source='''mdssvc/mdssvc.c + mdssvc/srv_mdssvc_nt.c + ../../librpc/gen_ndr/srv_mdssvc.c''', + deps='samba-util ' + bld.env['libtracker'], + enabled=bld.env.with_spotlight) + # RPC_SERVICE bld.SAMBA3_SUBSYSTEM('RPC_SERVER_REGISTER', source='rpc_ep_register.c ../librpc/rpc/dcerpc_ep.c', @@ -155,6 +162,7 @@ bld.SAMBA3_SUBSYSTEM('RPC_SERVICE', RPC_SERVER RPC_EPMAPPER RPC_FSS_AGENT + RPC_MDSSVC ''') # RPC_DAEMONS |