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 * Andy Adamson <andros@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.
38 char *get_default_domain(void);
39 struct conf_list
*get_local_realms(void);
41 typedef struct trans_func
* (*libnfsidmap_plugin_init_t
)(void);
46 int (*princ_to_ids
)(char *secname
, char *princ
, uid_t
*uid
, gid_t
*gid
,
47 extra_mapping_params
**ex
);
48 int (*name_to_uid
)(char *name
, uid_t
*uid
);
49 int (*name_to_gid
)(char *name
, gid_t
*gid
);
50 int (*uid_to_name
)(uid_t uid
, char *domain
, char *name
, size_t len
);
51 int (*gid_to_name
)(gid_t gid
, char *domain
, char *name
, size_t len
);
52 int (*gss_princ_to_grouplist
)(char *secname
, char *princ
, gid_t
*groups
,
53 int *ngroups
, extra_mapping_params
**ex
);
56 struct mapping_plugin
{
58 struct trans_func
*trans
;
66 extern int idmap_verbosity
;
67 extern nfs4_idmap_log_function_t idmap_log_func
;
68 /* Level zero always prints, others print depending on verbosity level */
69 #define IDMAP_LOG(LVL, MSG) \
70 do { if (LVL <= idmap_verbosity) (*idmap_log_func)MSG; } while (0)