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

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

Comments

Projects
None yet
2 participants
@blueyed
Contributor

blueyed commented Nov 29, 2011

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Dec 5, 2011

Owner

Hi Daniel!

On Di, 29 Nov 2011, Daniel Hahler wrote:

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.

Interesting idea. I am not sure, there is a generic fix for that. I need
to talk with Charles (maintainer of netrw) about a feature like that.

regards,
Christian

Owner

chrisbra commented Dec 5, 2011

Hi Daniel!

On Di, 29 Nov 2011, Daniel Hahler wrote:

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.

Interesting idea. I am not sure, there is a generic fix for that. I need
to talk with Charles (maintainer of netrw) about a feature like that.

regards,
Christian

@chrisbra

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jan 4, 2012

Owner

Revision 0b1486f should contain support for using netrw writing.

Owner

chrisbra commented Jan 4, 2012

Revision 0b1486f should contain support for using netrw writing.

@blueyed

This comment has been minimized.

Show comment
Hide comment
@blueyed

blueyed Jan 9, 2012

Contributor

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.

Contributor

blueyed commented Jan 9, 2012

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Jan 9, 2012

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.

Owner

chrisbra commented Jan 9, 2012

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 Apr 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment