From 7027a83b4c98ddaf94c4621e0ee55020e17779e3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 2 Jun 2012 01:56:28 +0100 Subject: [PATCH 1/1] introduce checkexecflagfile --- helper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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