This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix for Bug 880699
restorer.php security patch
- Loading branch information
Showing
1 changed file
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,16 @@ | ||
| <?php | ||
|
|
||
| list($blank, $uuid, $blank) = split("/", $_SERVER["PATH_INFO"]); | ||
| shell_exec("/usr/sbin/oo-restorer-wrapper.sh $uuid"); | ||
|
|
||
| sleep(2); | ||
| $url=str_replace("/$uuid", "", $_SERVER["PATH_INFO"]); | ||
| header("Location: $url"); | ||
|
|
||
| if (preg_match('/[0-9a-fA-F]{32}/', $uuid)) { | ||
| shell_exec("/usr/sbin/oo-restorer-wrapper.sh $uuid"); | ||
| sleep(2); | ||
| $host = $_SERVER['HTTP_HOST']; | ||
| $proto = "http" . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://'; | ||
| $url=str_replace("/$uuid", "", $_SERVER["PATH_INFO"]); | ||
| header("Location: $proto$host$url"); | ||
| } else { | ||
| // someone is trying to attack | ||
| error_log("Invalid uuid $uuid given to restorer.php"); | ||
| header('HTTP/1.0 403 Forbidden'); | ||
| } | ||
| ?> |