/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "safe-mkdir.h"
#include <unistd.h>
#include <fcntl.h>
{
} else {
/* created it */
}
}
/* use fchown() and fchmod() just to make sure we aren't following
symbolic links. */
if (fd == -1)
/* change the file owner first, since it's the only user one who
can mess up with the file mode. */
ret = changed_ret;
}
ret = changed_ret;
}
/* paranoia: make sure we succeeded in everything. */
i_fatal("safe_mkdir() failed: %s (%o) is still not mode %o",
}
i_fatal("safe_mkdir() failed: %s (%s, %s) "
"is still not owned by %s.%s",
}
return ret;
}