summaryrefslogtreecommitdiff
path: root/x11/xlockmore
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>2012-10-15 15:29:09 +0000
committeris <is@pkgsrc.org>2012-10-15 15:29:09 +0000
commit95ff4f397f0246accb76354a0cb59aa684a53377 (patch)
tree74041fd54243787bed043879273a55c95842be6b /x11/xlockmore
parentc7aa74dbaa4b492cd769ff4e30c7ec1984ed7502 (diff)
downloadpkgsrc-95ff4f397f0246accb76354a0cb59aa684a53377.tar.gz
xlock -mode dclock would segfault on OSes with sizeof(time_t)>sizeof(long);
this includes NetBSD-6 on 32bit systems. As a result, xlock -mode random (the default) would eventually unlock the screen, without the user being aware of this (as she/he's can be presumed to have left the monitor). The reason was that some variables in dclock.c were declared long, but contain essentially time_t values. In on case, a pointer to such a variable was casted to (struct time_t *) and passed to localtime(), and the resulting pointer is not checked for error before being used. The variables have been changed to time_t and the typecast has been removed.
Diffstat (limited to 'x11/xlockmore')
-rw-r--r--x11/xlockmore/Makefile4
-rw-r--r--x11/xlockmore/distinfo3
-rw-r--r--x11/xlockmore/patches/patch-modes_dclock.c40
3 files changed, 44 insertions, 3 deletions
diff --git a/x11/xlockmore/Makefile b/x11/xlockmore/Makefile
index d56e5b5c097..ecce28e7447 100644
--- a/x11/xlockmore/Makefile
+++ b/x11/xlockmore/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.99 2012/10/08 23:02:40 adam Exp $
+# $NetBSD: Makefile,v 1.100 2012/10/15 15:29:09 is Exp $
.include "Makefile.common"
-PKGREVISION= 5
+PKGREVISION= 6
COMMENT= Like the XLock session-locker/screensaver, but with more
diff --git a/x11/xlockmore/distinfo b/x11/xlockmore/distinfo
index 205a123f621..d02fb57b6b7 100644
--- a/x11/xlockmore/distinfo
+++ b/x11/xlockmore/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.48 2012/02/13 11:46:13 drochner Exp $
+$NetBSD: distinfo,v 1.49 2012/10/15 15:29:09 is Exp $
SHA1 (xlockmore-5.38.tar.bz2) = 5a0fd27209dfc0966a1ec691f9ea4416587082bf
RMD160 (xlockmore-5.38.tar.bz2) = 227a2c13c8cf1ddb027138dc520874accf5c0f72
@@ -8,3 +8,4 @@ SHA1 (patch-ab) = 48bd5ea9389f646df5ffe290f3230b028916f0d1
SHA1 (patch-ac) = e05f4956c0b4bd9b90c86e5a1174aab5e474115f
SHA1 (patch-ad) = a76c7d9f17dec5cf2a3de6d0c3343c80cf53d314
SHA1 (patch-ae) = b78d7d148c9a62dbdf72e05aeec8d22d10ab9cce
+SHA1 (patch-modes_dclock.c) = b5863dab4153cbe19b54c2838c85df1a84f09a14
diff --git a/x11/xlockmore/patches/patch-modes_dclock.c b/x11/xlockmore/patches/patch-modes_dclock.c
new file mode 100644
index 00000000000..b48c4cb9fd3
--- /dev/null
+++ b/x11/xlockmore/patches/patch-modes_dclock.c
@@ -0,0 +1,40 @@
+$NetBSD: patch-modes_dclock.c,v 1.1 2012/10/15 15:29:10 is Exp $
+
+--- modes/dclock.c.orig 2012-01-23 13:19:21.000000000 +0000
++++ modes/dclock.c
+@@ -420,7 +420,7 @@ convert(double x, char *string)
+ }
+
+ static void
+-dayhrminsec(long timeCount, int tzoffset, char *string)
++dayhrminsec(time_t timeCount, int tzoffset, char *string)
+ {
+ int days, hours, minutes, secs;
+ int bufsize, i;
+@@ -675,7 +675,7 @@ drawDclock(ModeInfo * mi)
+ "%a %b %d %Y", localtime(&(dp->timeold)));
+ }
+ } else {
+- long timeNow, timeLocal;
++ time_t timeNow, timeLocal;
+ timeNow = seconds();
+ timeLocal = timeNow + dp->tzoffset;
+
+@@ -950,7 +950,7 @@ init_dclock(ModeInfo * mi)
+ {
+ Display *display = MI_DISPLAY(mi);
+ dclockstruct *dp;
+- long timeNow, timeLocal;
++ time_t timeNow, timeLocal;
+ int i, j;
+
+ if (dclocks == NULL) {
+@@ -1252,7 +1252,7 @@ defined(MODE_dclock_mayan)
+ dayhrminsec(MAYAN_TIME_START - timeLocal, dp->tzoffset, dp->strnew[1]);
+ dp->strpta[1] = dp->strnew[1];
+ } else {
+- struct tm *t = localtime((const time_t *) &timeLocal);
++ struct tm *t = localtime(&timeLocal);
+
+ if (dp->time24)
+ (void) strftime(dp->strnew[0], STRSIZE, "%H:%M:%S", t);