Re: Adding support to sudo to open a file with elevated privileges
Tim Bradshaw <[email protected]> Sun, 5 Sep 2021 21:21:31 +0100
| Newsgroups | gmane.comp.tools.sudo.user |
|---|---|
| Message-ID | <[email protected]> |
> > On 4 Sep 2021, at 12:51, Piotr Dobrogost <[email protected]> wrote: > > Something along the lines of > echo "something" | sudo --out /etc/config_file You'd certainly need a whole additional rule syntax for something like that: which files is sudo allowed to write to; does it append, overwrite or both (both should certainly be options); what happens when the write fails (the original file must be left untouched at all costs) and so on. Of course tee / cat are unlikely to do that either: almost certainly the answer is a tool which does, which can then just be used in ordinary sudo rules: 'echo ... | sudo fwrite -a /etc/config_file' --tim ____________________________________________________________ sudo-users mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-users