diff options
Diffstat (limited to 'server/responder/nss')
-rw-r--r-- | server/responder/nss/nsssrv.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c index e04a8c87..9a3d3c45 100644 --- a/server/responder/nss/nsssrv.c +++ b/server/responder/nss/nsssrv.c @@ -29,6 +29,12 @@ #include <string.h> #include <sys/time.h> #include <errno.h> + +/* Needed for res_init() */ +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> + #include "popt.h" #include "util/util.h" #include "responder/nss/nsssrv.h" @@ -49,11 +55,13 @@ static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn); static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn); static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn); +static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn); struct sbus_method nss_sbus_methods[] = { {SERVICE_METHOD_IDENTITY, service_identity}, {SERVICE_METHOD_PING, service_pong}, {SERVICE_METHOD_RELOAD, service_reload}, + {SERVICE_METHOD_RES_INIT, service_res_init}, {NULL, NULL} }; @@ -118,6 +126,18 @@ static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn) return service_pong(message, sconn); } +static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn) +{ + int ret; + + ret = res_init(); + if(ret != 0) { + return EIO; + } + + return service_pong(message, sconn); +} + static int nss_get_config(struct nss_ctx *nctx, struct resp_ctx *rctx, struct confdb_ctx *cdb) |