From 1b5065c251cfbf3b8a8f40c23b0a71b8365092a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 29 Oct 2002 13:58:42 +0000 Subject: [PATCH] Don't forget to '\n'-terminate new entries. This unbreaks chpass -a. Submitted by: joerg --- libutil/pw_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.47.1