Skip to content

N0tAI/doasedit

Repository files navigation

Doasedit

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).

Usage

doasedit [-C[x]] [-nh] [-e[ ]<editor>] [-u[ ]<user>] <path/to/file>

Options

  • n: Run doas in non-interactive mode
  • e: 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.

Environment Variables

DOAS_EDITOR: The editor to use for this file.

Exit Status

If doas fails, doasedit will forward it's exit code. Refer to the OpenDoas Man Page for reasons why and specific meanings.

Features

  • 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 the DOAS_EDITOR variable)
  • Sane editor detection Leveraging the VISUAL and EDITOR variables 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

Building

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.

About

sudoedit for doas users

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published