From 7fb6338c68e158053295cb448faa5c559aa9990c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 1 Jan 2019 16:49:32 -0800 Subject: [PATCH] os: Report errors opening authorization file (#469) Fixes: xorg/xserver#469 Signed-off-by: Alan Coopersmith --- os/auth.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 #include +#include #ifdef WIN32 #include #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++) { -- GitLab