xserver: Branch 'server-1.19-branch' - 5 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Sep 25 19:57:23 UTC 2017


 configure.ac                           |    2 +-
 hw/xfree86/common/xf86Xinput.c         |    3 +++
 hw/xfree86/common/xf86pciBus.c         |    2 +-
 hw/xfree86/os-support/linux/lnx_init.c |    3 +++
 hw/xfree86/xorg-wrapper.c              |    3 +++
 include/xorg-config.h.in               |    3 +++
 os/utils.c                             |    2 +-
 test/signal-logging.c                  |    2 +-
 8 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 126144c2355ce5a3a350f15ef97389c7f34bb6fb
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri May 5 09:04:35 2017 +1000

    xfree86: up the path name size to 512 in xf86MatchDriverFromFiles
    
    ./hw/xfree86/common/xf86pciBus.c: In function ‘xf86MatchDriverFromFiles’:
    ../hw/xfree86/common/xf86pciBus.c:1330:52: warning: ‘snprintf’ output may be
    truncated before the last format character [-Wformat-truncation=]
                 snprintf(path_name, sizeof(path_name), "%s/%s", ^~~~~~~
    ../hw/xfree86/common/xf86pciBus.c:1330:13: note: ‘snprintf’ output between 2
    
    dirent->d_name is 256, so sprintf("%s/%s") into a 256 buffer gives us:
    
    and 257 bytes into a destination of size 256
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 96af794dc648eadcd596893412d7530e92cb5421)

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 8158c2b62..e61ae0cd4 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1303,7 +1303,7 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
     char *line = NULL;
     size_t len;
     ssize_t read;
-    char path_name[256], vendor_str[5], chip_str[5];
+    char path_name[512], vendor_str[5], chip_str[5];
     uint16_t vendor, chip;
     int i = 0, j;
 
commit a114286c079c42067b001ac330501496e2e297a1
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Sep 6 11:53:02 2017 +1000

    test: fix compiler warning
    
    signal-logging.c:182:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit ea82ececbf85a7ac3d0931687f44c57534fde17c)

diff --git a/test/signal-logging.c b/test/signal-logging.c
index 3d2d04801..7f2972003 100644
--- a/test/signal-logging.c
+++ b/test/signal-logging.c
@@ -177,7 +177,7 @@ static void logging_format(void)
     strcpy(&buf[sizeof(buf) - 4], "end");
 
     LogInit(log_file_path, NULL);
-    assert(f = fopen(log_file_path, "r"));
+    assert((f = fopen(log_file_path, "r")));
 
 #define read_log_msg(msg) do {                                  \
         msg = fgets(read_buf, sizeof(read_buf), f);             \
commit d230e12d7dac4461626d0c6edfd692571592a280
Author: Nick Sarnie <commendsarnex at gmail.com>
Date:   Sat Sep 23 17:35:48 2017 -0400

    suid: Include sysmacros.h to fix build after glibc-2.25
    
    [Added HAVE_SYS_SYSMACROS_H guard - ajax]
    
    Signed-off-by: Nick Sarnie <commendsarnex at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 84e3b96b531363e47f6789aacfcae4aa60135e2e)

diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index a25e6ff5f..c5e4a278b 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -35,6 +35,9 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 #include <sys/types.h>
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/consio.h>
commit c5320244a3501aaf9558715e9097a2a625cb768b
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 27 14:45:25 2017 -0400

    xfree86: Silence a new glibc warning
    
    glibc would like to stop declaring major()/minor() macros in
    <sys/types.h> because that header gets included absolutely everywhere
    and unix device major/minor is perhaps usually not what's expected. Fair
    enough. If one includes <sys/sysmacros.h> as well then glibc knows we
    meant it and doesn't warn, so do that if it exists.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit d732c36597fab2e9bc4f2aa72cf1110997697557)

diff --git a/configure.ac b/configure.ac
index e6c5b35de..e9167e460 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,7 +134,7 @@ AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \
- fnmatch.h sys/mkdev.h sys/utsname.h])
+ fnmatch.h sys/mkdev.h sys/sysmacros.h sys/utsname.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 39de498a3..136bf50ff 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -84,6 +84,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 #ifdef HAVE_SYS_MKDEV_H
 #include <sys/mkdev.h>          /* for major() & minor() on Solaris */
 #endif
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index dbf497ca2..9e5ddcd50 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -38,6 +38,9 @@
 #include "xf86_OSlib.h"
 
 #include <sys/stat.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 
 #ifndef K_OFF
 #define K_OFF 0x4
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index a7d80b5af..931609f90 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -124,6 +124,9 @@
 /* Define to 1 if you have the <sys/mkdev.h> header file. */
 #undef HAVE_SYS_MKDEV_H
 
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+#undef HAVE_SYS_SYSMACROS_H
+
 /* Path to text files containing PCI IDs */
 #undef PCI_TXT_IDS_PATH
 
commit 0e79797e3cb3f8fafe271f4f233a8a8fd25f2001
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Aug 30 15:11:45 2017 -0400

    os: Fix warning in LockServer
    
    The meson build gives me:
    
    ../os/utils.c: In function ‘LockServer’:
    ../os/utils.c:310:40: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
         snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid());
                                            ^~~~~~~~~
    ../os/utils.c:310:5: note: ‘snprintf’ output between 12 and 13 bytes into a destination of size 12
         snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid());
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Which seems to be due to the %d part meaning that a negative number's -
    sign would be one wider than we're expecting. Fine, just coerce it to
    unsigned.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    (cherry picked from commit aabf65d2a0206bd1a9c6e9a9f3153ded873dfd43)

diff --git a/os/utils.c b/os/utils.c
index 7379121b5..6dcf3285e 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -318,7 +318,7 @@ LockServer(void)
     }
     if (lfd < 0)
         FatalError("Could not create lock file in %s\n", tmp);
-    snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid());
+    snprintf(pid_str, sizeof(pid_str), "%10lu\n", (unsigned long) getpid());
     if (write(lfd, pid_str, 11) != 11)
         FatalError("Could not write pid to lock file in %s\n", tmp);
     (void) fchmod(lfd, 0444);


More information about the xorg-commit mailing list