From 6528628b5c771c25ffa0cb1a46c6c89d9d0d69e0 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 17 Mar 2025 14:35:51 +0100 Subject: [PATCH] getty: improve argument handling when launching login Add explicit argument separator before username to ensure correct parsing of the login command regardless of username format. This follows best practices for command execution and prevents unexpected behavior when processing special characters in usernames. Signed-off-by: Joachim Wiberg --- src/getty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/getty.c b/src/getty.c index 4d9ce5df..63316842 100644 --- a/src/getty.c +++ b/src/getty.c @@ -312,9 +312,9 @@ static int exec_login(char *name) struct stat st; if (passenv) - execl(_PATH_LOGIN, _PATH_LOGIN, "-p", name, NULL); + execl(_PATH_LOGIN, _PATH_LOGIN, "-p", "--", name, NULL); else - execl(_PATH_LOGIN, _PATH_LOGIN, name, NULL); + execl(_PATH_LOGIN, _PATH_LOGIN, "--", name, NULL); /* * Failed to exec login, should not happen on normal systems.