xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 2 04:28:17 UTC 2019


 os/auth.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 7fb6338c68e158053295cb448faa5c559aa9990c
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Tue Jan 1 16:49:32 2019 -0800

    os: Report errors opening authorization file (#469)
    
    Fixes: xorg/xserver#469
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/os/auth.c b/os/auth.c
index da8b70985..d3254349d 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -42,6 +42,7 @@ from The Open Group.
 #include   "dixstruct.h"
 #include   <sys/types.h>
 #include   <sys/stat.h>
+#include   <errno.h>
 #ifdef WIN32
 #include    <X11/Xw32defs.h>
 #endif
@@ -119,9 +120,15 @@ LoadAuthorization(void)
     if (!authorization_file)
         return 0;
 
+    errno = 0;
     f = Fopen(authorization_file, "r");
-    if (!f)
+    if (!f) {
+        LogMessageVerb(X_ERROR, 0,
+                       "Failed to open authorization file \"%s\": %s\n",
+                       authorization_file,
+                       errno != 0 ? strerror(errno) : "Unknown error");
         return -1;
+    }
 
     while ((auth = XauReadAuth(f)) != 0) {
         for (i = 0; i < NUM_AUTHORIZATION; i++) {


More information about the xorg-commit mailing list