Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nfs4_uid_to_name(3) [suse man page]

nfs4_uid_to_name(3)					     Library Functions Manual					       nfs4_uid_to_name(3)

NAME
nfs4_uid_to_name, nfs4_gid_to_name, nfs4_name_to_uid, nfs4_name_to_gid, nfs4_init_name_mapping, nfs4_get_default_domain, nfs4_gss_princ_to_ids, nfs4_gss_princ_to_grouplist, nfs4_gss_princ_to_ids_ex, nfs4_gss_princ_to_grouplist_ex, nfs4_set_debug: idmapping for nfsv4 SYNOPSIS
#include <nfs4_idmap.h> int nfs4_init_name_mapping(char *conffile); int nfs4_get_default_domain(char *server, char *domain, size_t len); int nfs4_uid_to_name(uid_t uid, char *domain, char *name, size_t len); int nfs4_gid_to_name(gid_t gid, char *domain, char *name, size_t len); int nfs4_name_to_uid(char *name, uid_t *uid); int nfs4_name_to_gid(char *name, gid_t *gid); int nfs4_gss_princ_to_ids(char *secname, char *princ, uid_t *uid, gid_t *gid); int nfs4_gss_princ_to_grouplist(char *secname, char *princ, gid_t *groups, int *ngroups); int nfs4_gss_princ_to_ids_ex(char *secname, char *princ, uid_t *uid, gid_t *gid, extra_mapping_params **ex); int nfs4_gss_princ_to_grouplist_ex(char *secname, char *princ, gid_t *groups, int *ngroups, extra_mapping_params **ex); void nfs4_set_debug(int dbg_level, void (*logger)(const char *, ...)); DESCRIPTION
NFSv4 uses names of the form user@domain. To write code that helps the kernel map uid's (as rpc.idmapd does) or that processes NFSv4 ACLs, you need to be able to convert between NFSv4 names and local uids and gids. The nfs4_uid_to_name() and nfs4_gid_to_name() functions, given uid or gid and domain (as a null-terminated string), write the corresponding nfsv4 name into the buffer provided in name, which must be of length at least len. The nfs4_name_to_uid() and nfs4_name_to_gid() functions, given name (as a null-terminated string), return the corresponding uid or gid in the second parameter. The nfs4_init_name_mapping() function must be called before using any of these functions. It reads defaults from the configuration file at the provided path, usually "etc/idmapd.conf". The domain argument to the id-to-name functions is there to provide a hint to the name mapper in the case where an id might be mapped to names in multiple domains. In most cases, this argument should just be the name returned in the domain argument to nfs4_get_default_domain() which should be called with server set to NULL. The domain should be a buffer of length len. The constant NFS4_MAX_DOMAIN_LEN may be used to determine a reasonable value for that length. The function nfs4_get_grouplist(), given a name, fills the provided array groups with up to *ngroups group IDs corresponding to which the user name belongs to, setting *ngroups to the actual number of such groups. If the user belongs to more than *ngroups groups, then an error is returned and the actual number of groups is stored in *ngroups. Functions nfs4_gss_princ_to_ids(), nfs4_gss_princ_to_grouplist(), nfs4_gss_princ_to_ids_ex(), and nfs4_gss_princ_to_grouplist_ex() are used to convert from a gss principal name (as returned by gss_display_name()) to a uid and gid, or list of gids. Finally, nfs4_set_debug() allows the application to set a debugging level to produce extra debugging information from within the library. The optional logger function specifies an alternative logging function to call for the debug messages rather than the default internal function within the library. RETURN VALUE
All functions return 0 or, in the case of error, -ERRNO. 2004-08-05 nfs4_uid_to_name(3)

Check Out this Related Man Page

ddi_cred(9F)						   Kernel Functions for Drivers 					      ddi_cred(9F)

NAME
ddi_cred, crgetuid, crgetruid, crgetsuid, crgetgid, crgetrgid, crgetsgid, crgetzoneid, crgetgroups, crgetngroups - access and change parts of the cred_t structure SYNOPSIS
#include <sys/cred.h> uid_t crgetuid(const cred_t *cr); uid_t crgetruid(const cred_t *cr); uid_t crgetsuid(const cred_t *cr); gid_t crgetgid(const cred_t *cr); gid_t crgetrgid(const cred_t *cr); gid_t crgetsgid(const cred_t *cr); zoneid_t crgetzoneid(const cred_t *cr); const gid_t *crgetgroups(const cred_t *cr); int crgetngroups(const cred_t *cr); int crsetresuid(cred_t *cr, uid_t ruid, uid_t euid, uid_t suid); int crsetresgid(cred_t *cr, gid_t rgid, gid_t egid, gid_t sgid); int crsetugid(cred_t *cr, uid_t uid, gid_t gid); int crsetgroups(cred_t *cr, int ngroups, gid_t gids); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
cr pointer to the user credential structure uid, ruid, euid, suid new user id, real, effective and saved user id gid, rgid, egid, sgid new group id, real, effective and saved group id ngroups number of groups in the group array gids pointer to array of new groups DESCRIPTION
The user credential is a shared, read-only, ref-counted data structure. Its actual size and layout are subject to change. The functions described in this page allow the programmer to retrieve fields from the structure and to initialize newly allocated credential structures. crgetuid(), crgetruid(), and crgetsuid() return, respectively, the effective, real, and saved user id from the user credential pointed to by cr. crgetgid(), crgetrgid(), and crgetsgid() return, respectively, the effective, real, and saved group id from the user credential pointed to by cr. crgetzoneid() returns the zone id from the user credential pointed to by cr. crgetgroups() returns the group list of the user credential pointed to by cr. crgetngroups() returns the number of groups in the user credential pointed to by cr. crsetresuid() sets the real, effective and saved user id. All but one can be specified as -1, which causes the original value not to change. crsetresgid() sets the real, effective and saved group id. All but one can be specified as -1, which causes the original value not to change. crsetugid() initializes the real, effective and saved user id all to uid. It initializes the real, effective, and saved group id all to gid. crsetgroups() sets the number of groups in the user credential to ngroups and copies the groups from gids to the user credential. If ngroups is 0, gids need not point to valid storage. It is an error to call this any of the crset*() functions on a user credential structure that was newly allocated. RETURN VALUES
The crget*() functions return the requested information. The crset*id() functions return 0 on success and -1 if any of the specified ids are invalid. The functions might cause a system panic if called on a user credential structure that is referenced by other parts of the system. CONTEXT
These functions can be called from user and kernel contexts. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |All | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), privileges(5), drv_priv(9F) Writing Device Drivers SunOS 5.10 6 Aug 2003 ddi_cred(9F)
Man Page