* Make a passwd line out of a struct passwd. */
| 396 | * Make a passwd line out of a struct passwd. |
| 397 | */ |
| 398 | char * |
| 399 | pw_make(const struct passwd *pw) |
| 400 | { |
| 401 | char *line; |
| 402 | |
| 403 | asprintf(&line, "%s:%s:%ju:%ju:%s:%ju:%ju:%s:%s:%s", pw->pw_name, |
| 404 | pw->pw_passwd, (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid, |
| 405 | pw->pw_class, (uintmax_t)pw->pw_change, (uintmax_t)pw->pw_expire, |
| 406 | pw->pw_gecos, pw->pw_dir, pw->pw_shell); |
| 407 | return (line); |
| 408 | } |
| 409 | |
| 410 | /* |
| 411 | * Make a passwd line (in v7 format) out of a struct passwd |