diff options
Diffstat (limited to 'src/sp_execute.c')
| -rw-r--r-- | src/sp_execute.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sp_execute.c b/src/sp_execute.c index 20fe509..5cf139a 100644 --- a/src/sp_execute.c +++ b/src/sp_execute.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include "php_snuffleupagus.h" | 1 | #include "php_snuffleupagus.h" |
| 2 | |||
| 3 | #include <errno.h> | 2 | #include <errno.h> |
| 4 | #include <string.h> | 3 | #include <string.h> |
| 5 | 4 | ||
| @@ -14,6 +13,12 @@ static int (*orig_zend_stream_open)(const char *filename, | |||
| 14 | // FIXME handle symlink | 13 | // FIXME handle symlink |
| 15 | ZEND_COLD static inline void terminate_if_writable(const char *filename) { | 14 | ZEND_COLD static inline void terminate_if_writable(const char *filename) { |
| 16 | if (0 == access(filename, W_OK)) { | 15 | if (0 == access(filename, W_OK)) { |
| 16 | if (SNUFFLEUPAGUS_G(config).config_readonly_exec->dump) { | ||
| 17 | sp_log_request( | ||
| 18 | SNUFFLEUPAGUS_G(config).config_readonly_exec->dump, | ||
| 19 | SNUFFLEUPAGUS_G(config).config_readonly_exec->textual_representation, | ||
| 20 | SP_TOKEN_READONLY_EXEC); | ||
| 21 | } | ||
| 17 | if (true == SNUFFLEUPAGUS_G(config).config_readonly_exec->simulation) { | 22 | if (true == SNUFFLEUPAGUS_G(config).config_readonly_exec->simulation) { |
| 18 | sp_log_msg("readonly_exec", SP_LOG_SIMULATION, | 23 | sp_log_msg("readonly_exec", SP_LOG_SIMULATION, |
| 19 | "Attempted execution of a writable file (%s).", filename); | 24 | "Attempted execution of a writable file (%s).", filename); |
