From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Apr 21 08:40:10 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2DF81065673 for ; Thu, 21 Apr 2011 08:40:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C754F8FC13 for ; Thu, 21 Apr 2011 08:40:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p3L8eAVx079874 for ; Thu, 21 Apr 2011 08:40:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3L8eAWK079873; Thu, 21 Apr 2011 08:40:10 GMT (envelope-from gnats) Resent-Date: Thu, 21 Apr 2011 08:40:10 GMT Resent-Message-Id: <201104210840.p3L8eAWK079873@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Marcin Cieslak Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42CF5106564A for ; Thu, 21 Apr 2011 08:36:13 +0000 (UTC) (envelope-from saper@saper.info) Received: from l.saper.info (l.saper.info [IPv6:2001:41d0:1:d467::1000]) by mx1.freebsd.org (Postfix) with ESMTP id 84EDC8FC08 for ; Thu, 21 Apr 2011 08:36:12 +0000 (UTC) Received: from l.saper.info (uucp@localhost [127.0.0.1]) by l.saper.info (8.14.4/8.14.4) with ESMTP id p3L8ZQqC059676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Apr 2011 08:35:26 GMT (envelope-from saper@saper.info) Received: (from uucp@localhost) by l.saper.info (8.14.4/8.14.4/Submit) with UUCP id p3L8ZQe7059675; Thu, 21 Apr 2011 08:35:26 GMT (envelope-from saper@saper.info) Received: from radziecki.saper.info (localhost [127.0.0.1]) by radziecki.saper.info (8.14.4/8.14.4) with ESMTP id p3L8ZcQY030674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Apr 2011 08:35:38 GMT (envelope-from saper@saper.info) Received: (from saper@localhost) by radziecki.saper.info (8.14.4/8.14.4/Submit) id p3L8ZcgS030656; Thu, 21 Apr 2011 08:35:38 GMT (envelope-from saper) Message-Id: <201104210835.p3L8ZcgS030656@radziecki.saper.info> Date: Thu, 21 Apr 2011 08:35:38 GMT From: Marcin Cieslak To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: akosela@andykosela.com Subject: ports/156544: [PATCH] x11/rxvt-devel: don't crash on paste from non-ICCCM clients X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2011 08:40:11 -0000 >Number: 156544 >Category: ports >Synopsis: [PATCH] x11/rxvt-devel: don't crash on paste from non-ICCCM clients >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Apr 21 08:40:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Marcin Cieslak >Release: FreeBSD 9.0-CURRENT amd64 >Organization: http://saper.info >Environment: System: FreeBSD radziecki.saper.info 9.0-CURRENT FreeBSD 9.0-CURRENT #1 r219785M: Mon Mar 21 11:40:40 CET >Description: Some clients that are sending NONE as property in their ConvertSelection request: ............REQUEST: ConvertSelection sequence number: 012c request length: 0006 requestor: WIN 0260000d selection: target: property: time: CurrentTime ..............EVENT: SelectionRequest sequence number: 0208 time: CurrentTime owner: WIN 02400008 requestor: WIN 0260000d selection: target: property: ..............ERROR: Atom ....SYNTHETIC EVENT: SelectionNotify sequence number: 012c time: CurrentTime requestor: WIN 0260000d selection: target: property: Receipt of SelectionRequest with property causes rxvt derivatives to crash with BadAtom error. ICCCM says, that only obsolete clients should behave like this, and t recommends that clients owning selection should use the target atom as the property name. (see http://tronche.com/gui/x/icccm/sec-2.html#s-2.2) xterm is handling this, but rxvt and derivatives do not. Submitted for x11/rxvt-unicode as http://www.freebsd.org/cgi/query-pr.cgi?pr=156509 Submitted for x11/rxvt as http://www.freebsd.org/cgi/query-pr.cgi?pr=156542 Submitted upstream: (rxvt) https://sourceforge.net/tracker/?func=detail&aid=3289852&group_id=221&atid=100221 (rxvt-unicode) http://thread.gmane.org/gmane.comp.terminal-emulators.rxvt-unicode.general/958 Added file(s): - files/patch-screen.c Port maintainer (akosela@andykosela.com) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: Paste from rxvt into comms/syncterm or one of the clients described in: http://michael.toren.net/mirrors/doc/X-copy+paste.txt >Fix: --- rxvt-devel-2.7.10_5.patch begins here --- diff -ruN --exclude=CVS /usr/ports/x11/rxvt-devel.orig/files/patch-src-screen.c /usr/ports/x11/rxvt-devel/files/patch-src-screen.c --- /usr/ports/x11/rxvt-devel.orig/files/patch-src-screen.c 2011-04-21 10:30:24.000000000 +0200 +++ /usr/ports/x11/rxvt-devel/files/patch-src-screen.c 2011-04-21 10:32:15.000000000 +0200 @@ -1,11 +1,62 @@ --- src/screen.c.orig 2003-03-23 17:56:06.000000000 +0100 -+++ src/screen.c 2008-01-04 16:45:00.000000000 +0100 -@@ -3548,7 +3548,7 @@ ++++ src/screen.c 2011-04-19 23:27:32.000000000 +0200 +@@ -3520,6 +3520,7 @@ + Atom32 target_list[3]; + #endif + Atom target; ++ Atom property; + XTextProperty ct; + XICCEncodingStyle style; + char *cl[2], dummy[1]; +@@ -3532,6 +3533,15 @@ + ev.target = rq->target; + ev.time = rq->time; + ++ /* ICCCM: 2.2. Responsibilities of the Selection Owner ++ * SelectionRequest: ++ * If the specified property is None , the requestor ++ * an obsolete client. Owners are encouraged ++ * to support these clients by using the specified ++ * target atom as the property name to be used for ++ * the reply. ++ */ ++ property = (rq->property == 0) ? rq->target : rq->property; + if (rq->target == r->h->xa[XA_TARGETS]) { + target_list[0] = (Atom32) r->h->xa[XA_TARGETS]; + target_list[1] = (Atom32) XA_STRING; +@@ -3539,7 +3549,7 @@ + #ifdef USE_XIM + target_list[3] = (Atom32) r->h->xa[XA_COMPOUND_TEXT]; + #endif +- XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_ATOM, ++ XChangeProperty(r->Xdisplay, rq->requestor, property, XA_ATOM, + (8 * sizeof(target_list[0])), PropModeReplace, + (unsigned char *)target_list, + (sizeof(target_list) / sizeof(target_list[0]))); +@@ -3547,10 +3557,10 @@ + } else if (rq->target == r->h->xa[XA_MULTIPLE]) { /* TODO: Handle MULTIPLE */ } else if (rq->target == r->h->xa[XA_TIMESTAMP] && r->selection.text) { - XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_INTEGER, +- XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_INTEGER, - (8 * sizeof(Time)), PropModeReplace, ++ XChangeProperty(r->Xdisplay, rq->requestor, property, XA_INTEGER, + 32, PropModeReplace, (unsigned char *)&r->h->selection_time, 1); - ev.property = rq->property; +- ev.property = rq->property; ++ ev.property = property; } else if (rq->target == XA_STRING + || rq->target == r->h->xa[XA_COMPOUND_TEXT] + || rq->target == r->h->xa[XA_TEXT]) { +@@ -3588,10 +3598,10 @@ + ct.value = (unsigned char *)cl[0]; + ct.nitems = selectlen; + } +- XChangeProperty(r->Xdisplay, rq->requestor, rq->property, ++ XChangeProperty(r->Xdisplay, rq->requestor, property, + target, 8, PropModeReplace, + ct.value, (int)ct.nitems); +- ev.property = rq->property; ++ ev.property = property; + #ifdef USE_XIM + if (freect) + XFree(ct.value); --- rxvt-devel-2.7.10_5.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: