diff options
Diffstat (limited to 'server/responder/pam')
-rw-r--r-- | server/responder/pam/pamsrv.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/server/responder/pam/pamsrv.c b/server/responder/pam/pamsrv.c index e4ddc432..ef01e972 100644 --- a/server/responder/pam/pamsrv.c +++ b/server/responder/pam/pamsrv.c @@ -30,6 +30,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 "db/sysdb.h" @@ -52,11 +58,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 sss_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} }; @@ -108,6 +116,18 @@ static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn) return EOK; } +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 void pam_shutdown(struct resp_ctx *ctx); static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn) { |