From 3c4fed097ddb65dbe3d88f60caee78fb60756f3e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 2 Jun 2012 19:31:30 +0200 Subject: fileutils: xmkstemp() interface change We can not let the user control where TMPDIR is for this tempfile. This will be where we write the updated passwd file, and must be capable of being moved atomically with rename(2). Therefore, it cannot be on a different device, or setpwnam() and vipw/vigr programs will invariably fail with EXDEV. Signed-off-by: Dave Reisner Signed-off-by: Sami Kerola --- include/fileutils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/fileutils.h') diff --git a/include/fileutils.h b/include/fileutils.h index 33aba0a0d..cf29e1b83 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -1,13 +1,13 @@ #ifndef UTIL_LINUX_FILEUTILS #define UTIL_LINUX_FILEUTILS -extern int xmkstemp(char **tmpname); +extern int xmkstemp(char **tmpname, char *dir); -static inline FILE *xfmkstemp(char **tmpname) +static inline FILE *xfmkstemp(char **tmpname, char *dir) { int fd; FILE *ret; - fd = xmkstemp(tmpname); + fd = xmkstemp(tmpname, dir); if (fd == -1) { return NULL; } -- cgit v1.2.3-55-g7522