summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-10-29 13:58:42 +0000
committerdes <des@FreeBSD.org>2002-10-29 13:58:42 +0000
commite0746634a51c9f54d8d43ab114ba2e00cdadeeed (patch)
treec5558655f4c88e1b71388e24332ec34907edf3f0 /lib/libutil
parent9737566e06f726ce6fed40cac0d346febfce1e50 (diff)
downloadFreeBSD-src-e0746634a51c9f54d8d43ab114ba2e00cdadeeed.zip
FreeBSD-src-e0746634a51c9f54d8d43ab114ba2e00cdadeeed.tar.gz
Don't forget to '\n'-terminate new entries. This unbreaks chpass -a.
Submitted by: joerg
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/pw_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index 444140d..d219917 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -496,7 +496,8 @@ pw_copy(int ffd, int tfd, struct passwd *pw, struct passwd *old_pw)
/* if we got here, we have a new entry */
len = strlen(line);
- if (write(tfd, line, len) != len)
+ if (write(tfd, line, len) != len ||
+ write(tfd, "\n", 1) != 1)
goto err;
done:
free(line);
OpenPOWER on IntegriCloud