diff options
Diffstat (limited to 'server/providers/data_provider_be.c')
-rw-r--r-- | server/providers/data_provider_be.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index 24254d15..5cd59946 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -34,6 +34,11 @@ #include <security/pam_appl.h> #include <security/pam_modules.h> +/* Needed for res_init() */ +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> + #include "popt.h" #include "util/util.h" #include "confdb/confdb.h" @@ -51,10 +56,12 @@ 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_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn); struct sbus_method mon_sbus_methods[] = { { SERVICE_METHOD_IDENTITY, service_identity }, { SERVICE_METHOD_PING, service_pong }, + { SERVICE_METHOD_RES_INIT, service_res_init }, { NULL, NULL } }; @@ -137,6 +144,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 int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn) { dbus_uint16_t version = DATA_PROVIDER_VERSION; |