Skip to content

Commit 6552cda

Browse files
committed
Fix #427: make sure first found binary is used as external getty
When using Finit with an external getty that supports alternative login program argument, the tty_parse_args() function did not check if a getty command had already been registered: tty [12345] /sbin/agetty -L -l /bin/login console noclear This caused Finit to try /bin/login as the getty program. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 3add682 commit 6552cda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ int tty_parse_args(struct tty *tty, char *cmd, char **args)
172172
passenv = 1;
173173
else if (!strcmp(cmd, "rescue"))
174174
tty->rescue = 1; /* for rescue shells */
175-
else if (whichp(cmd)) /* in $PATH? */
175+
else if (!tty->cmd && whichp(cmd))
176176
tty->cmd = cmd;
177177
else
178178
tty->args[tty->num++] = cmd;

0 commit comments

Comments
 (0)