]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - libutil/pw_util.c
Don't forget to '\n'-terminate new entries. This unbreaks chpass -a.
[pw-darwin.git] / libutil / pw_util.c
index 444140dd613b6522e2b007ce1574c79077df48aa..d2199176c15d954c2f99b3a4b9faf8aa4731b0d9 100644 (file)
@@ -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);