summaryrefslogtreecommitdiff
path: root/net/icsi-finger
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>2011-01-18 12:28:25 +0000
committeris <is@pkgsrc.org>2011-01-18 12:28:25 +0000
commit3cb80fff256b08885cb28aae54f47ff4fc61a9b6 (patch)
tree44afa31dfd853cba6fcb9b201989ab7541e7cee7 /net/icsi-finger
parentb14427059e48b928fa5a62e7dc7d66afa35a97bb (diff)
downloadpkgsrc-3cb80fff256b08885cb28aae54f47ff4fc61a9b6.tar.gz
Fix for 64bit time_t:
- make the packet contain explicit 32bit data for compatibility with clients on machines with 32bit time_t. - replace ctime() calls on such changed former time_t values by a shim that does the translation. This does not start to work after 2038 yet - that would need a change of the collection protocol.
Diffstat (limited to 'net/icsi-finger')
-rw-r--r--net/icsi-finger/Makefile4
-rw-r--r--net/icsi-finger/distinfo7
-rw-r--r--net/icsi-finger/patches/patch-ai20
-rw-r--r--net/icsi-finger/patches/patch-aj22
-rw-r--r--net/icsi-finger/patches/patch-ak28
-rw-r--r--net/icsi-finger/patches/patch-al20
-rw-r--r--net/icsi-finger/patches/patch-am12
7 files changed, 110 insertions, 3 deletions
diff --git a/net/icsi-finger/Makefile b/net/icsi-finger/Makefile
index 1f642ca0223..c91cebefa92 100644
--- a/net/icsi-finger/Makefile
+++ b/net/icsi-finger/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.14 2010/03/03 11:59:57 is Exp $
+# $NetBSD: Makefile,v 1.15 2011/01/18 12:28:25 is Exp $
#
DISTNAME= icsi-finger-1.0.27
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= net
MASTER_SITES= ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/
EXTRACT_SUFX= .tar.Z
diff --git a/net/icsi-finger/distinfo b/net/icsi-finger/distinfo
index ed2c02c7013..7afebcef6bc 100644
--- a/net/icsi-finger/distinfo
+++ b/net/icsi-finger/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2008/12/15 15:37:56 is Exp $
+$NetBSD: distinfo,v 1.8 2011/01/18 12:28:25 is Exp $
SHA1 (icsi-finger-1.0.27.tar.Z) = 41f03c42269a402169000a6b08ba8c6330256861
RMD160 (icsi-finger-1.0.27.tar.Z) = 92839362b6d4b1893958ca0909654f070e734aa4
@@ -10,3 +10,8 @@ SHA1 (patch-ad) = de1489cf9860bd412a43a875a43eae69dd559606
SHA1 (patch-ae) = 7613ee307bb047d5e5c794b829dcd1cb1c8edb81
SHA1 (patch-af) = 96d691992eecbf08118a924218570325a52603b1
SHA1 (patch-ah) = edc68dfa08125620b6353f9f762ab6776f6b0597
+SHA1 (patch-ai) = 01b48ecef2c1fe191780c9a8dee61f2951ee9c10
+SHA1 (patch-aj) = 53adee387e703fcff2b8f5dba4ae593712acb2ad
+SHA1 (patch-ak) = 8e9bd7da344e082deb0e51301e124a2b7f8025fe
+SHA1 (patch-al) = 28e8762269e94dec2e1b306527c2613b8a86d76d
+SHA1 (patch-am) = 50b7cc7eaa30eaab2a26a849a875322c5344a74a
diff --git a/net/icsi-finger/patches/patch-ai b/net/icsi-finger/patches/patch-ai
new file mode 100644
index 00000000000..a483cba0c3a
--- /dev/null
+++ b/net/icsi-finger/patches/patch-ai
@@ -0,0 +1,20 @@
+$NetBSD: patch-ai,v 1.1 2011/01/18 12:28:25 is Exp $
+
+--- include/packet.h.orig 1994-01-11 02:15:10.000000000 +0000
++++ include/packet.h
+@@ -44,12 +44,12 @@ typedef struct {
+ char name[USERNAME_LEN];
+ char real_name[REALNAME_LEN];
+ char host[HOSTNAME_LEN];
+- time_t login_time;
+- time_t idle_time;
++ int32_t login_time;
++ int32_t idle_time;
+ char ttyname[TTYNAME_LEN];
+ char ttyloc[TTYLOC_LEN];
+ char what[WHAT_LEN];
+-} FINGER_PACKET;
++} __attribute__((__packed__)) FINGER_PACKET;
+
+ /* Strings used in dummy packets to signal host is free or down */
+ #define HOST_NOUSERS "Host has no users"
diff --git a/net/icsi-finger/patches/patch-aj b/net/icsi-finger/patches/patch-aj
new file mode 100644
index 00000000000..92c17d37f8a
--- /dev/null
+++ b/net/icsi-finger/patches/patch-aj
@@ -0,0 +1,22 @@
+$NetBSD: patch-aj,v 1.1 2011/01/18 12:28:25 is Exp $
+
+--- lib/packet.c.orig 1994-01-11 02:14:20.000000000 +0000
++++ lib/packet.c
+@@ -218,7 +218,7 @@ print_packet (packet, stream)
+ char *idle = idle_time_string (packet->idle_time, 1);
+ #define DATE_OFFSET 4
+ #define TIME_OFFSET 11
+- char *when = ctime (&packet->login_time);
++ char *when = ctime32 (&packet->login_time);
+ #define WEEKS_TIME (7 * 24 * 60 * 60)
+ int old_login = time(NULL) - packet->login_time > WEEKS_TIME;
+
+@@ -277,7 +277,7 @@ debug_packet (packet)
+ what: \"%s\"\n\
+ }", packet,
+ packet->name, packet->real_name, packet->host,
+- ctime (&(packet->login_time)), idle,
++ ctime32 (&(packet->login_time)), idle,
+ packet->ttyname, packet->ttyloc, packet->what);
+ free (idle);
+ fflush (stderr);
diff --git a/net/icsi-finger/patches/patch-ak b/net/icsi-finger/patches/patch-ak
new file mode 100644
index 00000000000..618fe1e4ba6
--- /dev/null
+++ b/net/icsi-finger/patches/patch-ak
@@ -0,0 +1,28 @@
+$NetBSD: patch-ak,v 1.1 2011/01/18 12:28:25 is Exp $
+
+--- src/in.fingerd.c.orig 1996-01-10 19:26:24.000000000 +0000
++++ src/in.fingerd.c
+@@ -805,12 +805,12 @@ finger_users (user, options, stream)
+ fprintf (stream, "%s (%s) seen at %s on %s",
+ upackets[i]->real_name, upackets[i]->name,
+ strip_hostname (upackets[i]->host),
+- ctime (&upackets[i]->idle_time));
++ ctime32 (&upackets[i]->idle_time));
+ else
+ fprintf (stream, "%s seen at %s on %s",
+ upackets[i]->name,
+ strip_hostname (upackets[i]->host),
+- ctime (&upackets[i]->idle_time));
++ ctime32 (&upackets[i]->idle_time));
+ }
+ else
+ {
+@@ -1262,7 +1262,7 @@ show_unlogged_packet (packet, stream)
+
+ /* In SunOS4 getpwnam() seems to call ctime(), so we move this call down
+ * here to be sure the intended result doesn't get overwritten. */
+- char *the_time = ctime(&packet->idle_time);
++ char *the_time = ctime32(&packet->idle_time);
+ the_time[strlen(the_time) - 1] = '\0'; /* delete newline */
+
+ if (*(packet->real_name))
diff --git a/net/icsi-finger/patches/patch-al b/net/icsi-finger/patches/patch-al
new file mode 100644
index 00000000000..5cc603c36ea
--- /dev/null
+++ b/net/icsi-finger/patches/patch-al
@@ -0,0 +1,20 @@
+$NetBSD: patch-al,v 1.1 2011/01/18 12:28:25 is Exp $
+
+--- lib/os.c.orig 1996-07-18 23:31:32.000000000 +0000
++++ lib/os.c
+@@ -1137,3 +1137,15 @@ same_hostip (host1, host2)
+ return (addr1 == addr2);
+ }
+
++/* a ctime() replacement that reads a 32bit timestamp, even when
++ time_t has a different size. */
++
++char *
++ctime32(tp)
++ int32_t *tp;
++{
++ time_t thetime = *tp;
++
++ return ctime(&thetime);
++}
++
diff --git a/net/icsi-finger/patches/patch-am b/net/icsi-finger/patches/patch-am
new file mode 100644
index 00000000000..a4bc9abaa87
--- /dev/null
+++ b/net/icsi-finger/patches/patch-am
@@ -0,0 +1,12 @@
+$NetBSD: patch-am,v 1.1 2011/01/18 12:28:25 is Exp $
+
+--- include/os.h.orig 2011-01-18 11:18:06.000000000 +0000
++++ include/os.h
+@@ -76,4 +76,7 @@ char *tty_lookup ();
+ /* Strip ttyname to compact format */
+ char *strip_ttyname ();
+
++/* ctime() that always reads 32bit */
++char *ctime32 ();
++
+ #endif /* _OS_H_ */