Skip to content

Commit

Permalink
pam_systemd_home: make sure we handle RefUnit() returning HomeBusy pr…
Browse files Browse the repository at this point in the history
…operly

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.
  • Loading branch information
poettering committed Nov 29, 2023
1 parent e9f6737 commit 115de00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/home/pam_systemd_home.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 115de00

Please sign in to comment.