]> git.ipfire.org Git - thirdparty/util-linux.git/commit
agetty: handle systems without a shell or /bin/login
authorMatt Van Horn <455140+mvanhorn@users.noreply.github.com>
Mon, 22 Jun 2026 08:58:11 +0000 (01:58 -0700)
committerMatt Van Horn <455140+mvanhorn@users.noreply.github.com>
Mon, 22 Jun 2026 08:58:11 +0000 (01:58 -0700)
commit081b2af93b233cf0bd1b4f550f1bb46caa41c9df
tree7c859d71f3e44a15fb4f3ea3e5f871f1450724d0
parentc86a60b6a7f9ed33c2826692df17c0f15da6d273
agetty: handle systems without a shell or /bin/login

When the login program (default /bin/login, or the one set with
--login-program) is missing or not executable, logging in is impossible.
Previously agetty still displayed the issue file and prompted for a
username, producing a confusing dead end.

Before prompting, check whether the login program is executable with
access(X_OK). If it is not, print a short banner ("This system does not
permit logins." by default, configurable with --nologin-message) and
wait for the user to press Enter, then re-check so an administrator who
installs the login program at runtime can proceed without a reboot. The
normal prompt flow is unaffected when the login program exists.

Add --nologin-message to override the banner text and document the new
behavior in agetty.8.adoc.

Closes #4117
agetty-cmd/agetty.c
agetty-cmd/agetty.h
term-utils/agetty.8.adoc