s3: Fix Coverity ID 2331: RESOURCE_LEAK
[Samba.git] / source3 / libads / ads_ldap_protos.h
blob03869fe5c998ee8e73ddd9544c68f78cc4f60211
1 /*
2 * Prototypes for ads
3 */
5 void ads_msgfree(ADS_STRUCT *ads, LDAPMessage *msg);
6 char *ads_get_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg);
8 char *ads_pull_string(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg,
9 const char *field);
10 char **ads_pull_strings(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
11 LDAPMessage *msg, const char *field,
12 size_t *num_values);
13 char **ads_pull_strings_range(ADS_STRUCT *ads,
14 TALLOC_CTX *mem_ctx,
15 LDAPMessage *msg, const char *field,
16 char **current_strings,
17 const char **next_attribute,
18 size_t *num_strings,
19 bool *more_strings);
20 bool ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
21 uint32 *v);
22 bool ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid);
23 bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
24 struct dom_sid *sid);
25 int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
26 LDAPMessage *msg, const char *field, struct dom_sid **sids);
27 bool ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
28 LDAPMessage *msg, const char *field, struct security_descriptor **sd);
29 char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
30 LDAPMessage *msg);
31 int ads_pull_sids_from_extendeddn(ADS_STRUCT *ads,
32 TALLOC_CTX *mem_ctx,
33 LDAPMessage *msg,
34 const char *field,
35 enum ads_extended_dn_flags flags,
36 struct dom_sid **sids);
38 ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, LDAPMessage **res,
39 const char *machine);
40 ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, LDAPMessage **res,
41 const char *printer,
42 const char *servername);
43 ADS_STATUS ads_find_printers(ADS_STRUCT *ads, LDAPMessage **res);
44 ADS_STATUS ads_find_user_acct(ADS_STRUCT *ads, LDAPMessage **res,
45 const char *user);
47 ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope,
48 const char *expr,
49 const char **attrs, LDAPMessage **res);
50 ADS_STATUS ads_search(ADS_STRUCT *ads, LDAPMessage **res,
51 const char *expr, const char **attrs);
52 ADS_STATUS ads_search_dn(ADS_STRUCT *ads, LDAPMessage **res,
53 const char *dn, const char **attrs);
54 ADS_STATUS ads_do_search_all_args(ADS_STRUCT *ads, const char *bind_path,
55 int scope, const char *expr,
56 const char **attrs, void *args,
57 LDAPMessage **res);
58 ADS_STATUS ads_do_search_all(ADS_STRUCT *ads, const char *bind_path,
59 int scope, const char *expr,
60 const char **attrs, LDAPMessage **res);
61 ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path,
62 int scope,
63 const char *expr,
64 const char **attrs, LDAPMessage **res);
65 ADS_STATUS ads_search_retry(ADS_STRUCT *ads, LDAPMessage **res,
66 const char *expr, const char **attrs);
67 ADS_STATUS ads_search_retry_dn(ADS_STRUCT *ads, LDAPMessage **res,
68 const char *dn,
69 const char **attrs);
70 ADS_STATUS ads_search_retry_extended_dn_ranged(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
71 const char *dn,
72 const char **attrs,
73 enum ads_extended_dn_flags flags,
74 char ***strings,
75 size_t *num_strings);
76 ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res,
77 const struct dom_sid *sid,
78 const char **attrs);
81 LDAPMessage *ads_first_entry(ADS_STRUCT *ads, LDAPMessage *res);
82 LDAPMessage *ads_next_entry(ADS_STRUCT *ads, LDAPMessage *res);
83 LDAPMessage *ads_first_message(ADS_STRUCT *ads, LDAPMessage *res);
84 LDAPMessage *ads_next_message(ADS_STRUCT *ads, LDAPMessage *res);
85 void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res,
86 bool (*fn)(ADS_STRUCT *,char *, void **, void *),
87 void *data_area);
88 void ads_dump(ADS_STRUCT *ads, LDAPMessage *res);
90 struct GROUP_POLICY_OBJECT;
91 ADS_STATUS ads_parse_gpo(ADS_STRUCT *ads,
92 TALLOC_CTX *mem_ctx,
93 LDAPMessage *res,
94 const char *gpo_dn,
95 struct GROUP_POLICY_OBJECT *gpo);
96 ADS_STATUS ads_search_retry_dn_sd_flags(ADS_STRUCT *ads, LDAPMessage **res,
97 uint32 sd_flags,
98 const char *dn,
99 const char **attrs);
100 ADS_STATUS ads_do_search_all_sd_flags(ADS_STRUCT *ads, const char *bind_path,
101 int scope, const char *expr,
102 const char **attrs, uint32 sd_flags,
103 LDAPMessage **res);
104 ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads,
105 TALLOC_CTX *mem_ctx,
106 const char *dn,
107 struct dom_sid *user_sid,
108 struct dom_sid *primary_group_sid,
109 struct dom_sid **sids,
110 size_t *num_sids);
111 ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
112 TALLOC_CTX *mem_ctx,
113 char ***ous,
114 size_t *num_ous);