Skip to content

Conversation

@Karlson2k
Copy link
Contributor

When 'login' is started as 'init' process it has PID == 1. If PAM is not used, 'login' does not fork itself and getppid() return 0. To simplify the code, check for own PID before forking which gives correct value ('1' for 'init' process) for both PAM and non-PAM builds.

Initially the code for 'init' mode was introduced to support starting by init=/bin/login.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374547

When 'login' is started as 'init' process it has PID == 1.
If PAM is not used, 'login' does not fork itself and getppid() return 0.
To simplify the code, check for own PID before forking which gives
correct value ('1' for 'init' process) for both PAM and non-PAM builds.
@Karlson2k
Copy link
Contributor Author

Superseded by #1305

@Karlson2k Karlson2k closed this Jul 19, 2025
@Karlson2k Karlson2k deleted the login-init-fix branch July 19, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant