/dovecot/src/lib/ |
H A D | safe-mkdir.c | 10 int safe_mkdir(const char *dir, mode_t mode, uid_t uid, gid_t gid) argument 15 if (lstat(dir, &st) < 0) { 17 i_fatal("lstat() failed for %s: %m", dir); 19 if (mkdir(dir, mode) < 0) { 21 i_fatal("Can't create directory %s: %m", dir); 30 fd = open(dir, O_RDONLY); 32 i_fatal("open() failed for %s: %m", dir); 35 i_fatal("fstat() failed for %s: %m", dir); 38 i_fatal("Not a directory %s", dir); 45 i_fatal("fchown() failed for %s: %m", dir); [all...] |
H A D | test-file-create-locked.c | 98 const char *error, *dir; local 104 dir = ".test-temp-file-create-locked-dir"; 105 if (unlink_directory(dir, UNLINK_DIRECTORY_FLAG_RMDIR, &error) < 0) 106 i_fatal("unlink_directory(%s) failed: %s", dir, error); 107 path = t_strconcat(dir, "/lockfile", NULL); 121 if (stat(dir, &st) < 0) 122 i_error("stat(%s) failed: %m", dir); 127 if (unlink_directory(dir, UNLINK_DIRECTORY_FLAG_RMDIR, &error) < 0) 128 i_fatal("unlink_directory(%s) failed: %s", dir, erro [all...] |
H A D | unlink-old-files.c | 15 unlink_old_files_real(const char *dir, const char *prefix, time_t min_time) argument 23 dirp = opendir(dir); 26 i_error("opendir(%s) failed: %m", dir); 32 if (utime(dir, NULL) < 0 && errno != ENOENT) 33 i_error("utime(%s) failed: %m", dir); 36 str_printfa(path, "%s/", dir); 61 i_error("closedir(%s) failed: %m", dir); 65 int unlink_old_files(const char *dir, const char *prefix, time_t min_time) argument 70 ret = unlink_old_files_real(dir, prefix, min_time);
|
H A D | utc-mktime.c | 52 int bits, dir; local 65 dir = tm_cmp(&leap_adj_tm, try_tm); 66 if (dir == 0) 71 if (dir < 0)
|
H A D | file-create-locked.c | 61 const char *dir = t_strdup_until(path, p); local 64 ret = mkdir_parents_chown(dir, set->mkdir_mode, uid, gid); 66 ret = mkdir_parents_chgrp(dir, set->mkdir_mode, 70 *error_r = t_strdup_printf("mkdir_parents(%s) failed: %m", dir);
|
H A D | unlink-directory.c | 7 lstat(dir, ..) -> OK, it's a directory 8 // attacker deletes dir, replaces it with symlink to / 9 opendir(dir) -> it actually opens / 11 Most portable solution is to lstat() the dir, chdir() there, then check 23 Another less portable solution is to fchdir(open(dir, O_NOFOLLOW)). 65 unlink_directory_r(const char *dir, enum unlink_directory_flags flags, argument 74 dir_fd = open(dir, O_RDONLY | O_NOFOLLOW); 78 dir); 84 if (lstat(dir, &st) < 0) { 85 unlink_directory_error(error_r, NULL, ERROR_FORMAT, "lstat", dir); 235 unlink_directory(const char *dir, enum unlink_directory_flags flags, const char **error_r) argument [all...] |
H A D | eacces-error.c | 153 const char *prev_path, *dir = NULL, *p; local 166 if (t_get_working_dir(&dir, &error) < 0) { 170 str_printfa(errmsg, " in directory %s", dir); 171 path = t_strconcat(dir, "/", path, NULL); 209 dir = t_strdup_until(prev_path, p); 210 ret = stat(dir, &st); 213 if (errno == EACCES && strcmp(dir, "/") != 0) { 216 strcmp(dir, "/") != 0) { 221 str_printfa(errmsg, " stat(%s) failed: %m", dir); 224 prev_path = dir; [all...] |
/dovecot/src/lib-storage/list/ |
H A D | mailbox-list-fs-flags.c | 15 list_is_maildir_mailbox(struct mailbox_list *list, const char *dir, argument 36 path = t_strdup_printf("%s/%s", dir, fname); 63 3rd link is either child mailbox or mailbox dir 112 const char *dir, const char *fname, 129 return list_is_maildir_mailbox(list, dir, fname, type, flags_r); 170 path = t_strconcat(dir, "/", fname, NULL); 111 fs_list_get_mailbox_flags(struct mailbox_list *list, const char *dir, const char *fname, enum mailbox_list_file_type type, enum mailbox_info_flags *flags_r) argument
|
/dovecot/src/lib-fs/ |
H A D | fs-sis-common.c | 37 const char *dir, *hash, *hash_path; local 39 if (fs_sis_path_parse(sis_fs, super_file->path, &dir, &hash) == 0 && 43 hash_path = t_strdup_printf("%s/"HASH_DIR_NAME"/%s", dir, hash);
|
/dovecot/src/lib-storage/index/cydir/ |
H A D | cydir-mail.c | 14 const char *dir; local 16 dir = mailbox_get_path(mail->box); 17 return t_strdup_printf("%s/%u.", dir, mail->uid);
|
H A D | cydir-save.c | 52 const char *dir; local 54 dir = mailbox_get_path(&ctx->mbox->box); 55 return t_strdup_printf("%s/%s.%u", dir, ctx->tmp_basename, num); 230 const char *dir; local 248 dir = mailbox_get_path(&ctx->mbox->box); 251 str_printfa(src_path, "%s/%s.", dir, ctx->tmp_basename); 255 str_append(dest_path, dir);
|
/dovecot/src/lib-storage/index/dbox-single/ |
H A D | sdbox-sync-rebuild.c | 98 DIR *dir; local 102 dir = opendir(path); 103 if (dir == NULL) { 116 if ((d = readdir(dir)) == NULL) 126 if (closedir(dir) < 0) {
|
H A D | sdbox-file.c | 152 const char *p, *old_path, *dir, *new_fname, *new_path; local 161 dir = t_strdup_until(old_path, p); 164 new_path = t_strdup_printf("%s/%s", dir, new_fname); 247 const char *p, *dir; local 256 dir = t_strdup_until(path, p); 257 if (mkdir_parents_chgrp(dir, perm->dir_create_mode, 262 "mkdir_parents(%s) failed: %m", dir);
|
/dovecot/src/lib-storage/ |
H A D | mailbox-uidvalidity.c | 114 const char *fname, *dir, *prefix, *tmp; local 123 dir = "."; 126 dir = t_strdup_until(path, fname); 130 d = opendir(dir); 136 (void)mailbox_list_mkdir_root(list, dir, MAILBOX_LIST_PATH_TYPE_CONTROL); 137 d = opendir(dir); 140 i_error("opendir(%s) failed: %m", dir); 161 i_error("closedir(%s) failed: %m", dir);
|
/dovecot/src/director/ |
H A D | director-host.h | 9 struct director *dir; member in struct:director_host 48 director_host_add(struct director *dir, const struct ip_addr *ip, 58 director_host_get(struct director *dir, const struct ip_addr *ip, 61 director_host_lookup(struct director *dir, const struct ip_addr *ip, 64 director_host_lookup_ip(struct director *dir, const struct ip_addr *ip); 79 void director_host_add_from_string(struct director *dir, const char *hosts);
|
H A D | notify-connection.c | 21 struct director *dir; member in struct:notify_connection 30 static void notify_update_user(struct director *dir, struct mail_tag *tag, argument 41 if (diff >= (int)dir->set->director_user_expire) { 46 director_update_user(dir, dir->self_host, user); 56 if (!director_get_username_hash(conn->dir, line, &hash)) 58 array_foreach(mail_hosts_get_tags(conn->dir->mail_hosts), tagp) 59 notify_update_user(conn->dir, *tagp, line, hash); 72 void notify_connection_init(struct director *dir, int fd, bool fifo) argument 79 conn->dir [all...] |
H A D | test-user-directory.c | 21 verify_user_directory(struct user_directory *dir, unsigned int user_count) argument 27 iter = user_directory_iter_init(dir, FALSE); 44 struct user_directory *dir; local 49 dir = user_directory_init(USER_DIR_TIMEOUT, NULL); 50 (void)user_directory_add(dir, 1, host, ioloop_time + count+1); 53 (void)user_directory_add(dir, i+2, host, ioloop_time + i); 54 verify_user_directory(dir, count+1); 55 user_directory_deinit(&dir); 62 struct user_directory *dir; local 67 dir 78 struct user_directory *dir; local [all...] |
H A D | director-host.c | 26 director_host_add(struct director *dir, argument 31 i_assert(director_host_lookup(dir, ip, port) == NULL); 34 host->dir = dir; 41 array_append(&dir->dir_hosts, &host, 1); 45 array_sort(&dir->dir_hosts, director_host_cmp_p); 75 hosts = array_get(&host->dir->dir_hosts, &count); 78 array_delete(&host->dir->dir_hosts, i, 1); 96 director_host_get(struct director *dir, const struct ip_addr *ip, argument 101 host = director_host_lookup(dir, i 108 director_host_lookup(struct director *dir, const struct ip_addr *ip, in_port_t port) argument 122 director_host_lookup_ip(struct director *dir, const struct ip_addr *ip) argument 154 director_host_add_string(struct director *dir, const char *host) argument 172 director_host_add_from_string(struct director *dir, const char *hosts) argument [all...] |
H A D | director-request.c | 33 struct director *dir; member in struct:director_request 61 if (request->dir->ring_last_sync_time == 0) 64 secs = ioloop_time - request->dir->ring_last_sync_time; 65 if (request->dir->ring_synced) 84 static void director_request_timeout(struct director *dir) argument 91 while (array_count(&dir->pending_requests) > 0) { 92 requestp = array_idx_modifiable(&dir->pending_requests, 0); 101 struct mail_tag *tag = mail_tag_find(dir->mail_hosts, tag_name); 115 i_assert(dir->requests_delayed_count > 0); 116 dir 129 director_request(struct director *dir, const char *username, const char *tag, director_request_callback *callback, void *context) argument 164 ring_noconn_warning(struct director *dir) argument 176 ring_log_delayed_warning(struct director *dir) argument 189 struct director *dir = request->dir; local 280 struct director *dir = request->dir; local [all...] |
/dovecot/src/plugins/quota/ |
H A D | quota-dirsize.c | 48 static int get_dir_usage(const char *dir, uint64_t *value, argument 58 dirp = opendir(dir); 63 *error_r = t_strdup_printf("opendir(%s) failed: %m", dir); 68 str_append(path, dir); 88 *error_r = t_strdup_printf("lstat(%s) failed: %m", dir);
|
/dovecot/src/lib-fts/ |
H A D | fts-filter-stopwords.c | 77 const char *dir = NULL; local 84 dir = value; 97 if (dir != NULL) 98 sp->stopwords_dir = p_strdup(pp, dir);
|
/dovecot/src/lib-storage/index/dbox-common/ |
H A D | dbox-file-fix.c | 450 const char *dir, *p, *temp_path, *broken_path; local 458 dir = t_strdup_until(file->cur_path, p); 460 temp_path = t_strdup_printf("%s/%s", dir, dbox_generate_tmp_filename());
|
H A D | dbox-storage.c | 107 const char *name, *args, *dir; local 124 dir = mail_user_home_expand(_storage->user, 126 storage->attachment_dir = p_strdup(_storage->pool, dir); 162 const char *dir, *path; local 168 &dir) <= 0) 170 path = t_strdup_printf("%s/"MAIL_INDEX_PREFIX".log", dir); 287 DIR *dir; local 291 dir = opendir(path); 292 if (dir == NULL) { 301 while ((d = readdir(dir)) ! [all...] |
/dovecot/src/lib-storage/index/dbox-multi/ |
H A D | mdbox-file.c | 306 const char *p, *dir; local 316 dir = t_strdup_until(path, p); 317 if (mailbox_list_mkdir_root(map->root_list, dir,
|
H A D | mdbox-storage.c | 41 const char *dir; local 54 dir = mailbox_list_get_root_forced(ns->list, MAILBOX_LIST_PATH_TYPE_DIR); 55 storage->storage_dir = p_strconcat(_storage->pool, dir, 117 i_debug("mdbox: couldn't find root dir");
|