Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
Posted Oct 15, 2021 22:51 UTC (Fri) by JanC_ (guest, #34940)In reply to: Ubuntu 21.10 (Impish Indri) released by ibukanov
Parent article: Ubuntu 21.10 (Impish Indri) released
Posted Oct 16, 2021 2:19 UTC (Sat)
by rsidd (subscriber, #2582)
[Link] (17 responses)
I switched to wayland (sway) a few weeks ago, from i3, after a few false starts. In basically everything, either it just works, or there is a wayland equivalent that is actually better.
Two exceptions:
This is a 7 month old laptop running Ubuntu 21.04 since the start (beta version). I haven't yet updated to 21.10.
Posted Oct 16, 2021 4:44 UTC (Sat)
by NYKevin (subscriber, #129325)
[Link] (15 responses)
(Perhaps I should just drop gnome-terminal and switch to something which is not a GNOME app? I'm already on xfce so it wouldn't be that big of a deal anyway...)
Posted Oct 16, 2021 5:47 UTC (Sat)
by rsidd (subscriber, #2582)
[Link] (14 responses)
Posted Oct 17, 2021 3:32 UTC (Sun)
by NYKevin (subscriber, #129325)
[Link] (13 responses)
Actually, that's exactly what I want to do, except for two problems:
1. It's one-way.
If you enable X11 forwarding, then vim's quoteplus and quotestar registers directly map to your local X11 clipboards (CLIPBOARD and PRIMARY, respectively), and as vim registers, they are fully composable with everything you might reasonably want to do. But I don't think vim has code to deal with anything Wayland...? Regardless, Wayland has no equivalent to X11 forwarding (that I'm aware of), so it's a moot point.
> Also, on a vnc session with wayvnc (remote) and xtigervncviewer (local), copy-paste works from local to remote or vice versa. The vnc is blazing fast (seems much faster than x11vnc which I used earlier), and I can make it fullscreen and "pass through" my key strokes so that it feels exactly as if I am sitting at the remote machine.
SSH is low-dependency. When half the world has burned down, I can still SSH into my machine and fix things. Remote desktop applications, regardless of which one you want to use, are necessarily going to depend on additional infrastructure that has a higher chance of breaking or not being present (e.g. you can SSH into a headless machine). I care about this because I'm a Site Reliability Engineer, and worrying about "what if everything is down?" is a significant chunk of what they pay me to do.
Posted Oct 17, 2021 3:51 UTC (Sun)
by NYKevin (subscriber, #129325)
[Link] (5 responses)
It occurred to me that this is insufficiently explicit, so let me elaborate: If you use tmux with multiple panes, the obvious solution of "highlight the text you want to copy, then press Ctrl+Shift+C" doesn't work, because you'll get a bunch of extra whitespace and/or box-drawing characters thrown in, and for vertical panes, you might even copy part of another pane altogether. tmux does have a mostly-seamless workaround for this, but it too depends on X11 forwarding (so that it knows where the mouse is and can intercept mouse events).
Posted Oct 17, 2021 8:29 UTC (Sun)
by rsidd (subscriber, #2582)
[Link] (3 responses)
I think it is this sort of "power usage" case that wayland breaks.
Out of curiosity, how does tmux handle this if you run it in a TTY?
Posted Oct 17, 2021 9:21 UTC (Sun)
by NYKevin (subscriber, #129325)
[Link] (2 responses)
I'm not sure what you mean by this. I was able to come up with these interpretations, but none of them make sense to me:
* Run the tmux client under a virtual console (Ctrl+Alt+Fn) (because those are TTY1-N for some N depending on your system), or some other thing for which isatty(3) returns 1 (because a TTY is anything which isatty, right?). But tmux runs on the remote system, so it will generally be running under a pty created by sshd. Running it under something else isn't really a thing that I can reasonably do.
Posted Oct 17, 2021 14:44 UTC (Sun)
by bjartur (guest, #67801)
[Link] (1 responses)
Posted Oct 17, 2021 16:53 UTC (Sun)
by ballombe (subscriber, #9523)
[Link]
Posted Oct 18, 2021 1:09 UTC (Mon)
by mathstuf (subscriber, #69389)
[Link]
Posted Oct 17, 2021 15:02 UTC (Sun)
by shruggy (guest, #94695)
[Link] (6 responses)
For Wayland, that would be https://github.com/bugaevc/wl-clipboard
Posted Oct 17, 2021 16:42 UTC (Sun)
by ibukanov (subscriber, #3942)
[Link] (5 responses)
Obviously a naive implementation of the paste operation will be a security disaster since it will allow the remote system to read the local clipboard. This is probably a reason Gnome terminal has not yet implemented those sequences. But one can do reasonable compromises with usability/security for the paste and for copy there is really no excuses.
Posted Oct 17, 2021 19:03 UTC (Sun)
by NYKevin (subscriber, #129325)
[Link] (4 responses)
IMHO the correct way for this to work is for SSH to filter these sequences depending on a policy which the user can set, and gnome-terminal should blindly pass through anything which SSH gives it. My rationale:
1. In principle, SSH can already read the local system's clipboard anyway, because it is running on the local system. So gnome-terminal is not functioning as a security boundary in the first place. If we really wanted to, we could have SSH recognize and implement OSC 52 sequences behind gnome-terminal's back (but then SSH would need to be in the business of interfacing with X and Wayland, which is probably undesirable).
Posted Oct 17, 2021 19:29 UTC (Sun)
by ibukanov (subscriber, #3942)
[Link] (2 responses)
Posted Oct 18, 2021 1:22 UTC (Mon)
by NYKevin (subscriber, #129325)
[Link] (1 responses)
* The user is screwed anyway because they just executed malware. Malware can already steal your clipboard contents by other means, and do plenty of much nastier things besides.
We can argue until the cows come home about the proper way to implement this security boundary, but I think it's pretty clear that the answer is not "filter the codes out at the GUI terminal emulator on the local system."
Posted Oct 18, 2021 6:31 UTC (Mon)
by ibukanov (subscriber, #3942)
[Link]
Until such functionality is implemented in a terminal it is reasonable to implement it in a filtering application.
Posted Oct 18, 2021 15:24 UTC (Mon)
by foom (subscriber, #14868)
[Link]
Additionally, this is not simply an issue of SSH. There are numerous ways to get untrusted and unfiltered text printed to your terminal besides just ssh. E.g. "nc host", "cat file", "curl url", (or even "mpg123" per the GNOME issue linked earlier).
But, finally, your terminal emulator is indeed functioning as a security boundary these days. The expectation of (most) users is that printing arbitrary text to the terminal cannot materially affect the rest of the system, outside limited and well-defined aspects. (Clipboard access does seem like a reasonable candidate to be one of those, as long as it's under the user's control -- which is what the entire discussion on the gnome bug is about).
Historically, it was certainly not always the case that the terminal emulator authors considered the terminal emulator to be a security boundary (see, f.ex. the addition of the OSC 3 sequence to xterm back in 1999, which lets you set an arbitrary X property on the top-level xterm window!). There have been a variety of control sequences in xterm which had to be disabled in the intervening years, as part of that transition of expectations.
See e.g. these issues:
Fortunately when the OSC52 "get clipboard" sequence was invented, they decided to encode the contents with base64, which at least avoids the whole "remote command execution" set of issues.
Posted Nov 2, 2021 14:53 UTC (Tue)
by JanC_ (guest, #34940)
[Link]
You won't have issues with that when using Sway, I suppose, but e.g. under Gnome there are still regressions with window positioning in several applications when run on top of Wayland instead of Xorg.
And now people are pushing for another significant change again, which will almost certainly cause regressions for a while too, so acting surprised when some people want to hold off for a while shouldn't be surprising…
Posted Nov 18, 2021 8:25 UTC (Thu)
by daenzer (subscriber, #7050)
[Link]
I'm not sure how pipewire is related to wayland (except for video call screen sharing, where as noted elsewhere here, Ubuntu does use pipewire).
Ubuntu 21.10 (Impish Indri) released
Mainly, I don't know why, but resource usage seems noticeably less on sway/wayland, laptop runs cooler, battery lasts longer.
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
2. It's not easily composable with vim's put/yank/etc. operators, nor with its motions. You can sorta kinda get around this by using insert mode (using change instead of put), but you have to do :set paste if you actually want it to behave correctly, and frankly that's a PITA.
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
* Run the tmux server under such a thing. But the tmux server is not designed to have a controlling terminal at all, as far as I can tell anyway.
* Run SSH under a virtual console (Ctrl+Alt+Fn) which is not already being used to run X11/Wayland. But then you don't have a GUI at all, so regular copy/pasting is out of the question. You can still use copy-mode, of course, but that's entirely keyboard-controlled, and the "clipboard" lives entirely within tmux, so no GUI support is required.
* Run SSH under some other thing for which isatty(3) returns 1. But I can't figure out what that "other thing" would be.
* Pass the -t flag to SSH. I'm already doing that. IIRC tmux will flatly refuse to run if there's no controlling terminal, or if $TERM is not set.
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
Clipboard handling is one of the few areas where Neovim considerably differs from Vim. nvim relies on external providers for this: https://neovim.io/doc/user/provider.html#provider-clipboard
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
2. Any GUI app running on the local system (or, in the case of X11, any app which renders to the local X server, regardless of where the X client is running) can also read the clipboard more or less freely. If the user runs an app which steals the clipboard contents and uses them for nefarious purposes, we don't blame X or Wayland for allowing this. Running a local app inside of the terminal (such as SSH) should be no different.
3. SSH needs to do pty allocation etc., so it's already in the business of terminal emulation anyway. Adding OSC 52 filtering wouldn't be too much extra work.
4. SSH knows what host we're connected to. gnome-terminal probably doesn't.
5. This is how X11 forwarding has historically worked (consider -X vs. -Y). SSH is the security boundary, and the local terminal emulator is just responsible for rendering text to the screen.
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
* The app is trusted (not malware), but failed to implement an appropriate security boundary between the user and some untrusted system. Then this is a matter of the app's security model either being inadequate or not matching the user's desired security model. That's none of gnome-terminal's business.
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released
https://www.debian.org/security/2003/dsa-380 (remote command execution, via the combination of "set window title" followed by "get window title" printing the command back to a shell prompt.)
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510030 (same, via a DECRQSS parse-error similarly printing back the input text -- plus a variety of other badness).
Ubuntu 21.10 (Impish Indri) released
Ubuntu 21.10 (Impish Indri) released