Line data Source code
1 : /*
2 : Authors:
3 : Pavel Březina <pbrezina@redhat.com>
4 :
5 : Copyright (C) 2016 Red Hat
6 :
7 : This program is free software; you can redistribute it and/or modify
8 : it under the terms of the GNU General Public License as published by
9 : the Free Software Foundation; either version 3 of the License, or
10 : (at your option) any later version.
11 :
12 : This program is distributed in the hope that it will be useful,
13 : but WITHOUT ANY WARRANTY; without even the implied warranty of
14 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 : GNU General Public License for more details.
16 :
17 : You should have received a copy of the GNU General Public License
18 : along with this program. If not, see <http://www.gnu.org/licenses/>.
19 : */
20 :
21 : #include <talloc.h>
22 : #include <tevent.h>
23 :
24 : #include "sbus/sssd_dbus.h"
25 : #include "providers/data_provider/dp_private.h"
26 : #include "providers/data_provider/dp_iface.h"
27 : #include "providers/backend.h"
28 : #include "util/util.h"
29 :
30 0 : errno_t dp_autofs_handler(struct sbus_request *sbus_req,
31 : void *dp_cli,
32 : uint32_t dp_flags,
33 : const char *mapname)
34 : {
35 : struct dp_autofs_data *data;
36 : const char *key;
37 :
38 0 : if (mapname == NULL) {
39 0 : return EINVAL;
40 : }
41 :
42 0 : data = talloc_zero(sbus_req, struct dp_autofs_data);
43 0 : if (data == NULL) {
44 0 : return ENOMEM;
45 : }
46 :
47 0 : data->mapname = mapname;
48 0 : key = mapname;
49 :
50 0 : dp_req_with_reply(dp_cli, NULL, "AutoFS", key, sbus_req, DPT_AUTOFS,
51 : DPM_AUTOFS_HANDLER, dp_flags, data,
52 : dp_req_reply_std, struct dp_reply_std);
53 :
54 0 : return EOK;
55 : }
|