diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2002-10-29 13:58:42 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2002-10-29 13:58:42 +0000 |
commit | 1b5065c251cfbf3b8a8f40c23b0a71b8365092a4 (patch) | |
tree | fd58ee21735fbc23c24166e4d8e8b432355d55f0 /libutil | |
parent | 313997542e1665f21555249c1cf80f7960c5f946 (diff) | |
download | pw-darwin-1b5065c251cfbf3b8a8f40c23b0a71b8365092a4.tar.gz pw-darwin-1b5065c251cfbf3b8a8f40c23b0a71b8365092a4.tar.zst pw-darwin-1b5065c251cfbf3b8a8f40c23b0a71b8365092a4.zip |
Don't forget to '\n'-terminate new entries. This unbreaks chpass -a.
Submitted by: joerg
Diffstat (limited to 'libutil')
-rw-r--r-- | libutil/pw_util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libutil/pw_util.c b/libutil/pw_util.c index 444140d..d219917 100644 --- a/libutil/pw_util.c +++ b/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); |