From: Ian Jackson Date: Sat, 2 Jun 2012 00:56:28 +0000 (+0100) Subject: introduce checkexecflagfile X-Git-Tag: debian/2.0.0~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=7027a83b4c98ddaf94c4621e0ee55020e17779e3;p=authbind.git introduce checkexecflagfile --- diff --git a/helper.c b/helper.c index c3133eb..0841cd2 100644 --- a/helper.c +++ b/helper.c @@ -62,6 +62,11 @@ static void authorised(void) { else _exit(0); } +static void checkexecflagfile(const char *file) { + if (!access(file,X_OK)) authorised(); + if (errno != ENOENT) exiterrno(errno); +} + static void hex2bytes(const char *string, unsigned char *out, int len) { int i; for (i=0; i