This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
manual: cuserid is mtasurace if not passed a string
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 07 Nov 2014 06:19:30 -0200
- Subject: manual: cuserid is mtasurace if not passed a string
- Authentication-results: sourceware.org; auth=none
During the MTASC-Safety code review, in my analysis of cuserid, I failed
to notice the use of the static buffer in case a buffer is not passed as
an argument. Oops. This patch fixes the error. Ok to install?
From: Alexandre Oliva <aoliva@redhat.com>
for ChangeLog
* manual/users.texi (cuserid): Fix MT-Safety note for the case
of not passing it a buffer.
Reported by Peng Haitao.
---
manual/users.texi | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/manual/users.texi b/manual/users.texi
index a14a256..e8f0f3b 100644
--- a/manual/users.texi
+++ b/manual/users.texi
@@ -927,8 +927,9 @@ this function or to @code{cuserid}.
@comment stdio.h
@comment POSIX.1
@deftypefun {char *} cuserid (char *@var{string})
-@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@ascudlopen{} @ascuplugin{} @ascuheap{} @asulock{}}@acunsafe{@acucorrupt{} @aculock{} @acsfd{} @acsmem{}}}
-@c cuserid @mtslocale @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem
+@safety{@prelim{}@mtunsafe{@mtasurace{:cuserid/!string} @mtslocale{}}@asunsafe{@ascudlopen{} @ascuplugin{} @ascuheap{} @asulock{}}@acunsafe{@acucorrupt{} @aculock{} @acsfd{} @acsmem{}}}
+@c cuserid @mtasurace:cuserid/!string @mtslocale @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem
+@c if string is NULL, cuserid will overwrite and return a static buffer
@c geteuid dup ok
@c getpwuid_r dup @mtslocale @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem
@c strncpy dup ok
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer