From bdd2cfc430d4b841c24a6c08e7934d667bdc6637 Mon Sep 17 00:00:00 2001 From: kkadosh Date: Fri, 2 Mar 2018 13:31:36 +0000 Subject: Implement dump() for execution of writable PHP files --- src/sp_execute.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sp_execute.c') 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 @@ #include "php_snuffleupagus.h" - #include #include @@ -14,6 +13,12 @@ static int (*orig_zend_stream_open)(const char *filename, // FIXME handle symlink ZEND_COLD static inline void terminate_if_writable(const char *filename) { if (0 == access(filename, W_OK)) { + if (SNUFFLEUPAGUS_G(config).config_readonly_exec->dump) { + sp_log_request( + SNUFFLEUPAGUS_G(config).config_readonly_exec->dump, + SNUFFLEUPAGUS_G(config).config_readonly_exec->textual_representation, + SP_TOKEN_READONLY_EXEC); + } if (true == SNUFFLEUPAGUS_G(config).config_readonly_exec->simulation) { sp_log_msg("readonly_exec", SP_LOG_SIMULATION, "Attempted execution of a writable file (%s).", filename); -- cgit v1.3