pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] upgrade rxvt-unicode to 9.05



Whoops.  I hit the send button too soon -- I meant to test this on
NetBSD/macppc first, to check whether the cmsg stuff actually works on
an architecture that cares about alignment.  I've really attached the
patch now; I'll notify shortly of whether it is happy on macppc.
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/rxvt-unicode/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- Makefile    3 Apr 2008 22:36:52 -0000       1.22
+++ Makefile    18 Aug 2008 19:23:27 -0000
@@ -1,8 +1,7 @@
 # $NetBSD: Makefile,v 1.22 2008/04/03 22:36:52 tonnerre Exp $
 #
 
-DISTNAME=              rxvt-unicode-8.3
-PKGREVISION=           3
+DISTNAME=              rxvt-unicode-9.05
 CATEGORIES=            x11
 MASTER_SITES=          http://dist.schmorp.de/rxvt-unicode/ \
                        http://dist.schmorp.de/rxvt-unicode/Attic/
@@ -22,7 +21,11 @@
                        --enable-xpm-background \
                        --enable-xgetdefault    \
                        --enable-24bit
-CONFIGURE_ENV+=                ac_cv_path_TIC=no
+# Setting this to `no' causes an error when doc/Makefile in 9.05 tries
+# to invoke it unconditionally.  Setting this to `:' causes nothing to
+# happen at all, and this is simpler than patching doc/Makefile.in to
+# revert the change that was made to it.
+CONFIGURE_ENV+=                ac_cv_path_TIC=:
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/rxvt-unicode
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/x11/rxvt-unicode/PLIST,v
retrieving revision 1.8
diff -u -r1.8 PLIST
--- PLIST       12 Apr 2008 22:43:15 -0000      1.8
+++ PLIST       18 Aug 2008 19:23:27 -0000
@@ -2,7 +2,6 @@
 bin/urxvt
 bin/urxvtc
 bin/urxvtd
-${PLIST.perl}lib/urxvt/perl/automove-background
 ${PLIST.perl}lib/urxvt/perl/block-graphics-to-ascii
 ${PLIST.perl}lib/urxvt/perl/digital-clock
 ${PLIST.perl}lib/urxvt/perl/example-refresh-hooks
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/rxvt-unicode/distinfo,v
retrieving revision 1.11
diff -u -r1.11 distinfo
--- distinfo    3 Apr 2008 22:36:52 -0000       1.11
+++ distinfo    18 Aug 2008 19:23:27 -0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.11 2008/04/03 22:36:52 tonnerre Exp $
+$NetBSD$
 
-SHA1 (rxvt-unicode-8.3.tar.bz2) = cd335c47543ba086585a296ca0fe7445c07120dd
-RMD160 (rxvt-unicode-8.3.tar.bz2) = 000dbcb1ff297edbff0a8b21dbbba3db30854579
-Size (rxvt-unicode-8.3.tar.bz2) = 885212 bytes
-SHA1 (patch-aa) = e5760c57a6b47780ee851efe09dda5f2f02fca40
-SHA1 (patch-ab) = 2bfbffea8d63ebd65bfa9b0dc43a1901f844137e
+SHA1 (rxvt-unicode-9.05.tar.bz2) = 758d57a88c3521f780bcd21c70d3995f53a2f6e3
+RMD160 (rxvt-unicode-9.05.tar.bz2) = 0f4343a9aa0a8b26d10c6049c1afca2cc7569fc3
+Size (rxvt-unicode-9.05.tar.bz2) = 865815 bytes
+SHA1 (patch-aa) = 0b86573cb5b1ae71b4a36ffd62355329d45c98ed
+SHA1 (patch-ab) = 6a6991089f3caa20dc1725024fc72f1035bd901f
+SHA1 (patch-ac) = 22976db535900f3f00ee86a8fb89235bc5bc141e
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/x11/rxvt-unicode/patches/patch-aa,v
retrieving revision 1.5
diff -u -r1.5 patch-aa
--- patches/patch-aa    6 Aug 2007 10:02:27 -0000       1.5
+++ patches/patch-aa    18 Aug 2008 19:23:27 -0000
@@ -1,14 +1,15 @@
 $NetBSD: patch-aa,v 1.5 2007/08/06 10:02:27 ghen Exp $
 
---- configure.orig     2007-08-06 10:26:41.000000000 +0200
-+++ configure          2007-08-06 10:29:20.000000000 +0200
-@@ -3877,57 +3877,6 @@
+--- configure.orig     2008-05-05 16:49:02.000000000 +0000
++++ configure  2008-08-18 18:01:09.000000000 +0000
+@@ -3851,57 +3851,6 @@
+ fi
  LINKER=$LINKER
  
- 
+-
 -if test -z "$orig_CXXFLAGS"; then
 -  if test x$GCC = xyes && test "x$GXX" = xyes; then
--     CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs"
+-    CXXFLAGS="-g -O3 -fno-rtti -fvisibility-inlines-hidden 
-fno-threadsafe-statics -fno-enforce-eh-specs"
 -    cat >conftest.$ac_ext <<_ACEOF
 -/* confdefs.h.  */
 -_ACEOF
@@ -56,26 +57,6 @@
 -  CFLAGS="$CXXFLAGS"
 -fi
 -
--
- cat >>confdefs.h <<\_ACEOF
- #define _GNU_SOURCE 1
- _ACEOF
-@@ -6691,11 +6640,16 @@
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
+ case $host in
+    *-*-solaris* )
  
-+extern "C" {
-+#include <X11/xpm.h>
-+#include <stddef.h>
-+}
-+
- int
- main ()
- {
--XpmReadFileToPixmap()
--  ;
-+  Drawable d;
-+  XpmReadFileToPixmap(NULL, d, NULL, NULL, NULL, NULL);
-   return 0;
- }
- _ACEOF
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/x11/rxvt-unicode/patches/patch-ab,v
retrieving revision 1.4
diff -u -r1.4 patch-ab
--- patches/patch-ab    3 Apr 2008 22:36:52 -0000       1.4
+++ patches/patch-ab    18 Aug 2008 19:23:27 -0000
@@ -2,9 +2,9 @@
 
 Fix default display vulnerability (CVE-2008-1142).
 
