New issue
Advanced search Search tips

Issue 722175 link

Starred by 0 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

nassh: add a sftp cli client

Project Member Reported by vapier@chromium.org, May 15 2017

Issue description

we've got sftp support in CrOS to provide mounts to the Files app, but this makes it a pain to test changes from other systems.  a sftp cli would help a lot here, and it would be useful in its own right.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/995c1de5cb24eeae63fcfae9444bc078929c55d9

commit 995c1de5cb24eeae63fcfae9444bc078929c55d9
Author: Mike Frysinger <vapier@chromium.org>
Date: Wed May 17 18:09:00 2017

libdot: add a rpad helper

This compliments the lpad helper.  Not used just yet, but a later
CL uses it to pad strings to align them in output.

BUG=chromium:722175

Change-Id: Ib2cca8c7a5926a6221c9baed4d5fa364e76c1fb5
Reviewed-on: https://chromium-review.googlesource.com/505390
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/995c1de5cb24eeae63fcfae9444bc078929c55d9/libdot/js/lib_f_tests.js
[modify] https://crrev.com/995c1de5cb24eeae63fcfae9444bc078929c55d9/libdot/js/lib_f.js

Project Member

Comment 2 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/995c1de5cb24eeae63fcfae9444bc078929c55d9

commit 995c1de5cb24eeae63fcfae9444bc078929c55d9
Author: Mike Frysinger <vapier@chromium.org>
Date: Wed May 17 18:09:00 2017

libdot: add a rpad helper

This compliments the lpad helper.  Not used just yet, but a later
CL uses it to pad strings to align them in output.

BUG=chromium:722175

Change-Id: Ib2cca8c7a5926a6221c9baed4d5fa364e76c1fb5
Reviewed-on: https://chromium-review.googlesource.com/505390
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/995c1de5cb24eeae63fcfae9444bc078929c55d9/libdot/js/lib_f_tests.js
[modify] https://crrev.com/995c1de5cb24eeae63fcfae9444bc078929c55d9/libdot/js/lib_f.js

Project Member

Comment 3 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/af1afc8e8b0c7f7557176fdfd8446f566493292e

commit af1afc8e8b0c7f7557176fdfd8446f566493292e
Author: Mike Frysinger <vapier@chromium.org>
Date: Thu May 18 02:05:37 2017

nassh: sftp: fill out the client API

Implement callbacks for all of the packet types.  We don't use them just
yet, but they're logically standalone, so split them into a dedicated CL.

BUG=chromium:722175

Change-Id: I9b0911ce3fcda06f632be2ae4e23708da8f4e87b
Reviewed-on: https://chromium-review.googlesource.com/505554
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/af1afc8e8b0c7f7557176fdfd8446f566493292e/nassh/js/nassh_sftp_client.js

Project Member

Comment 4 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/11b5ec2416fa9e2462e5e265aaa4f4f61dc1fe32

commit 11b5ec2416fa9e2462e5e265aaa4f4f61dc1fe32
Author: Mike Frysinger <vapier@chromium.org>
Date: Thu May 18 02:08:18 2017

nassh: sftp: support setting file attributes

Create proper constants for the various file attributes as defined in
the SFTP spec.  Then add some helpers for SETSTAT/FSETSTAT packets.
This is useful for chown and chgrp type calls.

BUG=chromium:722175

Change-Id: I08a5f53eeb7515d2510bdaa1667637bebf8eab21
Reviewed-on: https://chromium-review.googlesource.com/505869
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/11b5ec2416fa9e2462e5e265aaa4f4f61dc1fe32/nassh/js/nassh_sftp_packet_types.js
[modify] https://crrev.com/11b5ec2416fa9e2462e5e265aaa4f4f61dc1fe32/nassh/js/nassh_sftp_client.js

Project Member

Comment 5 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/de0222d420d363264b33dbe315ab164efaac648c

commit de0222d420d363264b33dbe315ab164efaac648c
Author: Mike Frysinger <vapier@chromium.org>
Date: Thu May 18 02:08:30 2017

nassh: sftp: add defines for open flags

Rather than inline the bits, create proper constants from the SFTP spec.

BUG=chromium:722175

Change-Id: I87e40d3fc2f1ea7eb5adbc5907e2e266c62afae2
Reviewed-on: https://chromium-review.googlesource.com/505571
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/de0222d420d363264b33dbe315ab164efaac648c/nassh/js/nassh_sftp_packet_types.js
[modify] https://crrev.com/de0222d420d363264b33dbe315ab164efaac648c/nassh/js/nassh_sftp_fsp.js

Project Member

Comment 6 by bugdroid1@chromium.org, May 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/042a3492697b8408c3e85c3e1e96187973253947

commit 042a3492697b8408c3e85c3e1e96187973253947
Author: Mike Frysinger <vapier@chromium.org>
Date: Mon May 22 20:20:02 2017

nassh: sftp: promote version constant

This makes it a bit more visible which version of the protocol we support.

BUG=chromium:722175

Change-Id: Ic4cf5c13de8c69ea169044ff7fddfd658d632686
Reviewed-on: https://chromium-review.googlesource.com/507989
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/042a3492697b8408c3e85c3e1e96187973253947/nassh/js/nassh_sftp_client.js

Project Member

Comment 7 by bugdroid1@chromium.org, May 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/53164360bebd0c4e11ec8ef4df25589a65e0990b

commit 53164360bebd0c4e11ec8ef4df25589a65e0990b
Author: Mike Frysinger <vapier@chromium.org>
Date: Mon May 22 20:21:03 2017

nassh: sftp: add constants for status codes

Add proper constants for all the status codes rather than inline them.

BUG=chromium:722175

Change-Id: I6c8e0768793d4fbe2b1ced90f73399848d4ba131
Reviewed-on: https://chromium-review.googlesource.com/508412
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/53164360bebd0c4e11ec8ef4df25589a65e0990b/nassh/js/nassh_sftp_packet_types.js
[modify] https://crrev.com/53164360bebd0c4e11ec8ef4df25589a65e0990b/nassh/js/nassh_sftp_fsp.js
[modify] https://crrev.com/53164360bebd0c4e11ec8ef4df25589a65e0990b/nassh/js/nassh_sftp_client.js

Project Member

Comment 8 by bugdroid1@chromium.org, May 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/96debda0c01a4d9fb67c9e523029958638b2ad5d

commit 96debda0c01a4d9fb67c9e523029958638b2ad5d
Author: Mike Frysinger <vapier@chromium.org>
Date: Mon May 22 21:05:16 2017

nassh: sftp: add helpers for permission/date fields

This makes it easier to decode stat packets.

BUG=chromium:722175

Change-Id: I2c769ae8c77acd16fec92b8aa3c7a02cf3d0feb0
Reviewed-on: https://chromium-review.googlesource.com/508331
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/96debda0c01a4d9fb67c9e523029958638b2ad5d/nassh/js/nassh_sftp_packet_types.js

Project Member

Comment 9 by bugdroid1@chromium.org, Jan 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/66301af6064df0770902722fd65f3c02e96f6be0

commit 66301af6064df0770902722fd65f3c02e96f6be0
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue Jan 16 21:24:27 2018

nassh: sftp: document the source a bit more

BUG=chromium:722175

Change-Id: I56765e38aa49243fa3404108533e00449b6ced98
Reviewed-on: https://chromium-review.googlesource.com/867253
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/66301af6064df0770902722fd65f3c02e96f6be0/nassh/doc/hack.md

Project Member

Comment 10 by bugdroid1@chromium.org, Jan 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/02da6e0e9e27bf6594e7723c5e90e11c717e4bbf

commit 02da6e0e9e27bf6594e7723c5e90e11c717e4bbf
Author: Mike Frysinger <vapier@chromium.org>
Date: Thu Jan 25 19:38:22 2018

nassh: unify params object setup

We duplicate the logic to extract all the prefs settings and turn it into
a params object that the connectTo function expects.  Before we duplicate
it again, create a helper to do this grunt work.

BUG=chromium:722175

Change-Id: Ifc256a5958d0f20b6c12d1e9ac832c2ae72d2660
Reviewed-on: https://chromium-review.googlesource.com/867254
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/02da6e0e9e27bf6594e7723c5e90e11c717e4bbf/nassh/js/nassh_command_instance.js

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 24

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/5f46ece66bbb9fe4fea146dd17f409ea25be0afc

commit 5f46ece66bbb9fe4fea146dd17f409ea25be0afc
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue Jul 24 21:42:28 2018

nassh: make registerProtocolHandler a bit more flexible

In preparation for handling more protocols (like sftp),
make this function a bit more flexible.

Bug: 722175
Change-Id: I12db88ca65869e4ea672b1cf841894797d8c280a
Reviewed-on: https://chromium-review.googlesource.com/1137979
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/5f46ece66bbb9fe4fea146dd17f409ea25be0afc/nassh/js/nassh_connect_dialog.js
[modify] https://crrev.com/5f46ece66bbb9fe4fea146dd17f409ea25be0afc/nassh/js/nassh.js

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 25

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/1d25e822a42a63794903bd6633e275709cbbe2f3

commit 1d25e822a42a63794903bd6633e275709cbbe2f3
Author: Mike Frysinger <vapier@chromium.org>
Date: Wed Jul 25 05:27:45 2018

nassh: unify profile based connection setup

For all our profiled based connection functions, they go through the same
form for setup before handing things off to the next phase.  Unify it in
a new helper so we can re-use it for more connection types.

Bug: 722175
Change-Id: Id35f664823094dadffa8e2be8694b10a0da2295c
Reviewed-on: https://chromium-review.googlesource.com/1137977
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/1d25e822a42a63794903bd6633e275709cbbe2f3/nassh/js/nassh_command_instance.js

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 25

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/b59638175f72165fbb8cc834ce6fb5977bf55820

commit b59638175f72165fbb8cc834ce6fb5977bf55820
Author: Mike Frysinger <vapier@chromium.org>
Date: Wed Jul 25 05:46:53 2018

nassh: fsp: split mount logic into sep knob

Rather than always assume sftp==mount, add a new isMount knob for all the
mount related bits that is independent of isSftp.  This way we can setup
sftp connections unrelated to mounting.

Bug: 722175
Change-Id: I160bbfd6ce643e202ae35f1baeef5de51aa924f0
Reviewed-on: https://chromium-review.googlesource.com/1137978
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b59638175f72165fbb8cc834ce6fb5977bf55820/nassh/js/nassh_command_instance.js

Project Member

Comment 14 by bugdroid1@chromium.org, Oct 18

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/ecce13b1bacf483235c69eeaffeb014a1a141467

commit ecce13b1bacf483235c69eeaffeb014a1a141467
Author: Mike Frysinger <vapier@chromium.org>
Date: Thu Oct 18 06:43:24 2018

nassh: sftp: improve server version packet parsing

The version packet from the server can be parsed like any other
response packet, other than the fact that requestId is not set.
Since we're already stuffing the pendingRequests_ with 'init' as
a fake requestId, lets use that in our version packets too.

This lets us drop the custom VERSION check in the onPacket call.

While we're here, lets parse out the optional extensions the
server might send over in its VERSION response.

Bug: chromium:722175
Change-Id: I7c20b49f3e37aaa00767ea68674fffb8dda0a429
Reviewed-on: https://chromium-review.googlesource.com/c/1286249
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ecce13b1bacf483235c69eeaffeb014a1a141467/nassh/js/nassh_sftp_packet.js
[modify] https://crrev.com/ecce13b1bacf483235c69eeaffeb014a1a141467/nassh/js/nassh_sftp_packet_types.js
[modify] https://crrev.com/ecce13b1bacf483235c69eeaffeb014a1a141467/nassh/js/nassh_sftp_client.js

Sign in to add a comment