Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Support for "sudo" via netrw's scp method #4

Closed
blueyed opened this Issue November 29, 2011 · 4 comments

2 participants

Daniel Hahler chrisbra
Daniel Hahler

When trying to ":SudoWrite" a file opened via the netrw plugin (e.g. "scp://host//etc/fstab"), it fails as follows:

Error detected while processing function SudoEdit#SudoDo:
line   17:
There was an error writing the file!

It would be great if SudoWrite could manage this by e.g. logging in via "ssh" and copy/write the file using sudo from there.

chrisbra
Owner
chrisbra
Owner

Revision 0b1486f should contain support for using netrw writing.

Daniel Hahler

This will just ask / allow for a different user before writing, doesn't it?

This is different from writing the file using "sudo".

What do you think about uploading a temporary file and moving it using sudo, similar to the local approach when "su" is being used?
This should get limited to the relevant netrw protocols like "scp" and "sftp" probably.

chrisbra
Owner

Yes, the idea was to simply upload as the priviliged user.
How else would you want to use sudo over a remote system? If you use sftp/scp that doesn't mean, you can execute arbitrary commands like mv'ing a temporary file to its final destination. Well, we could try it, but if it doesn't work, we are possibly littering the remote system. I am not sure, that is a solution.

chrisbra chrisbra closed this April 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.