]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: use path_equal() to compare tty names
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2019 20:18:59 +0000 (21:18 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2019 20:18:59 +0000 (21:18 +0100)
After all they might be strings such as pts/1 which we really should
consider the same as pts//1.

src/core/execute.c

index d46476630ccdff55fe15daecc17a504da358b75f..ac741c2772c36ca87b10b51c4c981c42fcfd0e52 100644 (file)
@@ -4157,7 +4157,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 streq(resolved, tty) || (streq(resolved, "tty0") && tty_is_vc(tty));
+        return path_equal(resolved, tty) || (streq(resolved, "tty0") && tty_is_vc(tty));
 }
 
 bool exec_context_may_touch_console(const ExecContext *ec) {