From 5782235ecf6b346d23adae034e349c8e9354844b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 26 Sep 2009 19:13:05 +0000 Subject: [PATCH] Patch from Jeremy Chadwick: Linux telnetd allows importing the USER envvar via telnet, while FreeBSD does not. FreeBSD, on the other hand, does allow the LOGNAME envvar. Check USER first, then LOGNAME. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@462 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- TODO | 2 ++ dgamelaunch.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/TODO b/TODO index 496cb80..94edd34 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +-inprogress-dir config option prepends the dgl-root dir, other + config dirs do not. unify. -allow changing the name where the ttyrecs are saved, like ttyrec_fn = "%rttyrec/%n/%g/%p.ttyrec" -allow typing / in watching screen to search for a user diff --git a/dgamelaunch.c b/dgamelaunch.c index ed6fddd..2ee1969 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -1847,6 +1847,14 @@ main (int argc, char** argv) p = getenv("USER"); + /* Linux telnetd allows importing the USER envvar via telnet, + * while FreeBSD does not. FreeBSD, on the other hand, does allow + * the LOGNAME envvar. Check USER first, then LOGNAME. + */ + if (p == NULL) { + p = getenv("LOGNAME"); + } + if (p && *p != '\0') auth = strdup(p); /* else auth is still NULL */ -- 2.47.3