Fixed potential crash on Linux when target user is not

one of the valid users listed in doas.conf.
This commit is contained in:
Jesse Smith 2019-09-03 17:36:04 -03:00
parent 1c2858c681
commit 7007ce8ebd

5
doas.c
View file

@ -76,7 +76,10 @@ usage(void)
void
errc(int eval, int code, const char *format)
{
fprintf(stderr, "%s", format);
if (format)
fprintf(stderr, "%s", format);
else
fprintf(stderr, "doas: Permission error encountered. Your user may not have access to perform this action.\n");
exit(code);
}
#endif