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
This commit is contained in:
Pasi Kallinen 2009-09-26 19:13:05 +00:00
parent 3801c41172
commit 5782235ecf
2 changed files with 10 additions and 0 deletions

2
TODO
View File

@ -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

View File

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