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"
31 #define LOOKUP_NAME_NONE 0x00000000
32 #define LOOKUP_NAME_ISOLATED 0x00000001 /* Look up unqualified names */
33 #define LOOKUP_NAME_REMOTE 0x00000002 /* Ask others */
34 #define LOOKUP_NAME_GROUP 0x00000004 /* This is a NASTY hack for
35 valid users = @foo where foo also
37 #define LOOKUP_NAME_NO_NSS 0x00000008 /* no NSS calls to avoid
39 #define LOOKUP_NAME_BUILTIN 0x00000010 /* builtin names */
40 #define LOOKUP_NAME_WKN 0x00000020 /* well known names */
41 #define LOOKUP_NAME_DOMAIN 0x00000040 /* only lookup own domain */
42 #define LOOKUP_NAME_LOCAL (LOOKUP_NAME_ISOLATED\
46 #define LOOKUP_NAME_ALL (LOOKUP_NAME_ISOLATED\
60 struct lsa_name_info
{
62 enum lsa_SidType type
;
67 /* The following definitions come from passdb/lookup_sid.c */
69 bool lookup_name(TALLOC_CTX
*mem_ctx
,
70 const char *full_name
, int flags
,
71 const char **ret_domain
, const char **ret_name
,
72 struct dom_sid
*ret_sid
, enum lsa_SidType
*ret_type
);
73 bool lookup_name_smbconf(TALLOC_CTX
*mem_ctx
,
74 const char *full_name
, int flags
,
75 const char **ret_domain
, const char **ret_name
,
76 struct dom_sid
*ret_sid
, enum lsa_SidType
*ret_type
);
77 NTSTATUS
lookup_sids(TALLOC_CTX
*mem_ctx
, int num_sids
,
78 const struct dom_sid
**sids
, int level
,
79 struct lsa_dom_info
**ret_domains
,
80 struct lsa_name_info
**ret_names
);
81 bool lookup_sid(TALLOC_CTX
*mem_ctx
, const struct dom_sid
*sid
,
82 const char **ret_domain
, const char **ret_name
,
83 enum lsa_SidType
*ret_type
);
84 void uid_to_sid(struct dom_sid
*psid
, uid_t uid
);
85 void gid_to_sid(struct dom_sid
*psid
, gid_t gid
);
86 void xid_to_sid(struct dom_sid
*psid
, const struct unixid
*xid
);
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
);
89 bool sids_to_unixids(const struct dom_sid
*sids
, uint32_t num_sids
,
91 NTSTATUS
get_primary_group_sid(TALLOC_CTX
*mem_ctx
,
94 struct dom_sid
**_group_sid
);
96 #endif /* _PASSDB_LOOKUP_SID_H_ */