From d2f4746587809673122d348a8f806f1c14d3d60a Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Sat, 21 Sep 2013 05:57:12 +0200 Subject: Check return values of setenv and unsetenv --- src/providers/data_provider_be.c | 6 +++++- src/util/server.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index ccd51b45..6b58d88a 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -2891,7 +2891,11 @@ int main(int argc, const char *argv[]) return 2; } - setenv(SSS_DOM_ENV, be_domain, 1); + ret = setenv(SSS_DOM_ENV, be_domain, 1); + if (ret != 0) { + DEBUG(SSSDBG_MINOR_FAILURE, ("Setting "SSS_DOM_ENV" failed, journald " + "logging mightnot work as expected\n")); + } ret = die_if_parent_died(); if (ret != EOK) { diff --git a/src/util/server.c b/src/util/server.c index 3dcfccaf..b1c59e1d 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -426,7 +426,11 @@ int server_setup(const char *name, int flags, /* To make sure the domain cannot be set from the environment, unset the * variable explicitly when setting up any server. Backends later set the * value after reading domain from the configuration */ - unsetenv(SSS_DOM_ENV); + ret = unsetenv(SSS_DOM_ENV); + if (ret != 0) { + DEBUG(SSSDBG_MINOR_FAILURE, ("Unsetting "SSS_DOM_ENV" failed, journald " + "logging mightnot work as expected\n")); + } setup_signals(); -- cgit