]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: Don't overwrite TERM if already set
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 8 May 2023 08:03:09 +0000 (10:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 8 May 2023 08:03:09 +0000 (10:03 +0200)
The service invoking sulogin might already have set TERM to something
useful so if that's the case let's not overwrite it.

login-utils/sulogin.c

index 98147509c369e59dd69dec39fe1bfe2c862c18a5..45a558d3eaf2adfda142d64b8d5570faf51d6a2b 100644 (file)
@@ -274,18 +274,18 @@ static void tcfinal(struct console *con)
        if (con->flags & CON_EIO)
                return;
        if ((con->flags & CON_SERIAL) == 0) {
-               xsetenv("TERM", "linux", 1);
+               xsetenv("TERM", "linux", 0);
                return;
        }
        if (con->flags & CON_NOTTY) {
-               xsetenv("TERM", "dumb", 1);
+               xsetenv("TERM", "dumb", 0);
                return;
        }
 
 #if defined (__s390__) || defined (__s390x__)
-       xsetenv("TERM", "dumb", 1);
+       xsetenv("TERM", "dumb", 0);
 #else
-       xsetenv("TERM", "vt102", 1);
+       xsetenv("TERM", "vt102", 0);
 #endif
        tio->c_iflag |= (IXON | IXOFF);
        tio->c_lflag |= (ICANON | ISIG | ECHO|ECHOE|ECHOK|ECHOKE);