safe-mkstemp.c revision 4ded3d18fa391ae5908f9834f1390cf55e8c99d5
bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2007-2009 Dovecot authors, see the included COPYING file */
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainenint safe_mkstemp(string_t *prefix, mode_t mode, uid_t uid, gid_t gid)
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainen i_error("stat(%s) failed: %m", str_c(prefix));
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainen fd = open(str_c(prefix), O_RDWR | O_EXCL | O_CREAT, 0666);
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainen i_error("open(%s) failed: %m", str_c(prefix));
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainenint safe_mkstemp_hostpid(string_t *prefix, mode_t mode, uid_t uid, gid_t gid)