struct posix_fs {
struct fs fs;
char *temp_file_prefix, *root_path, *path_prefix;
+ unsigned int temp_file_prefix_len;
enum fs_posix_lock_method lock_method;
mode_t mode, dir_mode;
};
fs->temp_file_prefix = set->temp_file_prefix != NULL ?
i_strdup(set->temp_file_prefix) : i_strdup("temp.dovecot.");
+ fs->temp_file_prefix_len = strlen(fs->temp_file_prefix);
fs->root_path = i_strdup(set->root_path);
fs->fs.set.temp_file_prefix = fs->temp_file_prefix;
fs->fs.set.root_path = fs->root_path;
static const char *fs_posix_iter_next(struct fs_iter *_iter)
{
struct posix_fs_iter *iter = (struct posix_fs_iter *)_iter;
+ struct posix_fs *fs = (struct posix_fs *)_iter->fs;
struct dirent *d;
if (iter->dir == NULL)
if (strcmp(d->d_name, ".") == 0 ||
strcmp(d->d_name, "..") == 0)
continue;
+ if (strncmp(d->d_name, fs->temp_file_prefix,
+ fs->temp_file_prefix_len) == 0)
+ continue;
#ifdef HAVE_DIRENT_D_TYPE
switch (d->d_type) {
case DT_UNKNOWN: