From e33d1454676021db27fd1f1d52bb3d79c7171d01 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 20 Sep 2013 10:01:24 -0400 Subject: util: Allways fall back to old find_uid method systemd-login still fails with su/sudo login shells, so always fall back for now. Resolves: https://fedorahosted.org/sssd/ticket/2094 --- src/util/find_uid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/find_uid.c b/src/util/find_uid.c index d9b911b8..6d1478e7 100644 --- a/src/util/find_uid.c +++ b/src/util/find_uid.c @@ -310,15 +310,15 @@ errno_t check_if_uid_is_active(uid_t uid, bool *result) ret = sd_uid_get_sessions(uid, 0, NULL); if (ret > 0) { *result = true; + return EOK; } if (ret == 0) { *result = false; } - if (ret >= 0) { - return EOK; + if (ret < 0) { + DEBUG(SSSDBG_CRIT_FAILURE, ("systemd-login gave error %d: %s\n", + -ret, strerror(-ret))); } - DEBUG(SSSDBG_CRIT_FAILURE, ("systemd-login gave error %d: %s\n", - -ret, strerror(-ret))); /* fall back to the old method */ #endif -- cgit