#include "strescape.h"
#include "home-expand.h"
#include "mkdir-parents.h"
+#include "eacces-error.h"
#include "file-lock.h"
#include "file-dotlock.h"
#include "nfs-workarounds.h"
if (dict->fd == -1) {
if (errno == ENOENT)
return 0;
- i_error("open(%s) failed: %m", dict->path);
+ if (errno == EACCES)
+ i_error("%s", eacces_error_get("open", dict->path));
+ else
+ i_error("open(%s) failed: %m", dict->path);
return -1;
}
dict->refreshed = FALSE;
path = t_strdup_until(dict->path, p);
if (stat_first_parent(path, &root, &st) < 0) {
- i_error("stat(%s) failed: %m", root);
+ if (errno == EACCES)
+ i_error("%s", eacces_error_get("stat", root));
+ else
+ i_error("stat(%s) failed: %m", root);
return -1;
}
if ((st.st_mode & S_ISGID) != 0) {
}
if (mkdir_parents(path, mode) < 0 && errno != EEXIST) {
- i_error("mkdir_parents(%s) failed: %m", path);
+ if (errno == EACCES)
+ i_error("%s", eacces_error_get("mkdir_parents", path));
+ else
+ i_error("mkdir_parents(%s) failed: %m", path);
return -1;
}
return 0;
dict->fd = open(dict->path, O_CREAT | O_RDWR, 0600);
}
if (dict->fd == -1) {
- i_error("creat(%s) failed: %m", dict->path);
+ if (errno == EACCES)
+ i_error("%s", eacces_error_get("creat", dict->path));
+ else
+ i_error("creat(%s) failed: %m", dict->path);
return -1;
}
(void)fd_copy_parent_dir_permissions(dict->path, dict->fd,