confd: prevent motd from showing on non-shell user login attempts

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-01-22 22:44:15 +01:00
parent 3463de98bb
commit b020eda9a4
+6 -2
View File
@@ -557,10 +557,14 @@ static void del_groups(const char *user, const char **groups)
/* Users with a valid shell are also allowed CLI access */
static void adjust_access(const char *user, const char *shell)
{
if (strcmp(shell, "/bin/false"))
if (strcmp(shell, "/bin/false")) {
add_group(user, "klish");
else
erasef("/home/%s/.hushlogin", user);
} else {
del_group(user, "klish");
/* prevent even motd from showing */
touchf("/home/%s/.hushlogin", user);
}
}
/* XXX: Currently Infix only has admin and non-admins as a group */