Issue metadata
Sign in to add a comment
|
pasting text into password field doesn't work |
||||||||||||||||||||||
Issue descriptionafter the changes to rework ttys, pasting early on doesn't work https://chromium-review.googlesource.com/257080 https://chromium-review.googlesource.com/256129 both before & after, this code fires: nassh.CommandInstance.prototype.sendString_ = function(string) { this.sendToPlugin_('onRead', [0, btoa(string)]); }; but doesn't look like the plugin reacts to it the same. probably related, but it looks like we also get for early keystrokes this warning too: plugin log: onWriteAcknowledge: for unknown file descriptor but the keystrokes are making it across ...
,
Mar 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/apps/libapps/+/dd31dd8233662170ec893afc1bb3bbda5274e779 commit dd31dd8233662170ec893afc1bb3bbda5274e779 Author: Mike Frysinger <vapier@chromium.org> Date: Tue Mar 28 21:36:34 2017 nassh: send pasted input to the input buffer After the tty rewrite, we can't send all input to fd 0 anymore as the stdin and tty fds have been split. When ssh asks for data on the tty port, pasting it to fd 0 (stdin) means it gets queued. Instead, send the paste output to the new input stream so it gets routed properly. BUG= chromium:705155 TEST=pasted & typed into password field and it worked TEST=pasted & typed into ssh after connecting and it worked Change-Id: I990abea3246970a077daf1235064a8a3742030a1 Reviewed-on: https://chromium-review.googlesource.com/461558 Reviewed-by: Rob Ginda <rginda@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/dd31dd8233662170ec893afc1bb3bbda5274e779/nassh/js/nassh_command_instance.js
,
Mar 28 2017
this is fixed in 0.8.35.6 now
,
Apr 24 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by vapier@chromium.org
, Mar 28 2017the issue is due to how the streams are being piped. in the old plugin, we'd always write to fd 0 for /dev/stdin and for /dev/tty. in the new plugin, /dev/stdin is 0 but /dev/tty is 101. normal keystrokes work because when the plugin sends the JS code the read() request, it tells us which fd to respond on: nassh.CommandInstance.prototype.onPlugin_.read = function(fd, size) { var stream = this.streams_.getStreamByFd(fd); if (!stream) { console.warn('Attempt to read from unknown fd: ' + fd); return; } stream.asyncRead(size, (b64bytes) => { this.sendToPlugin_('onRead', [fd, b64bytes]); }); }; the plugin is requesting /dev/tty which is fd 101, so that's what we send each keystroke back to. however, when we do a paste, we don't hit this code path ... we instead hit the nassh.CommandInstance.prototype.sendString_ which has fd 0 hardcoded. since the plugin isn't reading that fd, it gets ignored. once we finish the handshaking, ssh reads from /dev/stdin all the time, so both code paths happen to work fine (for the most part -- it looks like we kind of desync in the i/o layers here, but maybe in practice it doesn't matter?).