Harden quarantine provisioning; enforce strict permissions and update Ansible and docs
This commit is contained in:
4
tests/smoke/create_test_files.ps1
Normal file
4
tests/smoke/create_test_files.ps1
Normal file
@@ -0,0 +1,4 @@
|
||||
# Create sample files for upload smoke tests
|
||||
Set-Content -Path .\tests\smoke\public\sample.txt -Value "hello world"
|
||||
Set-Content -Path .\tests\smoke\public\suspicious.php -Value "<?php echo 'bad'; ?>"
|
||||
Write-Host "Created sample files."
|
||||
1
tests/smoke/public/sample.txt
Normal file
1
tests/smoke/public/sample.txt
Normal file
@@ -0,0 +1 @@
|
||||
hello world
|
||||
1
tests/smoke/public/suspicious.php
Normal file
1
tests/smoke/public/suspicious.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php echo 'bad'; ?>
|
||||
19
tests/smoke/public/upload.php
Normal file
19
tests/smoke/public/upload.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// Simple endpoint that accepts file uploads; auto_prepend_file will run upload-logger.php
|
||||
header('Content-Type: text/plain');
|
||||
if (empty($_FILES)) {
|
||||
echo "no files\n";
|
||||
exit;
|
||||
}
|
||||
$out = [];
|
||||
foreach ($_FILES as $k => $v) {
|
||||
if (is_array($v['name'])) {
|
||||
$count = count($v['name']);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$out[] = $v['name'][$i] . ' -> ' . $v['tmp_name'][$i];
|
||||
}
|
||||
} else {
|
||||
$out[] = $v['name'] . ' -> ' . $v['tmp_name'];
|
||||
}
|
||||
}
|
||||
echo implode("\n", $out) . "\n";
|
||||
Reference in New Issue
Block a user