Commit 7fb6338c authored by Alan Coopersmith's avatar Alan Coopersmith

os: Report errors opening authorization file (#469)

Fixes: xorg/xserver#469Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent a3d01ee9
......@@ -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++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment