From: Bruno Haible Date: Mon, 10 Mar 2025 05:23:06 +0000 (+0100) Subject: getlogin, getlogin_r: Document limitation. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=69cbf3e2b3f93b2c42d0c07d29fa756914711cf8;p=gnulib.git getlogin, getlogin_r: Document limitation. Reported by Nicolas Boos in . * doc/posix-functions/getlogin.texi: Mention the "different user names with same uid" limitation. * doc/posix-functions/getlogin_r.texi: Likewise. --- diff --git a/ChangeLog b/ChangeLog index d8eb0e8df7..fbda8372e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-03-10 Bruno Haible + + getlogin, getlogin_r: Document limitation. + Reported by Nicolas Boos in + . + * doc/posix-functions/getlogin.texi: Mention the "different user names + with same uid" limitation. + * doc/posix-functions/getlogin_r.texi: Likewise. + 2025-03-09 Bruno Haible getlogin_r: Work around musl bug. diff --git a/doc/posix-functions/getlogin.texi b/doc/posix-functions/getlogin.texi index 0ccce336ce..b0b8da73ae 100644 --- a/doc/posix-functions/getlogin.texi +++ b/doc/posix-functions/getlogin.texi @@ -16,7 +16,8 @@ older mingw, MSVC 14. This function is not declared unless @code{_POSIX} is defined on some platforms: mingw. @item -This function returns the value of the @env{LOGNAME} environment variable: +This function returns the value of the @env{LOGNAME} environment variable +and this therefore arbitrarily fakeable: musl libc 1.2.5. @end itemize @@ -26,4 +27,9 @@ Portability problems not fixed by Gnulib: This function returns an empty string even when standard input is a tty on some platforms: HP-UX 11.11. +@item +When there are several user names with the same user ID, +this function may return, instead of the user name that logged in, +another user name that has the same user ID, on some platforms: +Linux and others. @end itemize diff --git a/doc/posix-functions/getlogin_r.texi b/doc/posix-functions/getlogin_r.texi index df145ecfe2..0e3b7968db 100644 --- a/doc/posix-functions/getlogin_r.texi +++ b/doc/posix-functions/getlogin_r.texi @@ -21,7 +21,8 @@ This function returns a truncated result, instead of failing with error code @code{ERANGE}, when the buffer is not large enough, on some platforms: macOS 14. @item -This function returns the value of the @env{LOGNAME} environment variable: +This function returns the value of the @env{LOGNAME} environment variable +and this therefore arbitrarily fakeable: musl libc 1.2.5. @end itemize @@ -42,4 +43,9 @@ This function fails with error code @code{ENOMEM} instead of @code{ERANGE} on some platforms: @c https://dev.haiku-os.org/ticket/18349 Haiku. +@item +When there are several user names with the same user ID, +this function may return, instead of the user name that logged in, +another user name that has the same user ID, on some platforms: +Linux and others. @end itemize