xref: /illumos-gate/usr/src/uts/common/sys/idmap.h (revision 9fb67ea3)
1c5c4113dSnw141292 /*
2c5c4113dSnw141292  * CDDL HEADER START
3c5c4113dSnw141292  *
4c5c4113dSnw141292  * The contents of this file are subject to the terms of the
5c5c4113dSnw141292  * Common Development and Distribution License (the "License").
6c5c4113dSnw141292  * You may not use this file except in compliance with the License.
7c5c4113dSnw141292  *
8c5c4113dSnw141292  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c5c4113dSnw141292  * or http://www.opensolaris.org/os/licensing.
10c5c4113dSnw141292  * See the License for the specific language governing permissions
11c5c4113dSnw141292  * and limitations under the License.
12c5c4113dSnw141292  *
13c5c4113dSnw141292  * When distributing Covered Code, include this CDDL HEADER in each
14c5c4113dSnw141292  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c5c4113dSnw141292  * If applicable, add the following below this CDDL HEADER, with the
16c5c4113dSnw141292  * fields enclosed by brackets "[]" replaced with your own identifying
17c5c4113dSnw141292  * information: Portions Copyright [yyyy] [name of copyright owner]
18c5c4113dSnw141292  *
19c5c4113dSnw141292  * CDDL HEADER END
20c5c4113dSnw141292  */
21c5c4113dSnw141292 /*
22*9fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23c5c4113dSnw141292  * Use is subject to license terms.
24c5c4113dSnw141292  */
25c5c4113dSnw141292 
26c5c4113dSnw141292 #ifndef _SYS_IDMAP_H
27c5c4113dSnw141292 #define	_SYS_IDMAP_H
28c5c4113dSnw141292 
29c5c4113dSnw141292 
30c5c4113dSnw141292 /* Idmap status codes */
31c5c4113dSnw141292 #define	IDMAP_SUCCESS			0
32c5c4113dSnw141292 #define	IDMAP_NEXT			1
33c5c4113dSnw141292 #define	IDMAP_ERR_OTHER			-10000
34c5c4113dSnw141292 #define	IDMAP_ERR_INTERNAL		-9999
35c5c4113dSnw141292 #define	IDMAP_ERR_MEMORY		-9998
36c5c4113dSnw141292 #define	IDMAP_ERR_NORESULT		-9997
37c5c4113dSnw141292 #define	IDMAP_ERR_NOTUSER		-9996
38c5c4113dSnw141292 #define	IDMAP_ERR_NOTGROUP		-9995
39c5c4113dSnw141292 #define	IDMAP_ERR_NOTSUPPORTED		-9994
40c5c4113dSnw141292 #define	IDMAP_ERR_W2U_NAMERULE		-9993
41c5c4113dSnw141292 #define	IDMAP_ERR_U2W_NAMERULE		-9992
42c5c4113dSnw141292 #define	IDMAP_ERR_CACHE			-9991
43c5c4113dSnw141292 #define	IDMAP_ERR_DB			-9990
44c5c4113dSnw141292 #define	IDMAP_ERR_ARG			-9989
45c5c4113dSnw141292 #define	IDMAP_ERR_SID			-9988
46c5c4113dSnw141292 #define	IDMAP_ERR_IDTYPE		-9987
47c5c4113dSnw141292 #define	IDMAP_ERR_RPC_HANDLE		-9986
48c5c4113dSnw141292 #define	IDMAP_ERR_RPC			-9985
49c5c4113dSnw141292 #define	IDMAP_ERR_CLIENT_HANDLE		-9984
50c5c4113dSnw141292 #define	IDMAP_ERR_BUSY			-9983
51c5c4113dSnw141292 #define	IDMAP_ERR_PERMISSION_DENIED	-9982
52c5c4113dSnw141292 #define	IDMAP_ERR_NOMAPPING		-9981
53c5c4113dSnw141292 #define	IDMAP_ERR_NEW_ID_ALLOC_REQD	-9980
54c5c4113dSnw141292 #define	IDMAP_ERR_DOMAIN		-9979
55c5c4113dSnw141292 #define	IDMAP_ERR_SECURITY		-9978
56c5c4113dSnw141292 #define	IDMAP_ERR_NOTFOUND		-9977
57c5c4113dSnw141292 #define	IDMAP_ERR_DOMAIN_NOTFOUND	-9976
58c5c4113dSnw141292 #define	IDMAP_ERR_UPDATE_NOTALLOWED	-9975
59c5c4113dSnw141292 #define	IDMAP_ERR_CFG			-9974
60c5c4113dSnw141292 #define	IDMAP_ERR_CFG_CHANGE		-9973
61c5c4113dSnw141292 #define	IDMAP_ERR_NOTMAPPED_WELLKNOWN	-9972
62c5c4113dSnw141292 #define	IDMAP_ERR_RETRIABLE_NET_ERR	-9971
6362c60062Sbaban #define	IDMAP_ERR_W2U_NAMERULE_CONFLICT	-9970
6462c60062Sbaban #define	IDMAP_ERR_U2W_NAMERULE_CONFLICT	-9969
650dcc7149Snw141292 #define	IDMAP_ERR_BAD_UTF8		-9968
664d61c878SJulian Pullen #define	IDMAP_ERR_NONE_GENERATED	-9967
67479ac375Sdm199847 #define	IDMAP_ERR_PROP_UNKNOWN		-9966
68479ac375Sdm199847 #define	IDMAP_ERR_NS_LDAP_OP_FAILED	-9965
69479ac375Sdm199847 #define	IDMAP_ERR_NS_LDAP_PARTIAL	-9964
70479ac375Sdm199847 #define	IDMAP_ERR_NS_LDAP_CFG		-9963
71479ac375Sdm199847 #define	IDMAP_ERR_NS_LDAP_BAD_WINNAME	-9962
724d61c878SJulian Pullen #define	IDMAP_ERR_NO_ACTIVEDIRECTORY	-9961
73c5c4113dSnw141292 
74c5c4113dSnw141292 /* Reserved GIDs for some well-known SIDs */
7548258c6bSjp151216 #define	IDMAP_WK_LOCAL_SYSTEM_GID	2147483648U /* 0x80000000 */
76c5c4113dSnw141292 #define	IDMAP_WK_CREATOR_GROUP_GID	2147483649U
77c5c4113dSnw141292 #define	IDMAP_WK__MAX_GID		2147483649U
78c5c4113dSnw141292 
79c5c4113dSnw141292 /* Reserved UIDs for some well-known SIDs */
80c5c4113dSnw141292 #define	IDMAP_WK_CREATOR_OWNER_UID	2147483648U
81c5c4113dSnw141292 #define	IDMAP_WK__MAX_UID		2147483648U
82c5c4113dSnw141292 
838edda628Sbaban /* Reserved SIDs */
848edda628Sbaban #define	IDMAP_WK_CREATOR_SID_AUTHORITY	"S-1-3"
858edda628Sbaban 
86d3a612caSnw141292 /*
87d3a612caSnw141292  * Max door RPC size for ID mapping (can't be too large relative to the
88d3a612caSnw141292  * default user-land thread stack size, since clnt_door_call()
89d3a612caSnw141292  * alloca()s).  See libidmap:idmap_init().
90d3a612caSnw141292  */
91d3a612caSnw141292 #define	IDMAP_MAX_DOOR_RPC		(256 * 1024)
92d3a612caSnw141292 
93*9fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	IDMAP_SENTINEL_PID		UINT32_MAX
94*9fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	IDMAP_ID_IS_EPHEMERAL(pid)	\
95*9fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States 	(((pid) > INT32_MAX) && ((pid) != IDMAP_SENTINEL_PID))
96*9fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States 
97c5c4113dSnw141292 #endif /* _SYS_IDMAP_H */
98