aboutsummaryrefslogtreecommitdiff
path: root/src/librc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-04 16:26:44 +0000
committerRoy Marples <roy@marples.name>2007-10-04 16:26:44 +0000
commite2e40afddef5253d5d669002b9afbea6bf3d6c66 (patch)
tree41314af54291fc3358361132463307a4b0da9d20 /src/librc.c
parentd65c484f3a1b210048045613c524c29fdfcb470c (diff)
punt rc_is_exec
Diffstat (limited to 'src/librc.c')
-rw-r--r--src/librc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/librc.c b/src/librc.c
index dcbc9872..58f450da 100644
--- a/src/librc.c
+++ b/src/librc.c
@@ -15,6 +15,10 @@
#define SOFTLEVEL RC_SVCDIR "/softlevel"
+#ifndef S_IXUGO
+# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
+#endif
+
/* File stream used for plugins to write environ vars to */
FILE *rc_environ_fd = NULL;
@@ -173,6 +177,7 @@ bool rc_service_exists (const char *service)
char *file;
bool retval = false;
int len;
+ struct stat buf;
if (! service)
return (false);
@@ -185,9 +190,9 @@ bool rc_service_exists (const char *service)
service[len - 1] == 'h')
return (false);
- file = rc_service_resolve (service);
- if (rc_exists (file))
- retval = rc_is_exec (file);
+ file = rc_service_resolve (service);
+ if (stat (file, &buf) == 0 && buf.st_mode & S_IXUGO)
+ retval = true;
free (file);
return (retval);
}