summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libutil/pw_util.c3
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);