pinentry-dmenu

a pinentry program based on dmenu
git clone anongit@rnpnr.xyz:pinentry-dmenu.git
Log | Files | Refs | Feed | README | LICENSE

Commit: f826adcdcdf15115a37797ff4ca76bae43a2104e
Parent: 8aa7507ddf44fa47cf36e80cbc6fac48a64c631d
Author: Hiltjo Posthuma
Date:   Fri, 25 May 2018 12:04:22 +0200

Pledge on OpenBSD

Diffstat:
Mpinentry-dmenu.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/pinentry-dmenu.c b/pinentry-dmenu.c @@ -33,6 +33,11 @@ #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) #define MINDESCLEN 8 +#ifdef __OpenBSD__ +#include <unistd.h> +#else +#define pledge(a,b) 0 +#endif enum { SchemePrompt, SchemeNormal, SchemeSelect, SchemeDesc, SchemeLast }; enum { WinPin, WinConfirm }; @@ -678,6 +683,10 @@ cmdhandler(pinentry_t received_pinentry) { die("no fonts could be loaded."); } lrpad = drw->fonts->h; + + if (pledge("stdio rpath", NULL) < 0) + die("pledge"); + drw_setscheme(drw, scheme[SchemePrompt]); if (pinentry_info->timeout) {