resource repository

For all the help you need with Armagetron!
Post Reply
QUARG
Round Winner
Posts: 223
Joined: Thu Sep 14, 2006 2:38 pm
Location: montreal

resource repository

Post by QUARG »

has anyone tried to upload a map to the resource in the past few weeks? i cant seem to get my maps to upload i always get the same error code. i think that this might be linked to the map previewer and svg converter being down.
QUARG
Round Winner
Posts: 223
Joined: Thu Sep 14, 2006 2:38 pm
Location: montreal

Post by QUARG »

when i select my map and hit upload i get this message.
i have tried many times with different maps and get the same error.
rebel from ecd and manta get the same message

[11:31pm] QUARG: <?php
[11:31pm] QUARG: ?>
[11:31pm] QUARG: <html>
[11:31pm] QUARG: <head>
[11:31pm] QUARG: <title>
[11:31pm] QUARG: Upload Results
[11:31pm] QUARG: </title>
[11:31pm] QUARG: </head>
[11:31pm] QUARG: <body>
[11:31pm] QUARG: <?php
[11:31pm] QUARG: $repo_pfix = '/var/www/armagetron/resource/resource/';
[11:31pm] QUARG: $preview_pfix = '/var/www/armagetron/resource/preview/';
[11:31pm] QUARG: $preview_webpath = 'http://beta.armagetronad.net/resource-preview/';
[11:31pm] QUARG: $preview_scriptpath = 'http://beta.armagetronad.net/resource-browser/resource/';
[11:31pm] QUARG: $repo_check = array($repo_pfix, "$repo_pfix/.old/");
[11:31pm] QUARG: $scriptuser = 'armagetronad';
[11:31pm] QUARG: /echo posix_getuid().'<br />';
[11:31pm] QUARG: echo "<!--\n_SERVER = ";
[11:31pm] QUARG: print_r($_SERVER);
[11:31pm] QUARG: echo "\n _POST = ";
[11:31pm] QUARG: print_r($_POST);
[11:31pm] QUARG: echo "\n _FILES = ";
[11:31pm] QUARG: print_r($_FILES);
[11:31pm] QUARG: echo "\n-->\n";
[11:31pm] QUARG: */
[11:31pm] QUARG: if ($_SERVER['argc']) {
[11:31pm] QUARG: $filef = $_SERVER['argv'][0];
[11:31pm] QUARG: $fileof = $_SERVER['argv'][1];
[11:31pm] QUARG: $whoami = '';
[11:31pm] QUARG: } else*/
[11:31pm] QUARG: $sizelimit = true;
[11:31pm] QUARG: if ($_POST['filef']) {
[11:31pm] QUARG: $filef = $_POST['filef'];
[11:31pm] QUARG: $fileof = $_POST['fileof'];
[11:31pm] QUARG: $whoami = $_SERVER['PHP_AUTH_USER'];
[11:31pm] QUARG: } else
[11:31pm] QUARG: if ($_FILES['file']) {
[11:31pm] QUARG: $filef = $_FILES['file']['tmp_name'];
[11:31pm] QUARG: $fileof = $_FILES['file']['name'];
[11:31pm] QUARG: $whoami = $_SERVER['PHP_AUTH_USER'];
[11:31pm] QUARG: } else
[11:31pm] QUARG: if ($_GET['filef']) {
[11:31pm] QUARG: $filef = $_GET['filef'];
[11:31pm] QUARG: $fileof = basename($filef);
[11:31pm] QUARG: $whoami = $_SERVER['PHP_AUTH_USER'];
[11:31pm] QUARG: $sizelimit = false;
[11:31pm] QUARG: } else
[11:31pm] QUARG: die('ERROR: No file uploaded!');
[11:31pm] QUARG: $scriptuserinfo = posix_getpwnam($scriptuser);
[11:31pm] QUARG: $scriptuid = $scriptuserinfo['uid'];
[11:31pm] QUARG: $scriptgid = $scriptuserinfo['gid'];
[11:31pm] QUARG: if (posix_getuid() != $scriptuid) {
[11:31pm] QUARG: if (@posix_setuid($scriptuid) && @posix_seteuid($scriptuid)
[11:31pm] QUARG: && @posix_setgid($scriptgid) && @posix_setegid($scriptgid)) {
[11:31pm] QUARG: // Guess we had root, should be safe now... maybe?
[11:31pm] QUARG: } else {
[11:31pm] QUARG: // Use sudo to change user
[11:31pm] QUARG: die("cannot elevate privs");
[11:31pm] QUARG: }
[11:31pm] QUARG: } */
[11:31pm] QUARG: if (!file_exists($filef))
[11:31pm] QUARG: die('ERROR: Cannot find resource temporary file! Perhaps the resource submission has already been completed? Perhaps your resource file is <strong>way too big</strong>? If not, please try again. If the problem persists, or if you want to add a way-too-big resource, contact <a href="mailto:luke+aaresource@dashjr.org">Luke-Jr</a>');
[11:31pm] QUARG: $errs = '';
[11:31pm] QUARG: if (filesize($filef) > 25600 && !$sizelimit)
[11:31pm] QUARG: $errs .= 'ERROR: Your resource is larger than 25 KB. Please contact <a href="mailto:luke+aaresource@dashjr.org">Luke-Jr</a> to add it to the repository manually.<br /><br />';
[11:31pm] QUARG: $file = fopen($filef, 'r');
[11:31pm] QUARG: $processedf = tempnam('/doesnotexist', 'aaru');
[11:31pm] QUARG: $processed = fopen($processedf, 'w');
[11:31pm] QUARG: $origf = tempnam('/doesnotexist', 'aaro');
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

That means luke messed up his webserver configuration so it doesn't interpret luke's .suid-php files.
There's no place like ::1
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

Hey, it's not like I didn't ask for someone to test it... next time let me know when that testing fails ;)

Should be working as of some number of hours ago when you told me that on IRC.
QUARG
Round Winner
Posts: 223
Joined: Thu Sep 14, 2006 2:38 pm
Location: montreal

Post by QUARG »

exelent ty.
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

QUARG wrote:exelent ty.
*Excellent.
QUARG
Round Winner
Posts: 223
Joined: Thu Sep 14, 2006 2:38 pm
Location: montreal

Post by QUARG »

i have a tendancy to think faster than i can type. or i take for granted that my mac key board is very sensitive to key strokes. :oops:
Post Reply