/* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "eacces-error.h"
#include "mkdir-parents.h"
#include "ipwd.h"
#include <fcntl.h>
#include <unistd.h>
static int ATTR_NULL(5)
{
unsigned int i;
for (i = 0;; i++) {
if (ret < 0)
break;
if (fd != -1)
break;
return -1;
}
/* it was just rmdir()ed by someone else? retry */
}
if (ret < 0) {
contains '/' at the end and it exists.
ENOSYS check is for NFS mount points. */
}
return -1;
}
i_close_fd(&fd);
orig_errno = errno;
errno = orig_errno;
gid_origin));
return -1;
}
}
}
errno = orig_errno;
return -1;
}
/* make sure the directory doesn't have setgid bit enabled
(in case its parent had) */
orig_errno = errno;
errno = orig_errno;
i_close_fd(&fd);
return -1;
}
}
i_close_fd(&fd);
return 0;
}
{
}
{
}
static int ATTR_NULL(5)
const char *gid_origin)
{
const char *p;
int ret;
return -1;
/* doesn't exist, try recursively creating our parent dir */
return -1; /* shouldn't happen */
T_BEGIN {
gid, gid_origin);
} T_END;
return -1;
/* should work now */
return -1;
}
return 0;
}
{
}
{
}
{
}
{
const char *p;
*root_dir_r = path;
return -1;
}
if (p == NULL)
path = "/";
else
}
*root_dir_r = path;
return 0;
}