HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)
n
nis_groups(3N) nis_groups(3N)
Async-signal Safe: No
These functions can be called safely in a multithreaded environment. These functions may be thread can-
cellation points because they invoke functions that are thread cancellation points.
In a multithreaded environment, these functions are not safe to be called by a child process after
fork()
and before exec(). These functions should not be called by a multithreaded application that support
asynchronous cancellation or asynchronous signals.
EXAMPLES
Simple Memberships
Given a group
sadsouls.oz. with members tinman.oz.,
lion.oz., and scarecrow.oz.
, the
function call
bool_var = nis_ismember("lion.oz.", "sadsouls.oz.");
will return 1 (TRUE) and the function call
bool_var = nis_ismember("toto.oz.", "sadsouls.oz.");
will return 0 (FALSE).
Implicit Memberships
Given a group
baddies.oz., with members wickedwitch.west.oz.
and
*.monkeys.west.oz.
, the function call
bool_var = nis_ismember("hulk.monkeys.west.oz.", "baddies.oz.");
will return 1 (TRUE) because any principal from the monkeys.west.oz.
domain belongs to the impli-
cit group
*.monkeys.west.oz.
, but the function call
bool_var = nis_ismember("hulk.big.monkeys.west.oz.", "baddies.oz.");
will return 0 (FALSE).
Recursive Memberships
Given a group
goodandbad.oz.
, with members toto.kansas, @sadsouls.oz., and
@baddies.oz., and the groups sadsouls.oz. and baddies.oz. defined above, the function call
bool_var = nis_ismember("wickedwitch.west.oz.", "goodandbad.oz.");
will return 1 (TRUE), because wickedwitch.west.oz.
is a member of the baddies.oz. group
which is recursively included in the
goodandbad.oz.
group.
WARNINGS
HP-UX 11i Version 2 is the last HP-UX release on which NIS+ is supported.
LDAP is the recommended replacement for NIS+. HP fully supports the industry standard naming ser-
vices based on LDAP.
NOTES
These functions only accept fully-qualified NIS+ names.
A group is represented by a NIS+ object (see nis_objects (3N)) with a variant part that is defined in the
group_obj structure. It contains the following fields:
u_long gr_flags; /* Interpretation Flags
(currently unused) */
struct {
u_int gr_members_len;
nis_name *gr_members_val;
} gr_members; /* Array of members */
NIS+ servers and clients maintain a local cache of expanded groups to enhance their performance when
checking for group membership. Should the membership of a group change, servers and clients with that
group cached will not see the change until either the group cache has expired or it is explicitly flushed. A
server’s cache may be flushed programmatically by calling the
nis_servstate() function with tag
TAG_GCACHE and a value of 1.
There are currently no known methods for
nis_ismember(), nis_print_group_entry(), and
nis_verifygroup() to get their answers from only the master server.
HP-UX 11i Version 2: August 2003 − 2 − Hewlett-Packard Company Section 3−−645