public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] login: Add nonstring attributes to struct utmpx [BZ #24899]
Date: Tue, 13 Aug 2019 15:01:00 -0000	[thread overview]
Message-ID: <6e4843a3-58a7-a08b-a266-e406f9f57c09@linaro.org> (raw)
In-Reply-To: <87mugdjoxw.fsf@oldenburg2.str.redhat.com>



On 13/08/2019 08:16, Florian Weimer wrote:
> * Florian Weimer:
> 
>> Commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c ("The
>> -Wstringop-truncation option new in GCC 8 detects common misuses")
>> added __attribute_nonstring__ to bits/utmp.h, but it did not update
>> the parallel bits/utmpx.h header.
>>
>> 2019-08-12  Florian Weimer  <fweimer@redhat.com>
>>
>> 	[BZ #24899]
>> 	* sysdeps/gnu/bits/utmpx.h (struct utmpx): Add
>> 	__attribute_nonstring__ to ut_line, ut_user, ut_host.
> 
> I forgot to update the s390 header.  The patch below fixes this.
> 
> Thanks,
> Florian
> 
> login: Add nonstring attributes to struct utmpx [BZ #24899]
> 
> Commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c ("The
> -Wstringop-truncation option new in GCC 8 detects common misuses")
> added __attribute_nonstring__ to bits/utmp.h, but it did not update
> the parallel bits/utmpx.h header.
> 
> 2019-08-13  Florian Weimer  <fweimer@redhat.com>
> 
> 	[BZ #24899]
> 	* sysdeps/gnu/bits/utmpx.h (struct utmpx): Add
> 	__attribute_nonstring__ to ut_line, ut_user, ut_host.
> 	* sysdeps/unix/sysv/linux/s390/bits/utmpx.h (struct utmpx):
> 	Likewise.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

> 
> diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
> index 472a7d57d3..36259dbae1 100644
> --- a/sysdeps/gnu/bits/utmpx.h
> +++ b/sysdeps/gnu/bits/utmpx.h
> @@ -56,10 +56,13 @@ struct utmpx
>  {
>    short int ut_type;		/* Type of login.  */
>    __pid_t ut_pid;		/* Process ID of login process.  */
> -  char ut_line[__UT_LINESIZE];	/* Devicename.  */
> +  char ut_line[__UT_LINESIZE]
> +    __attribute_nonstring__;	/* Devicename.  */
>    char ut_id[4];		/* Inittab ID. */
> -  char ut_user[__UT_NAMESIZE];	/* Username.  */
> -  char ut_host[__UT_HOSTSIZE];	/* Hostname for remote login.  */
> +  char ut_user[__UT_NAMESIZE]
> +    __attribute_nonstring__;	/* Username.  */
> +  char ut_host[__UT_HOSTSIZE]
> +    __attribute_nonstring__;	/* Hostname for remote login.  */
>    struct __exit_status ut_exit;	/* Exit status of a process marked
>  				   as DEAD_PROCESS.  */
>  
> diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
> index ea3e860a2d..dab099994a 100644
> --- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
> +++ b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
> @@ -56,10 +56,13 @@ struct utmpx
>  {
>    short int ut_type;		/* Type of login.  */
>    __pid_t ut_pid;		/* Process ID of login process.  */
> -  char ut_line[__UT_LINESIZE];	/* Devicename.  */
> +  char ut_line[__UT_LINESIZE]
> +    __attribute_nonstring__;	/* Devicename.  */
>    char ut_id[4];		/* Inittab ID. */
> -  char ut_user[__UT_NAMESIZE];	/* Username.  */
> -  char ut_host[__UT_HOSTSIZE];	/* Hostname for remote login.  */
> +  char ut_user[__UT_NAMESIZE]
> +    __attribute_nonstring__;	/* Username.  */
> +  char ut_host[__UT_HOSTSIZE]
> +    __attribute_nonstring__;	/* Hostname for remote login.  */
>    struct __exit_status ut_exit;	/* Exit status of a process marked
>  				   as DEAD_PROCESS.  */
>  
> 

  reply	other threads:[~2019-08-13 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 13:48 Florian Weimer
2019-08-13 11:16 ` Florian Weimer
2019-08-13 15:01   ` Adhemerval Zanella [this message]
2019-08-15 13:49     ` Florian Weimer
2019-08-15 13:59       ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e4843a3-58a7-a08b-a266-e406f9f57c09@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).