Note doasedit is currently incomplete (unusable) do not try to use it right now
Doasedit is a sudoedit replacement written for Duncaen/OpenDoas written for posix compliant scripting environments. It uses a co-process to handle the entire request with a single doas invocation (as opposed to most applications requiring multiple invocations).
doasedit [-C[x]] [-nh] [-e[ ]<editor>] [-u[ ]<user>] <path/to/file>
n: Run doas in non-interactive modee: The editor to use for this file.u: The user doas will switch to, defaults to root. Must be in a format supported by doas.h: Show usage page and exit.C: No opt.Cx: Disable doas configuration validation.
Note that options always override environment variables. If editor is set to empty via the command line this will cause the environment variable to be ignored.
DOAS_EDITOR: The editor to use for this file.
If doas fails, doasedit will forward it's exit code. Refer to the OpenDoas Man Page for reasons why and specific meanings.
- A single doas invocation to edit and replace a file
- Only ever one password prompt (no configuration required)
- Choose your own editor and options (via the
-eoption or theDOAS_EDITORvariable) - Sane editor detection
Leveraging the
VISUALandEDITORvariables to set your editor - Restrict allowed editors via
/etc/doasedit.conf - Configure editor sand boxing via
/etc/doasedit.conf - Entire program contained in a single script file
To build all you have to do is run make install with the proper privileges and make will take care of the rest, I've tried to follow the GNU Makefile conventions as much as I found it applicable, so you should be able to configure the build like other projects.