diff options
author | des <des@FreeBSD.org> | 2002-10-29 13:58:42 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-10-29 13:58:42 +0000 |
commit | e0746634a51c9f54d8d43ab114ba2e00cdadeeed (patch) | |
tree | c5558655f4c88e1b71388e24332ec34907edf3f0 /lib/libutil/pw_util.c | |
parent | 9737566e06f726ce6fed40cac0d346febfce1e50 (diff) | |
download | FreeBSD-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/pw_util.c')
-rw-r--r-- | lib/libutil/pw_util.c | 3 |
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); |