Explorar o código

Restrict v-make-tmp-file to tmp folder

Anton Reutov %!s(int64=4) %!d(string=hai) anos
pai
achega
ea1e22613e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      web/api/index.php

+ 1 - 1
web/api/index.php

@@ -104,7 +104,7 @@ if (isset($_POST['user']) || isset($_POST['hash'])) {
     // Check command
     if ($cmd == "'v-make-tmp-file'") {
         // Used in DNS Cluster
-        $fp = fopen($_POST['arg2'], 'w');
+        $fp = fopen('/tmp/'.basename($_POST['arg2']), 'w');
         fwrite($fp, $_POST['arg1']."\n");
         fclose($fp);
         $return_var = 0;