summaryrefslogtreecommitdiff
path: root/include/fileutils.h
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-06-02 19:31:30 +0200
committerSami Kerola <kerolasa@iki.fi>2012-06-02 20:29:12 +0200
commit3c4fed097ddb65dbe3d88f60caee78fb60756f3e (patch)
treea7cd7247ca4fbda414846a93754e1e388fece136 /include/fileutils.h
parent79f8481889536822c4bd08f405ddfdc44d0d3cda (diff)
downloadutil-linux-3c4fed097ddb65dbe3d88f60caee78fb60756f3e.tar.gz
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 <dreisner@archlinux.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'include/fileutils.h')
-rw-r--r--include/fileutils.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/fileutils.h b/include/fileutils.h
index 33aba0a0..cf29e1b8 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;
}