HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)

n
nis_local_names(3N) nis_local_names(3N)
NAME
nis_local_names, nis_local_directory, nis_local_host, nis_local_group, nis_local_principal - NIS+ local
names
SYNOPSIS
cc [ flag ... ] file...
-lnsl [ library. . . ]
#include <rpcsvc/nis.h>
nis_name nis_local_directory(void);
nis_name nis_local_host(void);
nis_name nis_local_group(void);
nis_name nis_local_principal(void);
DESCRIPTION
These functions return several default NIS+ names associated with the current process.
nis_local_directory()
returns the name of the NIS+ domain for this machine. This is currently
the same as the Secure RPC domain returned by the
sysinfo() system call.
nis_local_host() returns the NIS+ name of the current machine. This is the fully qualified name
for the host and is either the value returned by the gethostname (2) function or, if the host name is only
partially qualified, the concatenation of that value and the name of the NIS+ directory. Note that if a
machine’s name and address cannot be found in the local NIS+ directory, its hostname must be fully
qualified.
nis_local_group()
returns the name of the current NIS+ group name. This is currently set by set-
ting the environment variable
NIS_GROUP to the groupname.
nis_local_principal()
returns the NIS+ principal name for the user associated with the effective
UID of the calling process. This function maps the effective uid into a principal name by looking for a
LOCAL type credential (see nisaddcred (1M)) in the table named cred.org_dir in the default domain.
Note: The result returned by these routines is a pointer to a data structure with the NIS+ library, and
should be considered a read-only result and should not be modified.
MULTITHREAD USAGE
Thread Safe: Yes
Cancel Safe: Yes
Fork Safe: No
Async-cancel Safe: No
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.
ENVIRONMENT
NIS_GROUP This variable contains the name of the local NIS+ group. If the name is not fully
qualified, the value returned by nis_local_directory() will be concatenated to it.
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.
SEE ALSO
nisdefaults(1), nisaddcred(1M), gethostname(2), nis_names(3N), nis_objects(3N).
HP-UX 11i Version 2: August 2003 1 Hewlett-Packard Company Section 3647