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
+-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
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 */