diff --git a/src/home/homectl.c b/src/home/homectl.c index 6057c04bae..1e3c96f5ad 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -383,7 +383,7 @@ static int handle_generic_user_record_error( else if (sd_bus_error_has_name(error, BUS_ERROR_AUTHENTICATION_LIMIT_HIT)) return log_error_errno(SYNTHETIC_ERRNO(ETOOMANYREFS), - "Too frequent unsuccessful login attempts for user %s, try again later.", user_name); + "Too frequent login attempts for user %s, try again later.", user_name); else if (sd_bus_error_has_name(error, BUS_ERROR_BAD_PASSWORD)) { diff --git a/src/home/pam_systemd_home.c b/src/home/pam_systemd_home.c index 3835efd608..35195c2ef0 100644 --- a/src/home/pam_systemd_home.c +++ b/src/home/pam_systemd_home.c @@ -293,7 +293,7 @@ static int handle_generic_user_record_error( return PAM_PERM_DENIED; } else if (sd_bus_error_has_name(error, BUS_ERROR_AUTHENTICATION_LIMIT_HIT)) { - (void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Too frequent unsuccessful login attempts for user %s, try again later.", user_name); + (void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Too frequent login attempts for user %s, try again later.", user_name); pam_syslog(handle, LOG_ERR, "Failed to acquire home for user %s: %s", user_name, bus_error_message(error, ret)); return PAM_MAXTRIES; diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index 3313c18167..c3e57cec95 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -26,6 +26,13 @@ inspect() { homectl inspect --json=pretty "$USERNAME" } +wait_for_state() { + for ((i=0;i<10;i++)) ; do + homectl inspect "$1" | grep -qF "State: $2" && break + sleep .5 + done +} + systemd-analyze log-level debug systemd-analyze log-target console systemctl service-log-level systemd-homed debug @@ -146,18 +153,33 @@ if ! systemd-detect-virt -cq ; then inspect test-user2 fi +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz \ && { echo 'unexpected success'; exit 1; } +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- touch /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- rm /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test ! -f /home/test-user/xyz +wait_for_state test-user inactive PASSWORD=xEhErW0ndafV4s homectl with test-user -- test -f /home/test-user/xyz \ && { echo 'unexpected success'; exit 1; } +wait_for_state test-user inactive homectl remove test-user +if ! systemd-detect-virt -cq ; then + wait_for_state test-user2 active + homectl deactivate test-user2 + wait_for_state test-user2 inactive + homectl remove test-user2 +fi + systemd-analyze log-level info echo OK >/testok