From patchwork Fri Nov 7 08:19:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 3603 Received: (qmail 31776 invoked by alias); 7 Nov 2014 08:20:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 31766 invoked by uid 89); 7 Nov 2014 08:20:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com From: Alexandre Oliva To: libc-alpha@sourceware.org Subject: manual: cuserid is mtasurace if not passed a string Date: Fri, 07 Nov 2014 06:19:30 -0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 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 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