diff options
| author | xXx-caillou-xXx | 2017-12-20 18:09:53 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-20 18:09:53 +0100 |
| commit | e7f541396715ee2895abcf73044b91ae9b746201 (patch) | |
| tree | ba0e9765e7f14f04b92585df1f3fcd1830ab4b00 /src/sp_upload_validation.c | |
| parent | 8d6cc4f2b63c3f0dc31fe6cecd34ac023ea1cccb (diff) | |
Better parsing of the rules
Thanks to this huge commit from @xXx-caillou-xXx, we can now write amazingly flexible rules.
Diffstat (limited to 'src/sp_upload_validation.c')
| -rw-r--r-- | src/sp_upload_validation.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_upload_validation.c b/src/sp_upload_validation.c index 731a737..0010984 100644 --- a/src/sp_upload_validation.c +++ b/src/sp_upload_validation.c | |||
| @@ -51,7 +51,7 @@ int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra) { | |||
| 51 | cmd[2] = NULL; | 51 | cmd[2] = NULL; |
| 52 | 52 | ||
| 53 | spprintf(&env[0], 0, "SP_FILENAME=%s", filename); | 53 | spprintf(&env[0], 0, "SP_FILENAME=%s", filename); |
| 54 | spprintf(&env[1], 0, "SP_REMOTE_ADDR=%s", sp_getenv("REMOTE_ADDR")); | 54 | spprintf(&env[1], 0, "SP_REMOTE_ADDR=%s", getenv("REMOTE_ADDR")); |
| 55 | spprintf(&env[2], 0, "SP_CURRENT_FILE=%s", | 55 | spprintf(&env[2], 0, "SP_CURRENT_FILE=%s", |
| 56 | zend_get_executed_filename(TSRMLS_C)); | 56 | zend_get_executed_filename(TSRMLS_C)); |
| 57 | spprintf(&env[3], 0, "SP_FILESIZE=%zu", filesize); | 57 | spprintf(&env[3], 0, "SP_FILESIZE=%zu", filesize); |
| @@ -77,7 +77,7 @@ int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra) { | |||
| 77 | int waitstatus; | 77 | int waitstatus; |
| 78 | wait(&waitstatus); | 78 | wait(&waitstatus); |
| 79 | if (WEXITSTATUS(waitstatus) != 0) { // Nope | 79 | if (WEXITSTATUS(waitstatus) != 0) { // Nope |
| 80 | char *uri = sp_getenv("REQUEST_URI"); | 80 | char *uri = getenv("REQUEST_URI"); |
| 81 | int sim = SNUFFLEUPAGUS_G(config).config_upload_validation->simulation; | 81 | int sim = SNUFFLEUPAGUS_G(config).config_upload_validation->simulation; |
| 82 | sp_log_msg("upload_validation", sim?SP_LOG_SIMULATION:SP_LOG_DROP, | 82 | sp_log_msg("upload_validation", sim?SP_LOG_SIMULATION:SP_LOG_DROP, |
| 83 | "The upload of %s on %s was rejected.", filename, uri?uri:"?"); | 83 | "The upload of %s on %s was rejected.", filename, uri?uri:"?"); |
