diff options
Diffstat (limited to 'src/condition.c')
-rw-r--r-- | src/condition.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/condition.c b/src/condition.c index 76ee0370d2..f9202f6850 100644 --- a/src/condition.c +++ b/src/condition.c @@ -168,6 +168,15 @@ bool condition_test(Condition *c) { return !(k == -ENOENT || k > 0) == !c->negate; } + case CONDITION_FILE_IS_EXECUTABLE: { + struct stat st; + + if (lstat(c->parameter, &st) < 0) + return !c->negate; + + return (S_ISREG(st.st_mode) && (st.st_mode & 0111)) == !c->negate; + } + case CONDITION_KERNEL_COMMAND_LINE: return test_kernel_command_line(c->parameter) == !c->negate; |