From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: X selection access in xterm (OSC 52) Date: Thu, 09 Apr 2015 20:07:18 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8f646ff3f160e4051350312b X-Trace: ger.gmane.org 1428610069 1936 80.91.229.3 (9 Apr 2015 20:07:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Apr 2015 20:07:49 +0000 (UTC) Cc: Olaf Rogalsky , Emacs developers , Yuri Khan To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 09 22:07:46 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YgIjn-0007YC-2Y for ged-emacs-devel@m.gmane.org; Thu, 09 Apr 2015 22:07:43 +0200 Original-Received: from localhost ([::1]:36405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgIjm-0000uu-2m for ged-emacs-devel@m.gmane.org; Thu, 09 Apr 2015 16:07:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgIjR-0000rL-Ib for emacs-devel@gnu.org; Thu, 09 Apr 2015 16:07:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgIjQ-0004L2-IL for emacs-devel@gnu.org; Thu, 09 Apr 2015 16:07:21 -0400 Original-Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:35929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgIjQ-0004Kt-8Z for emacs-devel@gnu.org; Thu, 09 Apr 2015 16:07:20 -0400 Original-Received: by wgsk9 with SMTP id k9so108981271wgs.3 for ; Thu, 09 Apr 2015 13:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=PVZgkox3piOQXoXZP1kY1e2ll7byInQJ6+YoRQ3aW/w=; b=y4Y130W0nuiCQXJ/GZtO/ENZ+OYJxH3qoD8lddA4cAwMx5OEF64P5Qrm9PR75xtB+s VUE99BE/7gPIALmDFi0TzZnBPgEHwdWS0uId2BmcTj3N6Eih65u5LLQghyNQgqCIMfhG mJqfUJQ12VaXEzkVi4Sc4/UbOyYioqBsfQgr19H4cccs23ZiBxJCibrw3J0L4apRHQXS iU3mOXC4fWkzOpH0WLOJoS68xzc99VDqLAu6xI66QEhUV2NfZmAp/5PvR1/FguRS9c6C 6NHRdT0gFl3wO2i4GigiAghKkO3JU7/7kbPH+XhOUazDMYHowYsxvgullLy8WDYs7T8R LbrA== X-Received: by 10.180.37.101 with SMTP id x5mr7803727wij.74.1428610039643; Thu, 09 Apr 2015 13:07:19 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185232 Archived-At: --e89a8f646ff3f160e4051350312b Content-Type: multipart/alternative; boundary=e89a8f646ff3f160df0513503129 --e89a8f646ff3f160df0513503129 Content-Type: text/plain; charset=UTF-8 Philipp Stephani schrieb am Do., 9. Apr. 2015 um 20:47 Uhr: > I took a second look at HTerm, and found that its FAQ ( > http://git.chromium.org/gitweb/?p=chromiumos/platform/assets.git;a=blob;f=chromeapps/nassh/doc/faq.txt) > states: > > "Clipboard read is not implemented. Reading is a security hole you > probably didn't want anyway." > > Since I can't test the get-selection function and it's considered a > security hole, I'm afraid I can't implement it. > This only affects get-selection, not set-selection. > FWIW, here's my WIP patch for gui-get-selection, in case anybody wants to implement this. It differs from Olaf's code mainly in using a temp buffer and the existing xterm--query helper function. --e89a8f646ff3f160df0513503129 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Philipp Stephani <p.stephani2@gmail.com> schrie= b am Do., 9. Apr. 2015 um 20:47=C2=A0Uhr:
I took a second look at HTerm, and found that its FAQ (http://git.ch= romium.org/gitweb/?p=3Dchromiumos/platform/assets.git;a=3Dblob;f=3Dchromeap= ps/nassh/doc/faq.txt) states:

"Clipboard read is not implem= ented.=C2=A0 Reading is a security hole you probably=C2=A0didn't want anyway."

=
Since I can't test the get-selection function and it's consider= ed a security hole, I'm afraid I can't implement it.
This only a= ffects get-selection, not set-selection.

FWIW, here's my WIP patch for gui-get-selection, in ca= se anybody wants to implement this. It differs from Olaf's code mainly = in using a temp buffer and the existing xterm--query helper function.=C2=A0=
--e89a8f646ff3f160df0513503129-- --e89a8f646ff3f160e4051350312b Content-Type: application/octet-stream; name="0001-Implement-OSC-52-functionality-for-getting-the-X-sel.patch" Content-Disposition: attachment; filename="0001-Implement-OSC-52-functionality-for-getting-the-X-sel.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 14c9fcb14307b3324681 RnJvbSBmMGFmNmRlYTU1OWUwMDBjOTA4NzNmMzBjMjk0YWU2Y2U5YTU5MjJhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh dGU6IFRodSwgOSBBcHIgMjAxNSAyMjowNToxOSArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIEltcGxl bWVudCBPU0MtNTIg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gICAgICAoeHRlcm0gKGVxIGlu aXQtZnVuY3Rpb24gJ3Rlcm1pbmFsLWluaXQteHRlcm0pKQorICAgICAgICAgKHNjcmVlbiAoZXEg aW5pdC1mdW5jdGlvbiAndGVybWluYWwtaW5pdC1zY3JlZW4pKSkKKyAgICA7OyBPbmx5IGRvIHNv bWV0aGluZyBpZiB0aGUgY3VycmVudCB0ZXJtaW5hbCBpcyBhY3R1YWxseSBhbiBYVGVybQorICAg IDs7IG9yIHNjcmVlbi4KKyAgICAod2hlbiAob3IgeHRlcm0gc2NyZWVuKQorICAgICAgKGxldCAo KHF1ZXJ5IChjb25jYXQKKyAgICAgICAgICAgICAgICAgICAgIlxlXTUyOyIKKyAgICAgICAgICAg ICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAgICAgICAgICgoZXEgdHlwZSAnUFJJTUFSWSkg InAiKQorICAgICAgICAgICAgICAgICAgICAgKChlcSB0eXBlICdDTElQQk9BUkQpICJjIikKKyAg ICAgICAgICAgICAgICAgICAgICh0IChlcnJvciAiSW52YWxpZCB0eXBlICVTIiB0eXBlKSkpCisg ICAgICAgICAgICAgICAgICAgICI7IikpKQorICAgICAgICAod2l0aC10ZW1wLWJ1ZmZlcgorICAg ICAgICAgICh4dGVybS0tcXVlcnkKKyAgICAgICAgICAgKGNvbmNhdCAod2hlbiBzY3JlZW4gIlxl UCIpIHF1ZXJ5ICI/XGEiICh3aGVuIHNjcmVlbiAiXGVcXCIpKQorICAgICAgICAgICAobGlzdCAo Y29ucyBxdWVyeSAobGFtYmRhICgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHdo aWxlIChsZXQgKChjaGFyIChyZWFkLWNoYXIpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAodW5sZXNzIChlcSBjaGFyID9cYSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChpbnNlcnQgY2hhcikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHQpKSkpKSkpCisgICAgICAgICAgKGJhc2U2NC1kZWNvZGUt cmVnaW9uIChwb2ludC1taW4pIChwb2ludC1tYXgpKQorICAgICAgICAgIChidWZmZXItc3Vic3Ry aW5nLW5vLXByb3BlcnRpZXMgKHBvaW50LW1pbikgKHBvaW50LW1heCkpKSkpKSkKKwogKGRlZnVu IHh0ZXJtLS1zZXQtc2VsZWN0aW9uICh0eXBlIGRhdGEpCiAgICJDb3B5IERBVEEgdG8gdGhlIFgg c2VsZWN0aW9uIHVzaW5nIHRoZSBPU0MgNTIgZXNjYXBlIHNlcXVlbmNlLgogCi0tIAoyLjMuNQoK --e89a8f646ff3f160e4051350312b--