mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user