From: Lennart Poettering Date: Tue, 28 Nov 2023 14:42:13 +0000 (+0100) Subject: pam_systemd_home: make sure we handle RefUnit() returning HomeBusy properly X-Git-Tag: v256-rc1~862^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c29111337f0d512c864931ef1c769a18538963d;p=thirdparty%2Fsystemd.git pam_systemd_home: make sure we handle RefUnit() returning HomeBusy properly RefUnit() only succeeds it a home dir is fully up. We already dealt with it not being up at all, but let's also cover the case where it is currently busy with changing state, and in that case fall back to RefUnrestricted(), with the usual implications. This has the effect that two subsequent ssh logins one-after-the-other will work correctly. --- diff --git a/src/home/pam_systemd_home.c b/src/home/pam_systemd_home.c index 2f628e37094..21caa5a0589 100644 --- a/src/home/pam_systemd_home.c +++ b/src/home/pam_systemd_home.c @@ -621,7 +621,7 @@ static int acquire_home( r = sd_bus_call(bus, m, HOME_SLOW_BUS_CALL_TIMEOUT_USEC, &error, &reply); if (r < 0) { - if (sd_bus_error_has_name(&error, BUS_ERROR_HOME_NOT_ACTIVE)) { + if (sd_bus_error_has_names(&error, BUS_ERROR_HOME_NOT_ACTIVE, BUS_ERROR_HOME_BUSY)) { /* Only on RefHome(): We can't access the home directory currently, unless * it's unlocked with a password. Hence, let's try this again, this time with * authentication. */