diff options
Diffstat (limited to 'login-utils/setpwnam.c')
-rw-r--r-- | login-utils/setpwnam.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/login-utils/setpwnam.c b/login-utils/setpwnam.c index 79f3299d4..9f39d0181 100644 --- a/login-utils/setpwnam.c +++ b/login-utils/setpwnam.c @@ -71,7 +71,7 @@ static void pw_init(void); * If the given username exists in the passwd file, the entry is * replaced with the given entry. */ -int setpwnam(struct passwd *pwd) +int setpwnam(struct passwd *pwd, const char *prefix) { FILE *fp = NULL, *pwf = NULL; int save_errno; @@ -81,11 +81,10 @@ int setpwnam(struct passwd *pwd) int contlen, rc; char *linebuf = NULL; char *tmpname = NULL; - char *atomic_dir = "/etc"; pw_init(); - if ((fp = xfmkstemp(&tmpname, atomic_dir)) == NULL) + if ((fp = xfmkstemp(&tmpname, "/etc", prefix)) == NULL) return -1; /* ptmp should be owned by root.root or root.wheel */ |