From: Daan De Meyer Date: Mon, 8 May 2023 08:03:09 +0000 (+0200) Subject: sulogin: Don't overwrite TERM if already set X-Git-Tag: v2.39~26^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea94da805a46262a9271f9bc7d839839ca2331eb;p=thirdparty%2Futil-linux.git sulogin: Don't overwrite TERM if already set The service invoking sulogin might already have set TERM to something useful so if that's the case let's not overwrite it. --- diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 98147509c3..45a558d3ea 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -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);