diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-01-01 16:49:32 -0800 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2019-02-20 14:24:42 -0500 |
commit | c091ea5e38b5c41eaf3b10c43dc043401e8251c5 (patch) | |
tree | 33f495e07fd1a567b1d72c8d537f76df14784672 /os | |
parent | 7b0f6102df3b18a048b791fe2304679b1eb2c9e7 (diff) |
os: Report errors opening authorization file (#469)
Fixes: xorg/xserver#469
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 7fb6338c68e158053295cb448faa5c559aa9990c)
Diffstat (limited to 'os')
-rw-r--r-- | os/auth.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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++) { |