diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-01-01 16:49:32 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-01-01 16:50:24 -0800 |
commit | 7fb6338c68e158053295cb448faa5c559aa9990c (patch) | |
tree | da92091a636b7f6ccd639e51ac20494fa1fa63d7 /os | |
parent | a3d01ee9d0b5e523b0771e2a26542ac15e29a33f (diff) | |
download | xserver-7fb6338c68e158053295cb448faa5c559aa9990c.tar.gz |
os: Report errors opening authorization file (#469)
Fixes: xorg/xserver#469
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
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++) { |