return msrpc_methods.password_policy(domain, mem_ctx, policy);
}
+
+static int trusted_domains_cmp(struct netr_DomainTrust *d1,
+ struct netr_DomainTrust *d2)
+{
+
+ return 0;
+#if 0
+ /* Silly cases */
+
+ if (!j1 && !j2)
+ return 0;
+ if (!j1)
+ return -1;
+ if (!j2)
+ return 1;
+
+ /* Sort on job start time */
+
+ if (j1->time == j2->time)
+ return 0;
+ return (j1->time > j2->time) ? 1 : -1;
+#endif
+}
+
/* get a list of trusted domains */
static NTSTATUS trusted_domains(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
/* Copy across names and sids */
- ret_count = 0;
+ TYPESAFE_QSORT(trusts->array, trusts->count, trusted_domains_cmp);
+
for (i = 0; i < trusts->count; i++) {
struct netr_DomainTrust *trust = &trusts->array[i];
struct winbindd_domain d;
d.domain_trust_attribs = trust->trust_attributes;
wcache_tdc_add_domain( &d );
- ret_count++;
} else if (domain_is_forest_root(domain)) {
/* Check if we already have this record. If
* we are following our forest root that is not
trust->trust_attributes;
wcache_tdc_add_domain( &d );
- ret_count++;
}
TALLOC_FREE(exist);
} else {
trust->trust_attributes = d.domain_trust_attribs;
wcache_tdc_add_domain( &d );
- ret_count++;
}
}
return result;