]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
conn_tdb: change type of connections_data.start to NTTIME
authorJule Anger <janger@samba.org>
Mon, 18 Jul 2022 09:33:12 +0000 (11:33 +0200)
committerJule Anger <janger@samba.org>
Mon, 8 Aug 2022 12:56:28 +0000 (12:56 +0000)
connections_data.start previously had the type time_t, but time_t
only had a precision for seconds. NTTIME has a higer precision,
which is useful for debugging.

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/conn_tdb.c
source3/utils/conn_tdb.h
source3/utils/net_status.c
source3/utils/status.c

index 1effc24665b8fad5ed9e5525a59afadbc36f1a26..3724bd4249363d53de0ce2d91daafd32bc0e6af0 100644 (file)
@@ -128,7 +128,7 @@ static int traverse_tcon_fn(struct smbXsrv_tcon_global0 *global,
        data.gid = sess.gid;
        fstrcpy(data.addr, sess.addr);
        fstrcpy(data.machine, sess.machine);
-       data.start = nt_time_to_unix(global->creation_time);
+       data.start = global->creation_time;
        data.encryption_flags = global->encryption_flags;
        data.cipher = sess.cipher;
        data.dialect = sess.dialect;
index 7af7fa622f4d0cf7d217074e5e5b2a10e9099ab8..cbcf11d960aadd3ec4613b015200e92b858b9f21 100644 (file)
@@ -28,7 +28,7 @@ struct connections_data {
        fstring servicename;
        fstring addr;
        fstring machine;
-       time_t start;
+       NTTIME start;
        uint8_t encryption_flags;
        uint16_t cipher;
        uint16_t dialect;
index cb3f746f64efb57fd97a2a79d39422e06c364766..a22b45cc490dbe18e097444ff2e27cab5d69a4e4 100644 (file)
@@ -108,7 +108,7 @@ static int show_share(const struct connections_data *crec,
        d_printf("%-10.10s   %s   %-12s  %s",
               crec->servicename, server_id_str_buf(crec->pid, &tmp),
               crec->machine,
-              time_to_asc(crec->start));
+              time_to_asc(nt_time_to_unix(crec->start)));
 
        return 0;
 }
@@ -166,7 +166,7 @@ static int show_share_parseable(const struct connections_data *crec,
                 guest ? "" : gidtoname(ids->entries[i].gid),
                 crec->machine,
                 guest ? "" : ids->entries[i].hostname,
-                time_to_asc(crec->start));
+                time_to_asc(nt_time_to_unix(crec->start)));
 
        return 0;
 }
index 81b4a11ae5c050955df7fdf6512db8fc9d841eee..e428110fb1234160a06a3529d38fbb761fb81b46 100644 (file)
@@ -475,7 +475,7 @@ static int traverse_connections(const struct connections_data *crec,
                return 0;
        }
 
-       timestr = timestring(tmp_ctx, crec->start);
+       timestr = timestring(tmp_ctx, nt_time_to_unix(crec->start));
        if (timestr == NULL) {
                TALLOC_FREE(tmp_ctx);
                return -1;