diff options
author | Thomas Voss <mail@thomasvoss.com> | 2022-11-14 22:00:02 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2022-11-14 22:00:02 +0100 |
commit | acc166876297a428705ffeb7c7ab61763d691585 (patch) | |
tree | 46df638503422110ce8878ba36b5eed9c9178a25 /doasedit.8 |
Initial commit
Diffstat (limited to 'doasedit.8')
-rw-r--r-- | doasedit.8 | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/doasedit.8 b/doasedit.8 new file mode 100644 index 0000000..2d2908d --- /dev/null +++ b/doasedit.8 @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2021 Jesse Smith <jessefrgsmith@yahoo.ca> +.\" Copyright (c) 2022 Thomas Voss <mail@thomasvoss.com> +.\" +.\" Permission to use, copy, modify, and distribute this software for +.\" any purpose with or without fee is hereby granted, provided that +.\" the above copyright notice and this permission notice appear in all +.\" copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +.\" WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +.\" AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA +.\" OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +.\" PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd November 14, 2022 +.Dt DOASEDIT 8 +.Os +.Sh NAME +.Nm doasedit +.Nd edit a text file with root access as a non-root user +.Sh SYNOPSIS +.Nm +.Ar file +.Sh DESCRIPTION +The +.Nm +utility opens an editor on a temporary copy of a text file. +Once the file has been altered, it is written back to the original location, +using doas for elevated access. +This is intended for use in editing configuration files where the user may need +to be root to edit a file, but does not wish to run their text editor as the +super user. +.Pp +The doasedit utility accepts one argument, the file to be edited. +The text editor used during the editing process is set using the VISUAL +environment variable. +If +.Ev VISUAL +is not set +.Ev EDITOR +is tried instead. +If both environment variables are not set then +.Xr vi(1) +is used as a fallback. +.Sh EXIT STATUS +.Ex -std +.Sh ENVIRONMENT +.Bl -tag -width Ds +.It Ev VISUAL +The editor to use to edit the target text file. +If the VISUAL variable is not set, then EDTIOR is used as a fallback. +.It Ev EDITOR +The editor to use to edit the target text file if VISUAL is not set. +If the EDITOR variable is not set, then the command +.Xr vi 1 +is used. +.El +.Sh SEE ALSO +.Xr doas 1 , +.Xr vi 1 , +.Xr doas.conf 5 , +.Xr vidoas 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +utility and manual page were originally written by +.An Jesse Smith Aq Mt jessefrgsmith@yahoo.ca , +but are now maintained by +.An Thomas Voss Aq Mt mail@thomasvoss.com . |