summaryrefslogtreecommitdiffstats
path: root/login-utils/vipw.c
diff options
context:
space:
mode:
authorDave Reisner2012-06-02 19:31:30 +0200
committerSami Kerola2012-06-02 20:29:12 +0200
commit3c4fed097ddb65dbe3d88f60caee78fb60756f3e (patch)
treea7cd7247ca4fbda414846a93754e1e388fece136 /login-utils/vipw.c
parentdocs: fix all man page groff warnings (diff)
downloadkernel-qcow2-util-linux-3c4fed097ddb65dbe3d88f60caee78fb60756f3e.tar.gz
kernel-qcow2-util-linux-3c4fed097ddb65dbe3d88f60caee78fb60756f3e.tar.xz
kernel-qcow2-util-linux-3c4fed097ddb65dbe3d88f60caee78fb60756f3e.zip
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 'login-utils/vipw.c')
-rw-r--r--login-utils/vipw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/login-utils/vipw.c b/login-utils/vipw.c
index 66c682dc0..a5982813b 100644
--- a/login-utils/vipw.c
+++ b/login-utils/vipw.c
@@ -143,8 +143,9 @@ static FILE * pw_tmpfile(int lockfd)
{
FILE *fd;
char *tmpname = NULL;
+ char *dir = "/etc";
- if ((fd = xfmkstemp(&tmpname)) == NULL) {
+ if ((fd = xfmkstemp(&tmpname, dir)) == NULL) {
ulckpwdf();
err(EXIT_FAILURE, _("can't open temporary file"));
}