From e0746634a51c9f54d8d43ab114ba2e00cdadeeed Mon Sep 17 00:00:00 2001 From: des Date: Tue, 29 Oct 2002 13:58:42 +0000 Subject: Don't forget to '\n'-terminate new entries. This unbreaks chpass -a. Submitted by: joerg --- lib/libutil/pw_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libutil') 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); -- cgit v1.1