1 .TH nfs4_uid_to_name 3 2004-08-05
3 nfs4_uid_to_name, nfs4_gid_to_name, nfs4_name_to_uid, nfs4_name_to_gid,
4 nfs4_init_name_mapping, nfs4_get_default_domain,
5 nfs4_gss_princ_to_ids, nfs4_gss_princ_to_grouplist,
6 nfs4_gss_princ_to_ids_ex,
7 nfs4_gss_princ_to_grouplist_ex,
8 nfs4_set_debug \- ID mapping routines used for NFSv4
10 .B #include <nfs4_idmap.h>
12 .BI "int nfs4_init_name_mapping(char *conffile);"
14 .BI "int nfs4_get_default_domain(char *server, char *domain, size_t len);"
16 .BI "int nfs4_uid_to_name(uid_t uid, char *domain, char *name, size_t len);"
18 .BI "int nfs4_uid_to_owner(uid_t uid, char *domain, char *name, size_t len);"
20 .BI "int nfs4_gid_to_name(gid_t gid, char *domain, char *name, size_t len);"
22 .BI "int nfs4_gid_to_owner(gid_t gid, char *domain, char *name, size_t len);"
24 .BI "int nfs4_name_to_uid(char *name, uid_t *uid);"
26 .BI "int nfs4_name_to_gid(char *name, gid_t *gid);"
28 .BI "int nfs4_owner_to_uid(char *name, uid_t *uid);"
30 .BI "int nfs4_owner_to_gid(char *name, gid_t *gid);"
32 .BI "int nfs4_gss_princ_to_ids(char *secname, char *princ, uid_t *uid, gid_t *gid);"
34 .BI "int nfs4_gss_princ_to_grouplist(char *secname, char *princ, gid_t *groups, int *ngroups);"
36 .BI "int nfs4_gss_princ_to_ids_ex(char *secname, char *princ, uid_t *uid, gid_t *gid, extra_mapping_params **ex);"
38 .BI "int nfs4_gss_princ_to_grouplist_ex(char *secname, char *princ, gid_t *groups, int *ngroups, extra_mapping_params **ex);"
40 .BI "void nfs4_set_debug(int dbg_level, void (*logger)(const char *, ...));"
44 NFSv4 uses names of the form
46 To write code that helps the kernel map uid's (as
48 does) or that processes NFSv4 ACLs, you need to be able to convert between
49 NFSv4 names and local uids and gids.
61 (as a null-terminated string),
62 write the corresponding nfsv4 name into the buffer provided in
64 which must be of length at least
68 .B nfs4_uid_to_owner()
70 .B nfs4_gid_to_group_owner()
77 (as a null-terminated string),
78 write the corresponding nfsv4 name into the buffer provided in
80 which must be of length at least
82 If there is no valid mapping from
88 then the numerical string representing uid or gid is returned instead.
96 (as a null-terminated string), return the corresponding uid or gid in
100 .B nfs4_owner_to_uid()
102 .B nfs4_group_owner_to_gid()
105 (as a null-terminated string), return the corresponding uid or gid in
106 the second parameter.
107 If there is no valid mapping from
113 the value for the user or group "nobody" will be returned instead.
116 .B nfs4_init_name_mapping()
117 function must be called before using any of these functions. It reads
118 defaults from the configuration file at the provided path, usually
123 argument to the id-to-name functions is there to provide a hint to the name
124 mapper in the case where an id might be mapped to names in multiple domains.
125 In most cases, this argument should just be the name returned in the
128 .B nfs4_get_default_domain()
129 which should be called with
133 should be a buffer of length
135 The constant NFS4_MAX_DOMAIN_LEN may be used to determine a reasonable
136 value for that length.
139 .BR nfs4_get_grouplist() ,
142 fills the provided array
146 group IDs corresponding to which the user
150 to the actual number of such groups. If the user belongs to more than
152 groups, then an error is returned and the actual number of groups is stored in
156 .BR nfs4_gss_princ_to_ids() ,
157 .BR nfs4_gss_princ_to_grouplist() ,
158 .BR nfs4_gss_princ_to_ids_ex() ,
160 .B nfs4_gss_princ_to_grouplist_ex()
161 are used to convert from a gss principal name (as returned by
162 .BR gss_display_name() )
163 to a uid and gid, or list of gids.
167 allows the application to set a debugging level to produce extra
168 debugging information from within the library. The optional
170 function specifies an alternative logging function to call for
171 the debug messages rather than the default internal function
174 All functions return 0 or, in the case of error, -ERRNO.