diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-09-17 19:11:52 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-09-17 19:22:30 -0700 |
commit | 3a87227bb357ac9523f853fca84ebde3129e2f05 (patch) | |
tree | 14730a0ff33839972e3aea5dfdc8d12f46133b81 | |
parent | da3cfcdd197bd900633c563412685315316804f4 (diff) |
Log errors when failing to make authentication dirs/files
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | auth.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -312,8 +312,16 @@ MakeServerAuthFile (struct display *d, FILE ** file) if ((statb.st_mode & 0077) != 0) (void) chmod(d->authFile, statb.st_mode & 0700); } else { - if (errno == ENOENT) + if (errno == ENOENT) { r = mkdir(d->authFile, 0700); + if (r < 0) { + LogError ("cannot make authentication directory %s: " + "%s\n", d->authFile, _SysErrorMsg (errno)); + } + } else { + LogError ("cannot access authentication directory %s: " + "%s\n", d->authFile, _SysErrorMsg (errno)); + } if (r < 0) { free (d->authFile); d->authFile = NULL; @@ -324,6 +332,8 @@ MakeServerAuthFile (struct display *d, FILE ** file) authDir, authdir1, authdir2); r = mkdir(d->authFile, 0700); if (r < 0 && errno != EEXIST) { + LogError ("cannot make authentication directory %s: %s\n", + d->authFile, _SysErrorMsg (errno)); free (d->authFile); d->authFile = NULL; return FALSE; @@ -333,6 +343,8 @@ MakeServerAuthFile (struct display *d, FILE ** file) #ifdef HAS_MKSTEMP fd = mkstemp (d->authFile); if (fd < 0) { + LogError ("cannot make authentication file %s: %s\n", + d->authFile, _SysErrorMsg (errno)); free (d->authFile); d->authFile = NULL; return FALSE; |