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

Function pw_make

tools/libutil/pw_util.c:398–408  ·  view source on GitHub ↗

* Make a passwd line out of a struct passwd. */

Source from the content-addressed store, hash-verified

396 * Make a passwd line out of a struct passwd.
397 */
398char *
399pw_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

Callers 1

pw_copyFunction · 0.85

Calls 1

asprintfFunction · 0.85

Tested by

no test coverage detected