summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-09-07 02:15:09 +0200
committerBjörn Jacke <bj@sernet.de>2010-09-07 20:37:53 +0200
commit5b016dbab852cd443c8f9049acb94a113de227e1 (patch)
tree9696dc918a7b6f326fb3e5816262030c30e0e477 /source3/libads
parentf69085e5ff525d534f66c6163aacb8c320a484bc (diff)
downloadsamba-5b016dbab852cd443c8f9049acb94a113de227e1.tar.gz
samba-5b016dbab852cd443c8f9049acb94a113de227e1.tar.bz2
samba-5b016dbab852cd443c8f9049acb94a113de227e1.zip
s3/libads: use monotonic clock for ldap connection timeouts
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c2
-rw-r--r--source3/libads/ldap_utils.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 77ab51ee26..970f20a8d9 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -596,7 +596,7 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
char addr[INET6_ADDRSTRLEN];
ZERO_STRUCT(ads->ldap);
- ads->ldap.last_attempt = time(NULL);
+ ads->ldap.last_attempt = time_mono(NULL);
ads->ldap.wrap_type = ADS_SASLWRAP_TYPE_PLAIN;
/* try with a user specified server */
diff --git a/source3/libads/ldap_utils.c b/source3/libads/ldap_utils.c
index c0c1adba30..0c07961153 100644
--- a/source3/libads/ldap_utils.c
+++ b/source3/libads/ldap_utils.c
@@ -40,7 +40,7 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT *ads, const char *bind
*res = NULL;
if (!ads->ldap.ld &&
- time(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
+ time_mono(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
return ADS_ERROR(LDAP_SERVER_DOWN);
}