summaryrefslogtreecommitdiff
path: root/tests/test-getlogin.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* getlogin tests, getlogin_r tests: Avoid failure on Solaris OpenIndiana.Bruno Haible2020-12-301-1/+8
| | | | | | | * tests/test-getlogin.c (main): Don't fail if getlogin() returns NULL with no errno. * tests/test-getlogin_r.c (main): Don't fail if getlogin_r() returns EINVAL.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* getlogin tests: Avoid #ifdefs when sharing code between modules.Bruno Haible2017-07-111-2/+38
| | | | | | | | | | * 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().
* getlogin: don’t assume one name per uidPaul Eggert2017-07-101-110/+2
| | | | | | | | | | | | | | 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.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* getlogin: Port to newer mingw.Bruno Haible2016-12-171-1/+3
| | | | | | | | | | | * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_GETLOGIN. * m4/getlogin.m4 (gl_FUNC_GETLOGIN): Set HAVE_DECL_GETLOGIN. * modules/unistd (Makefile.am): Substibute HAVE_DECL_GETLOGIN, not HAVE_GETLOGIN. * lib/unistd.in.h (getlogin): Test HAVE_DECL_GETLOGIN, not HAVE_GETLOGIN. * doc/posix-functions/getlogin.texi: Mention the issue. * tests/test-getlogin.c: Don't include <pwd.h> on native Windows.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* tests: pacify GCC 5.1's stricter printf checkingPaul Eggert2015-04-271-3/+3
| | | | | | | | | | | | | | * tests/test-dirname.c (main): * tests/test-getaddrinfo.c (simple): * tests/test-getlogin.c (main): * tests/test-getndelim2.c (main): * tests/test-inttostr.c (CK): * tests/test-md5.c (main): * tests/test-read-file.c (main): * tests/test-sha1.c (main): Fix mismatches between printf format and value signedness. * tests/test-inttostr.c (FMT, CAST_VAL, V_min, V_max): Remove, as CAST_VAL always returned a value of type uintmax_t.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* getlogin-tests: avoid false failure under cronPádraig Brady2014-05-181-2/+0
| | | | | | * tests/test-getlogin.c (main): Avoid verifying errnos from ttyname() since that's not what's under test. Centos 6 was seen to return EINVAL for ttyname() when run from cron.
* getlogin-tests: avoid false failure under sudo/ssh etc.Guilherme de Almeida Suckevicz2014-05-141-5/+31
| | | | | | | | * 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.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* getlogin_r-tests: allow errno == ENXIO or ENOENTPádraig Brady2012-11-091-0/+1
| | | | | | | | * tests/test-getlogin.c (main): Skip tests if getlogin fails with errno == ENXIO (No controlling tty). * tests/test-getlogin_r.c (main): Skip tests if getlogin_r fails with errno == ENOENT. This was reported to happen in various situations on GNU/Linux.
* getlogin-tests: allow errno == ENOENTPaul Eggert2012-11-091-0/+7
| | | | | | * tests/test-getlogin.c (main): Skip tests if getlogin fails with errno == ENOENT. This happened to me on Ubuntu 12.04.1 x86, when running a test in an Emacs shell buffer.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.Bruno Haible2011-09-211-1/+3
| | | | | * tests/test-getlogin.c (main): Allow a failure with EINVAL. * tests/test-getlogin_r.c (main): Likewise.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* getlogin, getlogin_r: Document HP-UX 11.11 bugs.Bruno Haible2010-12-201-0/+4
| | | | | * tests/test-getlogin.c: Include <errno.h>. (main): Avoid test failure on HP-UX 11.11.
* getlogin, getlogin_r: Avoid test failure.Bruno Haible2010-01-121-1/+8
|
* Tests for module 'getlogin'.Bruno Haible2010-01-091-0/+63