summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-09-10 21:36:20 +0200
committerBjörn Jacke <bj@sernet.de>2010-09-10 23:10:26 +0200
commit306465a5a4571cabe5c1c61224873471910b94b6 (patch)
treede94087a2d67cb7064b971940bf532cba992c7c4 /source3/winbindd
parente2de1b8e717f94944006f3478a133f256cef50de (diff)
downloadsamba-306465a5a4571cabe5c1c61224873471910b94b6.tar.gz
samba-306465a5a4571cabe5c1c61224873471910b94b6.tar.bz2
samba-306465a5a4571cabe5c1c61224873471910b94b6.zip
s3/winbind: use mono time for startup timeout check
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd.h2
-rw-r--r--source3/winbindd/winbindd_cm.c4
-rw-r--r--source3/winbindd/winbindd_dual.c6
3 files changed, 6 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index d7a53e2d66..1ba24b5d0a 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -157,7 +157,7 @@ struct winbindd_domain {
bool primary; /* is this our primary domain ? */
bool internal; /* BUILTIN and member SAM */
bool online; /* is this domain available ? */
- time_t startup_time; /* When we set "startup" true. */
+ time_t startup_time; /* When we set "startup" true. monotonic clock */
bool startup; /* are we in the first 30 seconds after startup_time ? */
bool can_do_samlogon_ex; /* Due to the lack of finer control what type
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 8f94b29640..4ab2d94aa6 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -291,7 +291,7 @@ static void check_domain_online_handler(struct event_context *ctx,
/* Are we still in "startup" mode ? */
- if (domain->startup && (now.tv_sec > domain->startup_time + 30)) {
+ if (domain->startup && (time_mono(NULL) > domain->startup_time + 30)) {
/* No longer in "startup" mode. */
DEBUG(10,("check_domain_online_handler: domain %s no longer in 'startup' mode.\n",
domain->name ));
@@ -508,7 +508,7 @@ void set_domain_online_request(struct winbindd_domain *domain)
GetTimeOfDay(&tev);
/* Go into "startup" mode again. */
- domain->startup_time = tev.tv_sec;
+ domain->startup_time = time_mono(NULL);
domain->startup = True;
tev.tv_sec += 5;
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index f78ae2d711..4cec7c2a1a 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1306,7 +1306,7 @@ static bool fork_domain_child(struct winbindd_child *child)
* try to bring domain online after fork. */
if ( child->domain ) {
child->domain->startup = True;
- child->domain->startup_time = time(NULL);
+ child->domain->startup_time = time_mono(NULL);
/* we can be in primary domain or in trusted domain
* If we are in trusted domain, set the primary domain
* in start-up mode */
@@ -1314,7 +1314,7 @@ static bool fork_domain_child(struct winbindd_child *child)
set_domain_online_request(child->domain);
if (!(child->domain->primary)) {
primary_domain->startup = True;
- primary_domain->startup_time = time(NULL);
+ primary_domain->startup_time = time_mono(NULL);
set_domain_online_request(primary_domain);
}
}
@@ -1389,7 +1389,7 @@ static bool fork_domain_child(struct winbindd_child *child)
GetTimeOfDay(&now);
if (child->domain && child->domain->startup &&
- (now.tv_sec > child->domain->startup_time + 30)) {
+ (time_mono(NULL) > child->domain->startup_time + 30)) {
/* No longer in "startup" mode. */
DEBUG(10,("fork_domain_child: domain %s no longer in 'startup' mode.\n",
child->domain->name ));