summaryrefslogtreecommitdiff
path: root/source3/passdb/lookup_sid.h
blob: 81303f87cb827d10f94d850be2a3d5a64f108218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "../librpc/gen_ndr/lsa.h"

struct lsa_dom_info {
	bool valid;
	struct dom_sid sid;
	const char *name;
	int num_idxs;
	int *idxs;
};

struct lsa_name_info {
	uint32 rid;
	enum lsa_SidType type;
	const char *name;
	int dom_idx;
};

/* The following definitions come from passdb/lookup_sid.c  */

bool lookup_name(TALLOC_CTX *mem_ctx,
		 const char *full_name, int flags,
		 const char **ret_domain, const char **ret_name,
		 struct dom_sid *ret_sid, enum lsa_SidType *ret_type);
bool lookup_name_smbconf(TALLOC_CTX *mem_ctx,
		 const char *full_name, int flags,
		 const char **ret_domain, const char **ret_name,
		 struct dom_sid *ret_sid, enum lsa_SidType *ret_type);
NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
		     const struct dom_sid **sids, int level,
		     struct lsa_dom_info **ret_domains,
		     struct lsa_name_info **ret_names);
bool lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
		const char **ret_domain, const char **ret_name,
		enum lsa_SidType *ret_type);
void store_uid_sid_cache(const struct dom_sid *psid, uid_t uid);
void store_gid_sid_cache(const struct dom_sid *psid, gid_t gid);
void uid_to_sid(struct dom_sid *psid, uid_t uid);
void gid_to_sid(struct dom_sid *psid, gid_t gid);
bool sid_to_uid(const struct dom_sid *psid, uid_t *puid);
bool sid_to_gid(const struct dom_sid *psid, gid_t *pgid);
NTSTATUS get_primary_group_sid(TALLOC_CTX *mem_ctx,
				const char *username,
				struct passwd **_pwd,
				struct dom_sid **_group_sid);
bool delete_uid_cache(uid_t uid);
bool delete_gid_cache(gid_t gid);
bool delete_sid_cache(const struct dom_sid* psid);
void flush_uid_cache(void);
void flush_gid_cache(void);