]> Savannah Git Hosting - gnulib.git/commit
getlogin-tests: avoid false failure under sudo/ssh etc.
authorGuilherme de Almeida Suckevicz <guito.linux@gmail.com>
Wed, 14 May 2014 21:06:24 +0000 (22:06 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 14 May 2014 21:13:38 +0000 (22:13 +0100)
commit97249cf2945e8fe18ed138af20d6e46761fd0470
tree92d27fad8a80a00de6dd3735cca5f5d328bd5db3
parent94ee038129c3b40510ef0ff6ac6ddfe85bf0f97f
getlogin-tests: avoid false failure under sudo/ssh etc.

* modules/getlogin-tests (configure.ac): Check for ttyname().
* tests/test-getlogin.c (main): Don't depend on environment variables
to correlate with getlogin(), since sudo and ssh etc. can tamper
with the LOGNAME and USER env vars.  Instead lookup the name from
the uid associated with the stdin tty.
ChangeLog
modules/getlogin-tests
tests/test-getlogin.c