]> git.ipfire.org Git - thirdparty/shadow.git/commit
subsystem: Prevent endless loop
authorSamanta Navarro <ferivoz@riseup.net>
Tue, 23 May 2023 11:53:53 +0000 (11:53 +0000)
committerSerge Hallyn <serge@hallyn.com>
Thu, 25 May 2023 13:25:42 +0000 (08:25 -0500)
commit4ad359ccc69ebfac5e6447562fca5a1741111324
tree91ba30c534682e8f846fdbc7baac61685175712e
parent419cf1f1c4721829c4d68c9e5fee112a5da5890f
subsystem: Prevent endless loop

If a user has home directory "/" and login shell "*" then login and su
enter an endless loop by constantly switching to the next subsystem.

This could also be achieved with a layered approach so just checking
for "/" as home directory is not enough to protect against such a
misconfiguration.

Just break the loop if it progressed too far. I doubt that this has
negative impact on any real setup.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
libmisc/sub.c