From eec9e8a052407611df223fec982588e7a2bd7f49 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 28 Nov 2001 03:56:30 +0000 Subject: fix a bunch of places where we can double-free a cli structure (This used to be commit e2ba2383c9f679c076749a8f4fccefc3559e37ec) --- source3/libads/ldap.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source3/libads') 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 -- cgit