]> Savannah Git Hosting - gnulib.git/commitdiff
getlogin, getlogin_r: Document limitation.
authorBruno Haible <bruno@clisp.org>
Mon, 10 Mar 2025 05:23:06 +0000 (06:23 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 10 Mar 2025 05:23:06 +0000 (06:23 +0100)
Reported by Nicolas Boos <nicolas.boos@wanadoo.fr> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00033.html>.

* doc/posix-functions/getlogin.texi: Mention the "different user names
with same uid" limitation.
* doc/posix-functions/getlogin_r.texi: Likewise.

ChangeLog
doc/posix-functions/getlogin.texi
doc/posix-functions/getlogin_r.texi

index d8eb0e8df719f933171b3c8b6d3a41926a5dff45..fbda8372e725ca160fa7ff53d04c896ce77d5b71 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-03-10  Bruno Haible  <bruno@clisp.org>
+
+       getlogin, getlogin_r: Document limitation.
+       Reported by Nicolas Boos <nicolas.boos@wanadoo.fr> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00033.html>.
+       * 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  <bruno@clisp.org>
 
        getlogin_r: Work around musl bug.
index 0ccce336ce838b580df89086ac14c750459b0a7e..b0b8da73ae795f4aa149abe1a994be04eca2371d 100644 (file)
@@ -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
index df145ecfe2763fd66a09c6566f52a0686282b8b8..0e3b7968db9338ccbcc99a6ff81441bdc9ac746a 100644 (file)
@@ -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