Date: Wed, 12 Mar 2008 22:38:58 -0500 (CDT) From: "Sean C. Farley" <scf@FreeBSD.org> To: arch@FreeBSD.org Subject: [RFC] struct grp related additions to libutil Message-ID: <alpine.BSF.1.00.0803122219250.75171@thor.farley.org>
index | next in thread | raw e-mail
I have written four functions related to struct grp processing that I
would like to add to libutil. They are modeled in part after similar
calls in libutil/pw_util.c. The calls are:
1. int gr_equal(const struct group *gr1, const struct group *gr2)
Compares the values of two group structures. It does a thorough, yet
unoptimized comparison of all the members regardless of order.
2. char *gr_make(const struct group *gr)
Creates a string (as would exist within /etc/group) from a group
structure.
3. struct group *gr_dup(const struct group *gr)
Duplicate a group structure. Returned valued is a contiguous block
of memory.
4. struct group *gr_scan(const char *line)
Creates a group structure from a string (as produced by gr_make()).
Questions:
1. What requirements are there for making additions/changes to libutil?
2. Will there be any issues with having gr_equal() return a bool?
Currently, it is returning an int.
I made patches with regression tests for both HEAD[1] and RELENG_7[2].
Sean
1. http://www.farley.org/freebsd/tmp/gr_util/libutil-grp-HEAD.patch
2. http://www.farley.org/freebsd/tmp/gr_util/libutil-grp-RELENG_7.patch
--
scf@FreeBSD.org
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.1.00.0803122219250.75171>
