4 * nfs idmapping library, primarily for nfs4 client/server kernel idmapping
5 * and for userland nfs4 idmapping by acl libraries.
7 * Copyright (c) 2004 The Regents of the University of Michigan.
10 * J. Bruce Fields <bfields@umich.edu>
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of the University nor the names of its
22 * contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 #define NFS4_MAX_DOMAIN_LEN 512
42 } extra_mapping_types
;
44 typedef struct _extra_mapping_params
{
48 } extra_mapping_params
;
50 typedef void (*nfs4_idmap_log_function_t
)(const char *, ...);
52 int nfs4_init_name_mapping(char *conffile
);
53 int nfs4_get_default_domain(char *server
, char *domain
, size_t len
);
54 int nfs4_uid_to_name(uid_t uid
, char *domain
, char *name
, size_t len
);
55 int nfs4_gid_to_name(gid_t gid
, char *domain
, char *name
, size_t len
);
56 int nfs4_uid_to_owner(uid_t uid
, char *domain
, char *name
, size_t len
);
57 int nfs4_gid_to_group_owner(gid_t gid
, char *domain
, char *name
, size_t len
);
58 int nfs4_name_to_uid(char *name
, uid_t
*uid
);
59 int nfs4_name_to_gid(char *name
, gid_t
*gid
);
60 int nfs4_owner_to_uid(char *name
, uid_t
*uid
);
61 int nfs4_owner_to_gid(char *name
, gid_t
*gid
);
62 int nfs4_group_owner_to_gid(char *name
, gid_t
*gid
);
63 int nfs4_gss_princ_to_ids(char *secname
, char *princ
, uid_t
*uid
, gid_t
*gid
);
64 int nfs4_gss_princ_to_grouplist(char *secname
, char *princ
, gid_t
*groups
, int *ngroups
);
65 int nfs4_gss_princ_to_ids_ex(char *secname
, char *princ
, uid_t
*uid
, gid_t
*gid
, extra_mapping_params
**ex
);
66 int nfs4_gss_princ_to_grouplist_ex(char *secname
, char *princ
, gid_t
*groups
, int *ngroups
, extra_mapping_params
**ex
);
67 void nfs4_set_debug(int dbg_level
, nfs4_idmap_log_function_t dbg_logfunc
);