mkdir-parents.c revision a3e3650e98d326e8cc89e2a58061714af3214953
/* Copyright (c) 2003-2012 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 <unistd.h>
static int ATTR_NULL(5)
{
int ret, orig_errno;
if (ret < 0) {
contains '/' at the end and it exists.
ENOSYS check is for NFS mount points. */
}
return -1;
}
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;
return -1;
}
}
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;
if (ret < 0)
return -1;
/* should work now */
return -1;
}
return 0;
}
{
}
{
}
{
}