I'm using doas for privilege escalation together with a command-line program that calls into either sudo or doas (OpenDoas on Linux, this program does not support BSDs) for authentication when it needs to do something privileged. While it works well with sudo, with doas I've run into the problem that if I type my password wrong a single time, the program crashes because doas reports the authentication as having failed immediately. With sudo, this isn't an issue as it gives me multiple attempts at entering my password, so the program doesn't crash just because I typed my password wrong once.
You might argue that it is the program that's at fault here, but I think it's reasonable for the program to crash like this. I don't think the program calling doas can know for certain why doas set its exit code to 1, and if it is something other than a password being typed wrong, it doesn't make any sense to try to repeat authentication. The doas manpage lists a number of reasons why the error code can be greater than 0, but doesn't assign any particular values to particular errors, so my understanding seems to align with the documentation.
With that in mind, is there any way to configure doas to allow multiple password authentication attempts?
doas(the original, that is), allows for 3 retries (not configurable, unless you recompile, a feature added four years ago). I'm assuming you're using a port of that code that isn't up to date with the OpenBSD version?doas, is it correct if we assume you're working on openbsd? If it is, please do add the openbsd tag to your question (or at least state your operating system and version of it in your question).