The branch, master has been updated
       via  306465a s3/winbind: use mono time for startup timeout check
       via  e2de1b8 libreplace: clock_gettime sets errno
       via  3eda281 s4/pvfs: use monotonic time for this timeout
       via  d320aa1 s4/ldap: use time_mono for reconnect timeout
       via  54ca771 s4/torture: use time_mono for timeouts
       via  478ac36 s4/torture: use time_mono for delta time
      from  d4d34bd s3-selftest: add print_test_extended (as called from 
RPC-PRINTER) to knownfail list.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 306465a5a4571cabe5c1c61224873471910b94b6
Author: Björn Jacke <[email protected]>
Date:   Fri Sep 10 21:36:20 2010 +0200

    s3/winbind: use mono time for startup timeout check

commit e2de1b8e717f94944006f3478a133f256cef50de
Author: Björn Jacke <[email protected]>
Date:   Fri Sep 10 21:03:17 2010 +0200

    libreplace: clock_gettime sets errno

commit 3eda2815f648fdb688f9bace4c45870c7a427dfc
Author: Björn Jacke <[email protected]>
Date:   Fri Sep 10 20:46:10 2010 +0200

    s4/pvfs: use monotonic time for this timeout

commit d320aa1212ba926f81d37ee0690381f1f287f30d
Author: Björn Jacke <[email protected]>
Date:   Fri Sep 10 20:39:20 2010 +0200

    s4/ldap: use time_mono for reconnect timeout

commit 54ca77183b63946025c7953cdb9fb558b6b91b1d
Author: Björn Jacke <[email protected]>
Date:   Fri Sep 10 20:28:41 2010 +0200

    s4/torture: use time_mono for timeouts

commit 478ac36b9c4b655c013846ae5ec02c56cbc626d7
Author: Björn Jacke <[email protected]>
Date:   Fri Sep 10 20:25:19 2010 +0200

    s4/torture: use time_mono for delta time

-----------------------------------------------------------------------

Summary of changes:
 lib/replace/replace.c             |    3 ++-
 source3/winbindd/winbindd.h       |    2 +-
 source3/winbindd/winbindd_cm.c    |    4 ++--
 source3/winbindd/winbindd_dual.c  |    6 +++---
 source4/libcli/ldap/ldap_client.c |    4 ++--
 source4/ntvfs/posix/pvfs_search.c |    6 +++---
 source4/ntvfs/posix/vfs_posix.h   |    2 +-
 source4/torture/basic/locking.c   |    4 ++--
 source4/torture/basic/secleak.c   |    4 ++--
 9 files changed, 18 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index f3459dd..a00f705 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -776,7 +776,8 @@ int rep_clock_gettime(clockid_t clk_id, struct timespec *tp)
                        tp->tv_nsec = tval.tv_usec * 1000;
                        break;
                default:
-                       return EINVAL;
+                       errno = EINVAL;
+                       return -1;
        }
        return 0;
 }
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index d7a53e2..1ba24b5 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 8f94b29..4ab2d94 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 f78ae2d..4cec7c2 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 ));
diff --git a/source4/libcli/ldap/ldap_client.c 
b/source4/libcli/ldap/ldap_client.c
index b000b20..865ff6d 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -499,7 +499,7 @@ _PUBLIC_ void ldap_set_reconn_params(struct ldap_connection 
*conn, int max_retri
        if (conn) {
                conn->reconnect.max_retries = max_retries;
                conn->reconnect.retries = 0;
-               conn->reconnect.previous = time(NULL);
+               conn->reconnect.previous = time_mono(NULL);
        }
 }
 
