summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 604a11aa5b..49e803a49d 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -270,7 +270,7 @@ static int ads_add_machine_acct(ADS_STRUCT *ads, const char *hostname)
asprintf(&new_dn, "cn=%s,cn=Computers,%s", hostname, ads->bind_path);
asprintf(&samAccountName, "%s$", hostname);
asprintf(&controlstr, "%u",
- UF_DONT_EXPIRE_PASSWD | UF_WORKSTATION_TRUST_ACCOUNT |
+ UF_DONT_EXPIRE_PASSWD | UF_WORKSTATION_TRUST_ACCOUNT |
UF_TRUSTED_FOR_DELEGATION | UF_USE_DES_KEY_ONLY);
ret = ads_gen_add(ads, new_dn,
@@ -466,4 +466,17 @@ NTSTATUS ads_set_machine_password(ADS_STRUCT *ads,
return ret;
}
+/* find the update serial number - this is the core of the ldap cache */
+BOOL ads_USN(ADS_STRUCT *ads, unsigned *usn)
+{
+ const char *attrs[] = {"highestCommittedUSN", NULL};
+ int rc;
+ void *res;
+
+ rc = ldap_search_s(ads->ld, ads->bind_path,
+ LDAP_SCOPE_BASE, "(objectclass=*)", (char **)attrs, 0, (LDAPMessage *)&res);
+ if (rc || ads_count_replies(ads, res) != 1) return False;
+ return False;
+}
+
#endif