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

Function pw_equal

tools/libutil/pw_util.c:381–393  ·  view source on GitHub ↗

* Compares two struct pwds. */

Source from the content-addressed store, hash-verified

379 * Compares two struct pwds.
380 */
381int
382pw_equal(const struct passwd *pw1, const struct passwd *pw2)
383{
384 return (strcmp(pw1->pw_name, pw2->pw_name) == 0 &&
385 pw1->pw_uid == pw2->pw_uid &&
386 pw1->pw_gid == pw2->pw_gid &&
387 strcmp(pw1->pw_class, pw2->pw_class) == 0 &&
388 pw1->pw_change == pw2->pw_change &&
389 pw1->pw_expire == pw2->pw_expire &&
390 strcmp(pw1->pw_gecos, pw2->pw_gecos) == 0 &&
391 strcmp(pw1->pw_dir, pw2->pw_dir) == 0 &&
392 strcmp(pw1->pw_shell, pw2->pw_shell) == 0);
393}
394
395/*
396 * Make a passwd line out of a struct passwd.

Callers 1

pw_copyFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected