Lines Matching defs:errmsg

29 static void write_eacces_error(string_t *errmsg, const char *path, int mode)
46 str_printfa(errmsg, " missing +%c perm: %s", c, path);
51 string_t *errmsg)
59 str_printfa(errmsg, " stat(%s) failed: %m", path);
91 write_eacces_error(errmsg, path, access_mode);
95 str_printfa(errmsg, ", we're not in group %s",
99 str_printfa(errmsg, "(%s)", group->gr_name);
105 static int test_access(const char *path, int access_mode, string_t *errmsg)
113 write_eacces_error(errmsg, path, access_mode);
115 FALSE, errmsg) == 0) {
116 str_append(errmsg, ", UNIX perms appear ok "
121 str_printfa(errmsg, ", access(%s, %d) failed: %m",
136 write_eacces_error(errmsg, path, access_mode);
138 str_printfa(errmsg, ", stat(%s/test) failed: %m", path);
147 return test_manual_access(path, access_mode, TRUE, errmsg);
157 string_t *errmsg;
162 errmsg = t_str_new(256);
163 str_printfa(errmsg, "%s(%s)", func, path);
168 str_printfa(errmsg, " in an unknown directory");
170 str_printfa(errmsg, " in directory %s", dir);
174 str_printfa(errmsg, " failed: Permission denied (euid=%s",
179 str_append(errmsg, "(<getpwuid() error>)");
182 str_append(errmsg, "(<unknown>)");
186 str_printfa(errmsg, "(%s)", pw_name);
190 str_printfa(errmsg, " egid=%s", dec2str(getegid()));
193 str_append(errmsg, "(<getgrgid() error>)");
196 str_append(errmsg, "(<unknown>)");
200 str_printfa(errmsg, "(%s)", gr_name);
221 str_printfa(errmsg, " stat(%s) failed: %m", dir);
229 if (test_access(dir, X_OK, errmsg) < 0) {
232 } else if (creating && test_access(dir, W_OK, errmsg) < 0) {
236 test_access(path, R_OK, errmsg) < 0) {
237 } else if (!creating && test_access(path, W_OK, errmsg) < 0) {
244 str_append(errmsg, " UNIX perms appear ok "
253 str_printfa(errmsg, ", conflicting dir uid=%s(%s)",
256 str_printfa(errmsg, ", dir owned by %s:%s mode=0%o",
262 str_append(errmsg, ", dir owner missing perms");
267 str_printfa(errmsg, ", conflicting dir gid=%s(%s)",
271 str_append_c(errmsg, ')');
273 return str_c(errmsg);
289 string_t *errmsg;
293 errmsg = t_str_new(256);
295 str_printfa(errmsg, "%s(%s, group=%s", func, path, dec2str(gid));
298 str_printfa(errmsg, "(%s)", group->gr_name);
300 str_printfa(errmsg, ") failed: Operation not permitted (egid=%s",
304 str_printfa(errmsg, "(%s)", group->gr_name);
306 str_printfa(errmsg, ", group based on %s", gid_origin);
307 str_append(errmsg, " - see http://wiki2.dovecot.org/Errors/ChgrpNoPerm)");
309 return str_c(errmsg);