Re: Adding support to sudo to open a file with elevated privileges
Piotr Dobrogost <[email protected]> Sun, 5 Sep 2021 17:26:06 +0200
| Newsgroups | gmane.comp.tools.sudo.user |
|---|---|
| Message-ID | <CAA6tFMvnZgmEq4pM32arKOcJykfvw+mUU7e1PxR7SjO_zPkohg@mail.gmail.com> |
On Sun, Sep 5, 2021 at 3:15 PM Ed Neville <[email protected]> wrote: > > That's something that I think it has already. You can use sudoedit to > write the file, but you need to set the EDITOR as tee or cat: > > <https://www.usenix.org.uk/content/sudo.html#safe-file-edits> > > echo "something" | EDITOR=/bin/tee sudoedit /etc/config_file >/dev/null Interesting. However I fail to see how it is better than simpler echo "something" | sudo /bin/tee /etc/config_file >/dev/null already mentioned as a suggested way of handling this? What you proposed still uses external binary (tee), still requires redirection of standard output and in addition uses additional features of sudo not required when using simpler form. Regards, Piotr Dobrogost ____________________________________________________________ sudo-users mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-users