Re: doas: add optional timeout to persist directive

Anthony BOCCI <[email protected]> Sat, 01 Aug 2026 20:48:37 +0000
Newsgroups gmane.os.openbsd.tech
Message-ID <xUzdvMhbSR6_fy4ddfpSgp65PjnF7M6EYtCQfSkm069_THM1DSutogbugG311CT01q00mLKxKTdFZsD3N4DUuMNN1lYcx5RjLUrPDdsJo8Y=@abosec.fr>
> With your diff, what happens if someone does?
>=20
> permit persist 329847983274983274983274983274asdfasdfadsflkjdsalkfafds :w=
heel

329847983274983274983274983274asdfasdfadsflkjdsalkfafds isn't a number,
so it is a syntax error.

> permit persist 30aaaaaa :wheel

Same here, syntax error, which makes sense too.

> +                       yylval.timeout =3D (int)timeout;
>
> On a 64-bit architecture what happens if someone passes
> a 2147483680

permit persist 2147483680 :wheel

throws a syntax error too, which is a problem.=20


To give more context, I don't set "persist" because 5 minutes is too
long for me, I'd like to enable it for a couple of seconds, typically
less than 30. This way I can type my command "doas this && doas that"
without typing my password twice, and without having to remember the
persistance.



Anthony