Askozia Forums
May 21, 2012, 08:10:04 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: exec.php fail on upload (pb14.2)  (Read 1063 times)
giovanni.v
Hero Member
*****

Karma: 53
Posts: 670


View Profile
« on: August 18, 2008, 08:47:14 am »

I've discovered this testing my messages.po, the first upload after boot is ok but trying again (any file) don't work.
Rebooting from cd works again (one shot), rebooting an installed system fail on upload almost every time.
Tested using opera 9.27 and Firefox 2 with cache disabled.

Issued a command like "touch /ultmp/myfile" the file was created and editable so isn't a file system issue.

This do not happen on pb14.
Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #1 on: August 18, 2008, 09:45:08 am »

What does running "df" report?

I've just tested uploading several files and things are working here.
Logged
giovanni.v
Hero Member
*****

Karma: 53
Posts: 670


View Profile
« Reply #2 on: August 18, 2008, 11:07:17 am »

What does running "df" report?

#
# pb14.2 cdrom, running on vmware vm
#
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/md0       40M     39M    933k    98%    /
devfs         1.0k    1.0k      0B   100%    /dev

#
# pb14 cdrom, running on vmware vm
#
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/md0       39M     38M    954k    98%    /
devfs         1.0k    1.0k      0B   100%    /dev

#
# pb14.2, 2GB CF card, upgraded from pb14, running on workbench hardware
#

Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/md0       19M     18M    1.3M    93%    /
devfs         1.0k    1.0k      0B   100%    /dev
/dev/ad4a      11M     10M    386k    96%    /cf
/dev/ad4b     7.6M    7.1M    510k    93%    /asterisk
/dev/ad4d     1.9G    3.9M    1.7G     0%    /storage

Quote
I've just tested uploading several files and things are working here.

Tested again booting  from cdrom the two virtual machines  now works, many uploads until the fs goes totally filled, deleted the uploaded files then tried again, worked all the times... the same environment not working this early morning (!!!), can't reproduce the same problem anymore.
In the meantime upgraded the pb14 workbench machine to pb14.2, here can't no longer upload anything.
Very strange behaviour.
Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #3 on: August 18, 2008, 01:09:53 pm »

Those files should be uploading to /ultmp which, on you last machine, should be stored in the storage partition. Check to see that the appropriate symbolic links are being created from /ultmp to /storage/ultmp
Logged
giovanni.v
Hero Member
*****

Karma: 53
Posts: 670


View Profile
« Reply #4 on: August 18, 2008, 03:46:50 pm »

Those files should be uploading to /ultmp which, on you last machine, should be stored in the storage partition. Check to see that the appropriate symbolic links are being created from /ultmp to /storage/ultmp

Yes, already checked, the symlink seem OK:

ls -al /ultmp
lrwxr-xr-x  1 root  wheel  14 Aug 18 14:25 /ultmp -> /storage/ultmp
ls -al /storage
drwxr-xr-x   5 root  wheel     512 Aug  9 18:41 .
drwxr-xr-x  20 root  wheel     512 Aug 18 14:25 ..
drwxrwxr-x   2 root  operator  512 Aug  2 17:35 .snap
drwxr-xr-x   3 root  wheel     512 Aug  5 15:26 logging.pkg
drwxr-xr-x   2 root  wheel     512 Aug 18 17:14 ultmp


But upload via exec.php won't work.

Done a quirk&dirty test:
- created a file via exec.php [touch /ultmp/test_upload.php]
- moved to http root [mv /ultmp/test_upload.php /usr/local/www/]
- set brute exec permission on it [chmod +x /usr/local/www/test_upload.php]
- filled this file with a dirty upload script using diag_editor.php...
Code:
#!/usr/local/bin/php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test upload</title>
</head>
<body>
<?
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
// Directory were uploaded files moved
$upload_dir = '/ultmp';
//
$renameFile_name = '';
//
if (isset($_FILES['upfile']['name']))
{
if(trim($_FILES['upfile']['name']) == '')
{
echo 'No file picked for upload!!';
}
else
{
// if $renameFile_name is empty leave name as is, else rename it...
$file_name = ($renameFile_name) ? $renameFile_name : $_FILES['upfile']['name'];
if(@is_uploaded_file($_FILES['upfile']['tmp_name']))
{
@move_uploaded_file($_FILES['upfile']['tmp_name'], "$upload_dir/$file_name")
or die('An error occured moving uploaded file! Check permissions and/or settings.');
}
else
{
echo 'An error occured uploading file: ' . $_FILES['upfile']["name"];
}
echo 'File: ' . $_FILES['upfile']['name'] . ' uploaded.';
}
}
?>
<div align="center">
<br><br>
<form action="test_upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="upfile">
<input type="submit" value="Upload">
</form>
</div>
</body></html>
<?php
?>


Now my dirty script work, uploaded many files, then deleted, tried again... works, tried again upload using exec.php but won't work.
Logged
Chocho
Newbie
*

Karma: 2
Posts: 19


View Profile
« Reply #5 on: September 20, 2008, 01:11:25 pm »

I have a similar issue, but when switch to English language it's working normally.
Thats why I don't fully translate /exec.php and now it's working on my language.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.099 seconds with 19 queries.