MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pw_make_v7

Function pw_make_v7

tools/libutil/pw_util.c:413–422  ·  view source on GitHub ↗

* Make a passwd line (in v7 format) out of a struct passwd */

Source from the content-addressed store, hash-verified

411 * Make a passwd line (in v7 format) out of a struct passwd
412 */
413char *
414pw_make_v7(const struct passwd *pw)
415{
416 char *line;
417
418 asprintf(&line, "%s:*:%ju:%ju:%s:%s:%s", pw->pw_name,
419 (uintmax_t)pw->pw_uid, (uintmax_t)pw->pw_gid,
420 pw->pw_gecos, pw->pw_dir, pw->pw_shell);
421 return (line);
422}
423
424/*
425 * Copy password file from one descriptor to another, replacing, deleting

Callers

nothing calls this directly

Calls 1

asprintfFunction · 0.85

Tested by

no test coverage detected