Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nis_local_host(3N) — SunOS 5.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

nisdefaults(1)

nisaddcred(1M)

sysinfo(2)

gethostname(3B)

nis_names(3N)

nis_objects(3N)

nis_local_names(3N)

NAME

nis_local_names, nis_local_directory, nis_local_host, nis_local_group, nis_local_principal, nis_getnames, nis_freenames − NIS+ local names

SYNOPSIS

#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);

nis_name ∗nis_getnames(const nis_name name);

void nis_freenames(nis_name ∗namelist);

MT-LEVEL

Unsafe

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(2) 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(3B) 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 setting the environment variable NIS_GROUP to the groupname. 

nis_getnames() will return a list of candidate names for the name passed in as name.  If this name is not fully qualified, nis_getnames() will generate a list of names using the default NIS+ directory search path, or the environment variable NIS_PATH if it is set.  The returned array of pointers is terminated by a NULL pointer, and the memory associated with this array should be freed by calling nis_freenames().

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 (except nis_getnames()) is a pointer to a data structure with the NIS+ library, and should be considered a “read-only” result and should not be modified. 

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. 

NIS_PATH This variable overrides the default NIS+ directory search path used by nis_getnames(). It contains an ordered list of directories separated by ’:’ (colon) characters. The ’$’ (dollar sign) character is treated specially. Directory names that end in ’$’ have the default domain appended to them, and a ’$’ by itself is replaced by the list of directories between the default domain and the global root that are at least two levels deep. The default NIS+ directory search path is ’$’. 

SEE ALSO

nisdefaults(1), nisaddcred(1M), sysinfo(2), gethostname(3B), nis_names(3N), nis_objects(3N)

NOTES

These interfaces are unsafe in multithreaded applications.  Unsafe interfaces should be called only from the main thread. 

SunOS 5.2  —  Last change: 22 Jan 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026