core: Resolve /dev/console if it's connected to stdin (#36666)

This commit is contained in:
Daan De Meyer
2025-04-06 14:14:35 +02:00
committed by GitHub
3 changed files with 26 additions and 15 deletions
+1 -1
View File
@@ -967,7 +967,7 @@ static bool tty_may_match_dev_console(const char *tty) {
return true; /* if we could not resolve, assume it may */
/* "tty0" means the active VC, so it may be the same sometimes */
return path_equal(resolved, tty) || (streq(resolved, "tty0") && tty_is_vc(tty));
return path_equal(skip_dev_prefix(resolved), tty) || (streq(skip_dev_prefix(resolved), "tty0") && tty_is_vc(tty));
}
static bool exec_context_may_touch_tty(const ExecContext *ec) {