---- src/init.C.orig    2007-08-01 19:35:02.000000000 +0200
-+++ src/init.C
-@@ -299,11 +299,13 @@ rxvt_term::init_resources (int argc, con
+--- src/init.C.orig    2008-06-15 13:50:33.000000000 +0000
++++ src/init.C 2008-08-18 17:37:41.000000000 +0000
+@@ -372,11 +372,13 @@ rxvt_term::init_resources (int argc, con
     * Open display, get options/resources and create the window
     */
  
@@ -18,5 +18,5 @@
 +    rxvt_fatal ("no display given and DISPLAY not set, aborting.\n");
 +
    if (!(display = displays.get (rs[Rs_display_name])))
-     rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]);
- 
+     {
+       free (r_argv);
Index: patches/patch-ac
===================================================================
RCS file: patches/patch-ac
diff -N patches/patch-ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-ac    18 Aug 2008 19:23:27 -0000
@@ -0,0 +1,120 @@
+$NetBSD$
+
+Fix socket message ancillary data cruft.
+
+--- src/fdpass.C.orig  2007-06-25 23:47:14.000000000 +0000
++++ src/fdpass.C       2008-08-09 00:41:29.000000000 +0000
+@@ -26,6 +26,7 @@
+ #include "../config.h"
+ 
+ #include <cstddef> // needed by broken bsds for NULL used in sys/uio.h
++#include <cstdlib>
+ 
+ #include <sys/types.h>
+ #include <sys/uio.h>
+@@ -33,7 +34,12 @@
+ 
+ #include "libptytty.h"
+ 
+-#ifndef CMSG_LEN // CMSG_SPACE && CMSG_LEN are rfc2292 extensions to unix
++// CMSG_SPACE & CMSG_LEN are rfc2292 extensions to unix
++#ifndef CMSG_SPACE
++# define CMSG_SPACE(len) (sizeof (cmsghdr) + len)
++#endif
++
++#ifndef CMSG_LEN
+ # define CMSG_LEN(len) (sizeof (cmsghdr) + len)
+ #endif
+ 
+@@ -42,9 +48,13 @@ ptytty::send_fd (int socket, int fd)
+ {
+   msghdr msg;
+   iovec iov;
+-  char buf [CMSG_LEN (sizeof (int))];
++  void *buf;
++  cmsghdr *cmsg;
+   char data = 0;
+ 
++  if ((buf = malloc (CMSG_SPACE (sizeof (int)))) == NULL)
++    return 0;
++
+   iov.iov_base = &data;
+   iov.iov_len  = 1;
+ 
+@@ -52,19 +62,19 @@ ptytty::send_fd (int socket, int fd)
+   msg.msg_namelen    = 0;
+   msg.msg_iov        = &iov;
+   msg.msg_iovlen     = 1;
+-  msg.msg_control    = (void *)buf;
+-  msg.msg_controllen = sizeof buf;
++  msg.msg_control    = buf;
++  msg.msg_controllen = CMSG_SPACE (sizeof (int));
+ 
+-  cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
++  cmsg = CMSG_FIRSTHDR (&msg);
+   cmsg->cmsg_level = SOL_SOCKET;
+   cmsg->cmsg_type  = SCM_RIGHTS;
+   cmsg->cmsg_len   = CMSG_LEN (sizeof (int));
+ 
+   *(int *)CMSG_DATA (cmsg) = fd;
+ 
+-  msg.msg_controllen = cmsg->cmsg_len;
+-
+-  return sendmsg (socket, &msg, 0) >= 0;
++  ssize_t result = sendmsg (socket, &msg, 0);
++  free (buf);
++  return result >= 0;
+ }
+ 
+ int
+@@ -72,8 +82,13 @@ ptytty::recv_fd (int socket)
+ {
+   msghdr msg;
+   iovec iov;
+-  char buf [CMSG_LEN (sizeof (int))];  /* ancillary data buffer */
++  void *buf;
++  cmsghdr *cmsg;
+   char data = 1;
++  int fd = -1;
++
++  if ((buf = malloc (CMSG_SPACE (sizeof (int)))) == NULL)
++    return -1;
+ 
+   iov.iov_base = &data;
+   iov.iov_len  = 1;
+@@ -83,23 +98,23 @@ ptytty::recv_fd (int socket)
+   msg.msg_iov        = &iov;
+   msg.msg_iovlen     = 1;
+   msg.msg_control    = buf;
+-  msg.msg_controllen = sizeof buf;
+-
+-  cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+-  cmsg->cmsg_level = SOL_SOCKET;
+-  cmsg->cmsg_type  = SCM_RIGHTS;
+-  cmsg->cmsg_len   = CMSG_LEN (sizeof (int));
+-
+-  msg.msg_controllen = cmsg->cmsg_len;
++  msg.msg_controllen = CMSG_SPACE (sizeof (int));
+ 
+   if (recvmsg (socket, &msg, 0) <= 0
+       || data               != 0
+-      || msg.msg_controllen < CMSG_LEN (sizeof (int))
+-      || cmsg->cmsg_level   != SOL_SOCKET
++      || msg.msg_controllen < CMSG_SPACE (sizeof (int)))
++    goto exit;
++
++  cmsg = CMSG_FIRSTHDR (&msg);
++  if (cmsg->cmsg_level      != SOL_SOCKET
+       || cmsg->cmsg_type    != SCM_RIGHTS
+       || cmsg->cmsg_len     < CMSG_LEN (sizeof (int)))
+-    return -1;
++    goto exit;
++
++  fd = *(int *)CMSG_DATA (cmsg);
+ 
+-  return *(int *)CMSG_DATA (cmsg);
++ exit:
++  free (buf);
++  return fd;
+ }
+ 


Home | Main Index | Thread Index | Old Index