summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2023-04-12 23:43:04 +0200
committerjvoisin2023-04-12 23:43:04 +0200
commit62c3dd33f4e2edbdee89888f613f10cb961092ec (patch)
tree224d4135f45c6c9a01b1724f5410cf40a2429ee7
parentf428f7891eb0ba4649ce6b878aa887f6120a37e6 (diff)
Make readonly_exec play nice on readonly filesystems
-rw-r--r--src/sp_execute.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_execute.c b/src/sp_execute.c
index 300d05c..6e80b6d 100644
--- a/src/sp_execute.c
+++ b/src/sp_execute.c
@@ -19,7 +19,7 @@ ZEND_COLD static inline void terminate_if_writable(char const* const filename) {
19 errmsg = "Attempted execution of a writable file"; 19 errmsg = "Attempted execution of a writable file";
20 goto violation; 20 goto violation;
21 } 21 }
22 if (errno != EACCES) { 22 if (errno != EACCES && errno != EROFS && errno != EPERM) {
23 goto err; 23 goto err;
24 } 24 }
25 25
@@ -45,7 +45,7 @@ ZEND_COLD static inline void terminate_if_writable(char const* const filename) {
45 efree(dirname); 45 efree(dirname);
46 goto violation; 46 goto violation;
47 } 47 }
48 if (errno != EACCES) { 48 if (errno != EACCES && errno != EROFS && errno != EPERM) {
49 efree(dirname); 49 efree(dirname);
50 goto err; 50 goto err;
51 } 51 }