Gossamer Forum
Home : Products : Others : Fileman :

fileman in a cobalt server.

Quote Reply
fileman in a cobalt server.
Hi,
We used to use fileman in our virtual server, and it was working just fine.
Now we are moving our virtual site a dedicated server, a cobalt one.
We tried this in our site, it always worked fine for just one level under its home directory, and after trying to access lower levels we had the following error message:

Error! The following error occured:

Invalid Directory: 'cgi-bin/fileman'. Reason: Illegal Characters in Directory. Please use letters, numbers, - and _ only.

Please press back on your browser to fix the problem.
Can anybody advise how to fix this problem?
Please we used a directory name with only characters and dash and for that site everything was fine when it was in the virtual site environment.
Thanks in advance,


wewe
Quote Reply
Re: fileman in a cobalt server. In reply to
hi! your directory_name must have contains some "illegal" characters like "." or non_ASCII letters
just modify the code below as needed to allow whatever you need.. in my case it was '.' (dot)
----------------------
sub is_valid_dir {
# -----
.............
###(VM): DOT allowed
# ($dir =~ m,^([A-Za-z0-9\-_/]*)$,) ?
($dir =~ m,^([A-Za-z0-9\-_\./]*)$,) ?
($okdir = $1) :
(return ($dir, "Illegal Characters in Directory. Please use letters, numbers, - and _ only."));
--------------

br,
Viktor

Quote Reply
Re: fileman in a cobalt server. In reply to
Thank you for replying.
In fact, my problem is not the illegal character because I worked with the same file man and the same directly fine when I had a virtual server, now I moved to dedicated server and tried to install fileman on it in one of the domain but I had this error:
To better clarify the problem:
When I try for example open the directory as the next level under the home directory everything works ok, then I try to open a lower level directory such as the directory "pass" the url in the address field in the Internet Explorer will change to the following string:
http://www.mydomain.com/cgi-bin/fileman/fileman.cgi?wd=cgi-bin/fileman%225Fpass
Then when I change the link to:
http://www.mydomain.com/cgi-bin/fileman/fileman.cgi?wd=cgi-bin/fileman/pass
Fileman then works and can access lower levels just when writing there manually in the address field.
Can you explain what happening and advise how to fix the problem?
Thanks in advance.

j.joubarani
Quote Reply
Re: fileman in a cobalt server. In reply to
i see, its pretty strange..
anyway, lets try the following quick hack:
1) find the following code in "fileman.cgi":
==============================
# Let's work out the relative path if it is a directory.
if ($file eq '..') {
@nest = split (/\//, $working_dir);
(pop (@nest)) ?
($newdir = "$config{'script_url'}?wd=" . join ("/", @nest)) :
($newdir = "$config{'script_url'}");
}
else {
$working_dir ? ($temp_dir = "$working_dir/$file") : ($temp_dir = "$file");
$newdir = "$config{'script_url'}?wd=$temp_dir";
}
$newdir = $in->escapeHTML($newdir);
==========================
2) replace with following:
===============
# Let's work out the relative path if it is a directory.
if ($file eq '..') {
@nest = split (/\//, $working_dir);
(pop (@nest)) ?
($newdir = "$config{'script_url'}?wd=" . join ("/", @nest)) :
($newdir = "$config{'script_url'}");
}
else {
###(VM)
# $working_dir ? ($temp_dir = "$working_dir/$file") : ($temp_dir = "$file");
$working_dir ? ($temp_dir = "$working_dir/$file") : ($temp_dir = "$file");
$newdir = "$config{'script_url'}?wd=$temp_dir";
}
###(VM)
# $newdir = $in->escapeHTML($newdir);
# ==================================

actually, all you need to do is replace this:
$working_dir/$file
with that:
$working_dir/$file
and also disable (comment) that one:
# $newdir = $in->escapeHTML($newdir);

hope it help,
Viktor


Quote Reply
Re: fileman in a cobalt server. In reply to
Hi,
Thank you for your help.
In fact we did what you advised us to do and it worked just for viewing all the levels.
However, we can't upload anything, when we tried it did not do anything just returned to the root directory of the site.
When we tried to chmod we had the following error message:

CGI ERROR
==========================================
Error Message : Unable to change permissions for 'fileman.log' to '777'. Reason: Operation not permitted
Script Location : /home/sites/site1/web/cgi-bin/fileman/fileman.cgi
Perl Version : 5.00503

Configuration
-------------------------------------------
allowed_space : 200000
icondir_url : http://al-mada.com/fileman/icons
logfile : /home/sites/site1/web/fileman/fileman.log
max_upload : 100000
password_dir : /home/sites/site1/web/cgi-bin/fileman/pass
root_dir : /home/sites/site1
root_url : http://al-mada.com
script_url : http://al-mada.com/cgi-bin/fileman/fileman.cgi
show_date : 1
show_icon : 1
show_pass : 1
show_perm : 1
show_size : 1
use_flock : 1
version : 1.0

Form Variables
-------------------------------------------
action : permissions
name : fileman.log
newperm : 777
wd : web/fileman

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /home/sites/site1/web
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP_ACCEPT_LANGUAGE: ar-sy
HTTP_CACHE_CONTROL : max-age=259200
HTTP_CONNECTION : keep-alive
HTTP_HOST : www.al-mada.com
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
HTTP_VIA : 1.0 proxy.scs-net.org:8080 (Squid/2.2.STABLE5)
HTTP_X_FORWARDED_FOR: 128.0.103.137
PATH : /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
QUERY_STRING : action=permissions&name=fileman.log&newperm=777&wd=web/fileman
REMOTE_ADDR : 212.31.117.6
REMOTE_PORT : 25169
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/fileman/fileman.cgi?action=permissions&name=fileman.log&newperm=777&wd=web/fileman
SCRIPT_FILENAME : /home/sites/site1/web/cgi-bin/fileman/fileman.cgi
SCRIPT_NAME : /cgi-bin/fileman/fileman.cgi
SCRIPT_URI : http://www.al-mada.com/cgi-bin/fileman/fileman.cgi
SCRIPT_URL : /cgi-bin/fileman/fileman.cgi
SERVER_ADDR : 63.80.244.72
SERVER_ADMIN : admin
SERVER_NAME : www.al-mada.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.0
SERVER_SIGNATURE :
SERVER_SOFTWARE : Apache/1.3.12 Cobalt (Unix) mod_ssl/2.6.4 OpenSSL/0.9.5a PHP/4.0.1pl2 mod_auth_pam/1.0a FrontPage/4.0.4.3 mod_perl/1.24
UNIQUE_ID : OvfqAz9Q9ckAAF1qF@c


j.joubarani
Quote Reply
Re: fileman in a cobalt server. In reply to
in which directory you trying to upload to?
to some directory under your web_tree:
/home/sites/site1/web
or to your cgi-bin directory?
it might be some permissions issues

use your FTP client and make sure you set a proper permissions:
------ readme.txt --------
You should now ftp your files up in ASCII mode (except the icons)
and set permissions as follows (assuming the above url's and paths):

/cgi-bin
/cgi-bin/fileman
/cgi-bin/fileman/pass (777) drwxrwxrwx
/cgi-bin/fileman/fileman.cgi (755) -rwxr-xr-x
/cgi-bin/fileman/fileman.log (666) -rw-rw-rw-
--------------
in your case it should be, i guess:

/home/sites/site1/web/fileman/ (777) drwxrwxrwx
/home/sites/site1/web/fileman/fileman.log (666) drwxrwxrwx

don't forget:
- when you upload files using FTP protocol, they will belong to FTP user (a real user)
- when you upload files using HTTP protocol - they will be owned by WWW user (usually 'nobody' or 'www')


Quote Reply
Re: fileman in a cobalt server. In reply to
On some servers when setting up Links you have to have all of the folder below it (that you can access) CHMODed to 777.

Dunno if this is relevant, but it is worth a mention Wink

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: fileman in a cobalt server. In reply to
I doubt it. Also you should not have everything as 777 - NOT SECURE.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Permission problem. In reply to
Hi everybody,
We read your valuable posts and we will explain our problem with permissions hoping to hear from you any solution.
We had a virtual server and worked with many cgi scripts properly on it. We used to use webfolder uploading to upload our files since it's easier to deal with and we had problem using ftp through our ISP.
Now we moved to a cobalt raq 4i dedicated server. We are the only party who has control on the server. We have several virtual sites. We tried to upload cgi files such as file manager to deal with all the files on the server including the virtual sites files.
We faced a permissions problem since the file man were uploaded by ftp and other cgi files were uploaded by wefolder. The ftp uploaded files have its owner as the ftp account owner where any file uploaded with webfolder has nobody owner. We tried to deal with this file man to change permissions, upload file but the file man did not work but it had only function of viewing.
Someone advised us that the problem stemed from using cgi-wrap so we changed addhandler in httpd.conf from cgi-wrapper to cgi0script, but nothing change.
Please advise us to find a solution with this permission problem since the same script was working properly with the old virtual server. We know that some solutions may have security hole but we don't mind because we are the only party who has control over the raq.
Thanks for help.

J. Joubarani

j.joubarani
Quote Reply
Re: Permission problem. In reply to
In Reply To:
We know that some solutions may have security hole but we don't mind because we are the only party who has control over the raq.
That isn't the point. A security whole will mean that you won't have sole control if some hacks the server.

Anyway I don't know what solution you want. Are you saying that you have a permission or ownsership problem? - If it is permissions then chmod the files according to the readme. If it is ownership them use chown to change the file ownerships to their correct value.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/