]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
login: Add nonstring attributes to struct utmp, struct utmpx [BZ #24899]
authorFlorian Weimer <fweimer@redhat.com>
Thu, 15 Aug 2019 14:09:43 +0000 (16:09 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 15 Aug 2019 14:09:43 +0000 (16:09 +0200)
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.  In struct utmp, the nonstring
attribute for ut_id was missing.

ChangeLog
bits/utmp.h
sysdeps/gnu/bits/utmpx.h
sysdeps/unix/sysv/linux/s390/bits/utmp.h
sysdeps/unix/sysv/linux/s390/bits/utmpx.h

index b13346c95284ef88482655c90b9e58e6d1e8e7b1..c49d952a0ad6ddaf79a4b55fe45edf67d474bd83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2019-08-15  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #24899]
+       * sysdeps/gnu/bits/utmpx.h (struct utmpx): Add
+       __attribute_nonstring__ to ut_line, ut_id, ut_user, ut_host.
+       * sysdeps/unix/sysv/linux/s390/bits/utmpx.h (struct utmpx):
+       Likewise.
+       * sysdeps/gnu/bits/utmp.h (struct utmp): Add
+       __attribute_nonstring__ to ut_id.
+       * sysdeps/unix/sysv/linux/s390/bits/utmpx.h (struct utmp):
+       Likewise.
+
 2019-08-15  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #24880]
index 3c02dd4f3fe4e99bad0f84bb84377ffdd8934929..854b342164b785e06aa72d0b8775f6fd0bf5b2a8 100644 (file)
@@ -61,7 +61,8 @@ struct utmp
   pid_t ut_pid;                        /* Process ID of login process.  */
   char ut_line[UT_LINESIZE]
     __attribute_nonstring__;   /* Devicename.  */
-  char ut_id[4];               /* Inittab ID.  */
+  char ut_id[4]
+    __attribute_nonstring__;   /* Inittab ID.  */
   char ut_user[UT_NAMESIZE]
     __attribute_nonstring__;   /* Username.  */
   char ut_host[UT_HOSTSIZE]
index 472a7d57d3f99eb35cae99d58faa31745bf74812..2beadbf58707e587d980c68225851322ea6404da 100644 (file)
@@ -56,10 +56,14 @@ 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_id[4];               /* Inittab ID. */
-  char ut_user[__UT_NAMESIZE]; /* Username.  */
-  char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login.  */
+  char ut_line[__UT_LINESIZE]
+    __attribute_nonstring__;   /* Devicename.  */
+  char ut_id[4]
+    __attribute_nonstring__;   /* Inittab ID.  */
+  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.  */
 
index 862115c6f88870a2698b3e3d717194afe3010525..0569c3b784b8de6be04e668c7e01e0e522d408cc 100644 (file)
@@ -61,7 +61,8 @@ struct utmp
   pid_t ut_pid;                        /* Process ID of login process.  */
   char ut_line[UT_LINESIZE]
      __attribute_nonstring__;  /* Devicename.  */
-  char ut_id[4];               /* Inittab ID.  */
+  char ut_id[4]
+    __attribute_nonstring__;   /* Inittab ID.  */
   char ut_user[UT_NAMESIZE]
      __attribute_nonstring__;  /* Username.  */
   char ut_host[UT_HOSTSIZE]
index ea3e860a2d28aad0da099b73cd1e2470523e0556..737d9dca054aa832c76968e4bb2dc651111c2b57 100644 (file)
@@ -56,10 +56,14 @@ 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_id[4];               /* Inittab ID. */
-  char ut_user[__UT_NAMESIZE]; /* Username.  */
-  char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login.  */
+  char ut_line[__UT_LINESIZE]
+    __attribute_nonstring__;   /* Devicename.  */
+  char ut_id[4]
+    __attribute_nonstring__;   /* Inittab ID.  */
+  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.  */