unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: Olaf Rogalsky <olaf.rogalsky@t-online.de>,
	Emacs developers <emacs-devel@gnu.org>,
	Yuri Khan <yuri.v.khan@gmail.com>
Subject: Re: X selection access in xterm (OSC 52)
Date: Fri, 17 Apr 2015 09:52:30 -0400	[thread overview]
Message-ID: <jwvk2xayirh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAArVCkQcJOZAfrRheepkqWXiFD++ide+pHd_vYxJGPCvUqYx7w@mail.gmail.com> (Philipp Stephani's message of "Fri, 17 Apr 2015 06:29:13 +0000")

> If I understand https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=384593,
> this functionality was disabled by default on Debian-based systems for
> security reasons.

Ah, indeed I see in "man xterm" that allowWindowOps defaults to false
and that disallowedWindowOps includes both GetSelection and SetSelection.
If I try

   xterm -xrm '*.allowWindowOps: true'

Then things work.  Yay!

I don't see why SetSelection would be a serious security issue (tho
I guess if a program does the right SetSelection at the right time, you
could end up pasting dangerous commands into a shell).
For GetSelection, the problem can show up if you view "raw data" without
going though a pager, but if your terminal is busy running Emacs you're
safe ;-)

Hmm... these WindowOps really need to be fixed.  E.g. they could require
a secret key (à la xauth), so an attacker wouldn't be able to send the
right command.  But of course, that can't be fixed on Emacs's side.


        Stefan


> Philipp Stephani <p.stephani2@gmail.com> schrieb am Fr., 17. Apr. 2015 um
> 08:25 Uhr:

>> Maybe something needs to be enabled? The documentation says "These
>> controls may be disabled using the allowWindowOps resource." I'll try it
>> today.
>> 
>> Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Fr., 17. Apr. 2015
>> um 04:40 Uhr:
>> 
>>> Is that normal?  Do you guys see the same?  I'm using Debian's "xterm"
>>> package version 312-2, for what it's worth.
>>> 
>>> 
>>> Stefan
>>> 
>>> 
>>> >>>>> "Stefan" == Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>>> 
>>> >>> Yes, I took a look and I'll work on integrating the paste
>>> functionality.
>>> >>> Since cut and paste are mostly independent of each other, maybe you
>>> could
>>> >>> already integrate the cut patch?
>>> >> I just installed it (after adding a ChangeLog, and although it still
>>> >> lacks an etc/NEWS entry).
>>> 
>>> > BTW, I can't seem to make this feature work for me.  I do:
>>> 
>>> >    emacs -Q -nw
>>> >    M-x trace-function RET xterm--set-selection RET
>>> >    C-SPC M-f M-f M-f M-w
>>> >    <go to a previously running Emacs session in GUI mode>
>>> >    C-y
>>> 
>>> > and instead of getting the three words from *scratch*, I get whatever
>>> > was already there before in the clipboard.  Yet, the trace buffer shows
>>> > that xterm--set-selection was called alright (and edebugging it also
>>> > indicates that it seems to be doing what it should).
>>> 
>>> 
>>> >         Stefan
>>> 
>> 



  reply	other threads:[~2015-04-17 13:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 18:18 X selection access in xterm (OSC 52) Philipp Stephani
2015-02-08 18:43 ` Eli Zaretskii
2015-02-08 18:48   ` Philipp Stephani
2015-02-08 19:00 ` Stefan Monnier
2015-02-09  3:04 ` Yuri Khan
2015-02-09  4:23   ` Stefan Monnier
2015-02-09 16:05     ` Philipp Stephani
2015-02-09 17:12       ` Stefan Monnier
2015-02-10 10:30         ` Philipp Stephani
2015-02-27 19:44           ` Philipp Stephani
2015-03-13 22:08             ` Stefan Monnier
2015-03-15 18:33               ` Philipp Stephani
2015-03-16 13:29                 ` Stefan Monnier
2015-03-24 15:14                 ` Philipp Stephani
2015-03-24 21:55                   ` Stefan Monnier
2015-04-08 21:04                     ` Philipp Stephani
2015-04-09  2:10                       ` Stefan Monnier
2015-04-09 15:48                         ` Philipp Stephani
2015-04-09 18:47                           ` Philipp Stephani
2015-04-09 20:07                             ` Philipp Stephani
2015-04-13 14:57                           ` Stefan Monnier
2015-04-13 22:17                             ` Stefan Monnier
2015-04-17  2:40                               ` Stefan Monnier
2015-04-17  6:25                                 ` Philipp Stephani
2015-04-17  6:29                                   ` Philipp Stephani
2015-04-17 13:52                                     ` Stefan Monnier [this message]
2015-04-17 14:00                                       ` Philipp Stephani
2016-03-29 10:15                                         ` Philipp Stephani
2015-03-28 18:59                   ` Olaf Rogalsky
2015-03-29  3:39                     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk2xayirh.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=olaf.rogalsky@t-online.de \
    --cc=p.stephani2@gmail.com \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).