| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* m4/getlogin.m4: Rename LIB_GETLOGIN to GETLOGIN_LIB.
All uses changed.
* NEWS: Mention the change.
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Letu Ren <fantasquex@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00001.html>.
* modules/getlogin-tests (Depends-on): Add stdbool.
* modules/getlogin_r-tests (Depends-on): Likewise.
* tests/test-getlogin.h: Include stdbool.h.
(test_getlogin_result): On Linux, skip the test if /proc/self/loginuid
contains "-1".
|
|
|
|
|
|
|
|
|
|
| |
* modules/getlogin_r-tests (Files): Add tests/test-getlogin.h.
* modules/getlogin-tests (Files): Likewise. Remove
tests/test-getlogin_r.c.
* tests/test-getlogin.h: Extracted from tests/test-getlogin_r.c.
* tests/test-getlogin.c: Extracted from tests/test-getlogin_r.c.
* tests/test-getlogin_r.c: Include test-getlogin.h. Omit code that tests
getlogin().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Wolfgang F. Muthmann (Bug#27640).
* modules/getlogin-tests (Files): Add tests/test-getlogin_r.c.
(ttyname): Remove test.
* modules/getlogin_r-tests (ttyname): Remove test.
* tests/test-getlogin.c: Replace this near-clone of test-getlogin_r.c
with ‘#define TEST_LOGIN’ followed by ‘#include "test-getlogin_r.c"’.
* tests/test-getlogin_r.c: If TEST_GETLOGIN is defined, test
getlogin rather than getlogin_r. This avoids code duplication.
(main): Use isatty and fstat rather than ttyname and stat.
Use getpwnam instead of getpwuid, to be portable to test platforms
that have multiple login names for the same uid.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* m4/getlogin.m4 (gl_LIB_GETLOGIN): New macro.
* modules/getlogin (configure.ac): Require gl_LIB_GETLOGIN.
(Link): New section.
* modules/getlogin_r (Files): Add m4/getlogin.m4.
(configure.ac): Require gl_LIB_GETLOGIN.
(Link): New section.
* NEWS: Mention the new link requirements.
* modules/getlogin-tests (test_getlogin_LDADD): New variable.
* modules/getlogin_r-tests (test_getlogin_r_LDADD): New variable.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|