doas(1) currently states:
-clip-
EXIT STATUS
     The doas utility exits 0 on success, and >0 if an error occurs.  It may
     fail for one of the following reasons:

     o   The config file /etc/doas.conf could not be parsed.
     o   The user attempted to run a command which is not permitted.
     o   The password was incorrect.
     o   The specified command was not found or is not executable.
-clip-
This is incorrect, doas returns the exit status of command as in:
-clip-
$ doas false && echo "was true"
-no output-

$ doas true && echo "was true"
was true
-clip-

Manpage amended, to be like nice(1).

Patch below:

Index: usr.bin/doas/doas.1
===================================================================
RCS file: /cvs/src/usr.bin/doas/doas.1,v
retrieving revision 1.19
diff -u -r1.19 doas.1
--- usr.bin/doas/doas.1 4 Sep 2016 15:20:37 -0000       1.19
+++ usr.bin/doas/doas.1 12 Oct 2018 07:36:29 -0000
@@ -87,8 +87,8 @@
 The default is root.
 .El
 .Sh EXIT STATUS
-.Ex -std doas
-It may fail for one of the following reasons:
+.Nm
+may fail for one of the following reasons:
 .Pp
 .Bl -bullet -compact
 .It
@@ -102,6 +102,11 @@
 .It
 The specified command was not found or is not executable.
 .El
+.Pp
+Otherwise, the exit status of
+.Nm
+shall be that of
+.Ar command .
 .Sh SEE ALSO
 .Xr su 1 ,
 .Xr doas.conf 5



-- 

Reply via email to