1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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 .
|