2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 1992-1998
5 Copyright (C) Gerald (Jerry) Carter 2003
6 Copyright (C) Volker Lendecke 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef _PASSDB_LOOKUP_SID_H_
24 #define _PASSDB_LOOKUP_SID_H_
26 #include "../librpc/gen_ndr/lsa.h"
30 #define LOOKUP_NAME_NONE 0x00000000
31 #define LOOKUP_NAME_ISOLATED 0x00000001 /* Look up unqualified names */
32 #define LOOKUP_NAME_REMOTE 0x00000002 /* Ask others */
33 #define LOOKUP_NAME_GROUP 0x00000004 /* (unused) This is a NASTY hack for
34 valid users = @foo where foo also
36 #define LOOKUP_NAME_NO_NSS 0x00000008 /* no NSS calls to avoid
38 #define LOOKUP_NAME_BUILTIN 0x00000010 /* builtin names */
39 #define LOOKUP_NAME_WKN 0x00000020 /* well known names */
40 #define LOOKUP_NAME_DOMAIN 0x00000040 /* only lookup own domain */
41 #define LOOKUP_NAME_LOCAL (LOOKUP_NAME_ISOLATED\
45 #define LOOKUP_NAME_ALL (LOOKUP_NAME_ISOLATED\
59 struct lsa_name_info
{
61 enum lsa_SidType type
;
66 /* The following definitions come from passdb/lookup_sid.c */
68 bool lookup_name(TALLOC_CTX
*mem_ctx
,
69 const char *full_name
, int flags
,
70 const char **ret_domain
, const char **ret_name
,
71 struct dom_sid
*ret_sid
, enum lsa_SidType
*ret_type
);
72 bool lookup_name_smbconf(TALLOC_CTX
*mem_ctx
,
73 const char *full_name
, int flags
,
74 const char **ret_domain
, const char **ret_name
,
75 struct dom_sid
*ret_sid
, enum lsa_SidType
*ret_type
);
76 NTSTATUS
lookup_sids(TALLOC_CTX
*mem_ctx
, int num_sids
,
77 const struct dom_sid
**sids
, int level
,
78 struct lsa_dom_info
**ret_domains
,
79 struct lsa_name_info
**ret_names
);
80 bool lookup_sid(TALLOC_CTX
*mem_ctx
, const struct dom_sid
*sid
,
81 const char **ret_domain
, const char **ret_name
,
82 enum lsa_SidType
*ret_type
);
83 void store_uid_sid_cache(const struct dom_sid
*psid
, uid_t uid
);
84 void store_gid_sid_cache(const struct dom_sid
*psid
, gid_t gid
);
85 void uid_to_sid(struct dom_sid
*psid
, uid_t uid
);
86 void gid_to_sid(struct dom_sid
*psid
, gid_t gid
);
87 bool sid_to_uid(const struct dom_sid
*psid
, uid_t
*puid
);
88 bool sid_to_gid(const struct dom_sid
*psid
, gid_t
*pgid
);
90 bool sids_to_unix_ids(const struct dom_sid
*sids
, uint32_t num_sids
,
91 struct wbcUnixId
*ids
);
92 NTSTATUS
get_primary_group_sid(TALLOC_CTX
*mem_ctx
,
95 struct dom_sid
**_group_sid
);
97 #endif /* _PASSDB_LOOKUP_SID_H_ */