@@ -507,7 +507,7 @@ _PUBLIC_ void ldap_set_reconn_params(struct ldap_connection 
*conn, int max_retri
 static void ldap_reconnect(struct ldap_connection *conn)
 {
        NTSTATUS status;
-       time_t now = time(NULL);
+       time_t now = time_mono(NULL);
 
        /* do we have set up reconnect ? */
        if (conn->reconnect.max_retries == 0) return;
diff --git a/source4/ntvfs/posix/pvfs_search.c 
b/source4/ntvfs/posix/pvfs_search.c
index e6b53ee..a050de1 100644
--- a/source4/ntvfs/posix/pvfs_search.c
+++ b/source4/ntvfs/posix/pvfs_search.c
@@ -291,7 +291,7 @@ static NTSTATUS pvfs_search_fill(struct pvfs_state *pvfs, 
TALLOC_CTX *mem_ctx,
 static void pvfs_search_cleanup(struct pvfs_state *pvfs)
 {
        int i;
-       time_t t = time(NULL);
+       time_t t = time_mono(NULL);
 
        for (i=0;i<MAX_OLD_SEARCHES;i++) {
                struct pvfs_search_state *search;
@@ -379,7 +379,7 @@ static NTSTATUS pvfs_search_first_old(struct 
ntvfs_module_context *ntvfs,
        search->current_index = 0;
        search->search_attrib = search_attrib & 0xFF;
        search->must_attrib = (search_attrib>>8) & 0xFF;
-       search->last_used = time(NULL);
+       search->last_used = time_mono(NULL);
        search->te = NULL;
 
        DLIST_ADD(pvfs->search.list, search);
@@ -437,7 +437,7 @@ static NTSTATUS pvfs_search_next_old(struct 
ntvfs_module_context *ntvfs,
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
-       search->last_used = time(NULL);
+       search->last_used = time_mono(NULL);
 
        status = pvfs_search_fill(pvfs, req, max_count, search, 
io->generic.data_level,
                                  &reply_count, search_private, callback);
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index 70e4c90..d60369d 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -224,7 +224,7 @@ struct pvfs_search_state {
        uint16_t search_attrib;
        uint16_t must_attrib;
        struct pvfs_dir *dir;
-       time_t last_used;
+       time_t last_used; /* monotonic clock time */
        unsigned int num_ea_names;
        struct ea_name *ea_names;
        struct tevent_timer *te;
diff --git a/source4/torture/basic/locking.c b/source4/torture/basic/locking.c
index cece543..71364ef 100644
--- a/source4/torture/basic/locking.c
+++ b/source4/torture/basic/locking.c
@@ -106,14 +106,14 @@ static bool torture_locktest1(struct torture_context 
*tctx,
        lock_timeout = (6 + (random() % 20));
        torture_comment(tctx, "Testing lock timeout with timeout=%u\n", 
                                        lock_timeout);
-       t1 = time(NULL);
+       t1 = time_mono(NULL);
        torture_assert(tctx, 
                !NT_STATUS_IS_OK(smbcli_lock(cli2->tree, fnum3, 0, 4, 
lock_timeout * 1000, WRITE_LOCK)),
                "lock3 succeeded! This is a locking bug\n");
 
        if (!check_error(__location__, cli2, ERRDOS, ERRlock, 
                                 NT_STATUS_FILE_LOCK_CONFLICT)) return false;
-       t2 = time(NULL);
+       t2 = time_mono(NULL);
 
        if (t2 - t1 < 5) {
                torture_fail(tctx, 
diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c
index 92dc350..4c73df1 100644
--- a/source4/torture/basic/secleak.c
+++ b/source4/torture/basic/secleak.c
@@ -62,10 +62,10 @@ static bool try_failed_login(struct torture_context *tctx, 
struct smbcli_state *
 
 bool torture_sec_leak(struct torture_context *tctx, struct smbcli_state *cli)
 {
-       time_t t1 = time(NULL);
+       time_t t1 = time_mono(NULL);
        int timelimit = torture_setting_int(tctx, "timelimit", 20);
 
-       while (time(NULL) < t1+timelimit) {
+       while (time_mono(NULL) < t1+timelimit) {
                if (!try_failed_login(tctx, cli)) {
                        return false;
                }


-- 
Samba Shared Repository

Reply via email to