userspec: support optional parameters to parse_user_spec()
authorPádraig Brady <P@draigBrady.com>
Fri, 20 Sep 2013 02:51:27 +0000 (03:51 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 21 Sep 2013 15:30:58 +0000 (16:30 +0100)
commit798e9bc8b86c1032105682771539bae4ea1e9128
treef327ec097f3a9a95758d0fdfd6ee852a80df7d6e
parentcf0e1bcdc666748ef2bcb38f806cac432936090d
userspec: support optional parameters to parse_user_spec()

* lib/userspec.c (parse_user_spec): If the GID param is NULL,
then avoid group processing and treat the full spec as a user.
(parse_with_separator): Allow the USERNAME and GROUPNAME to
be optional params (NULL), in which case they're ignored.
* tests/test-userspec.c (main): Ensure NULL params are ignored.
ChangeLog
lib/userspec.c
tests/test-userspec.c