summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-06-18 22:18:03 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-06-18 22:18:03 +0000
commit1d0aad3e84d8673482d60b10adabe787ac70d28a (patch)
tree4c42e515340d7f8177a4ece8a5468ee18617d357 /usr.bin
parent1c4e6cd26420fee6e835171ffffb3b8b1e6dc3cd (diff)
Add sanity check for remote host boot time > current time for when
clocks go screwey. Similar to patch from kstailey@disclosure.com.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rup/rup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c
index 2ba3aa33912..278bc81bc64 100644
--- a/usr.bin/rup/rup.c
+++ b/usr.bin/rup/rup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rup.c,v 1.11 1999/08/16 23:48:57 aaron Exp $ */
+/* $OpenBSD: rup.c,v 1.12 2001/06/18 22:18:02 millert Exp $ */
/*-
* Copyright (c) 1993, John Brezak
@@ -34,7 +34,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rup.c,v 1.11 1999/08/16 23:48:57 aaron Exp $";
+static char rcsid[] = "$OpenBSD: rup.c,v 1.12 2001/06/18 22:18:02 millert Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -206,7 +206,8 @@ print_rup_data(host, host_stat)
host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec;
- ups=host_stat->curtime.tv_sec;
+ if (host_stat->curtime.tv_sec > 0)
+ ups=host_stat->curtime.tv_sec;
upd=ups/(3600*24);
ups-=upd*3600*24;
uph=ups/3600;