static void wb_next_pwent_fetch_done(struct tevent_req *subreq);
static void wb_next_pwent_fill_done(struct tevent_req *subreq);
-static struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain)
-{
- if (domain == NULL) {
- domain = domain_list();
- } else {
- domain = domain->next;
- }
-
- if ((domain != NULL)
- && sid_check_is_our_sam(&domain->sid)) {
- domain = domain->next;
- }
- return domain;
-}
-
struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct getpwent_state *gstate,
/* The following definitions come from winbindd/winbindd_util.c */
struct winbindd_domain *domain_list(void);
+struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
bool domain_is_forest_root(const struct winbindd_domain *domain);
void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
struct timeval now, void *private_data);
}
}
+/**
+ * Iterator for winbindd's domain list.
+ * To be used (e.g.) in tevent based loops.
+ */
+struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain)
+{
+ if (domain == NULL) {
+ domain = domain_list();
+ } else {
+ domain = domain->next;
+ }
+
+ if ((domain != NULL)
+ && sid_check_is_our_sam(&domain->sid)) {
+ domain = domain->next;
+ }
+ return domain;
+}
+
static bool is_internal_domain(const struct dom_sid *sid)
{
if (sid == NULL)