Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mkdir and others fail

Status
Not open for further replies.

tjbradford

Technical User
Dec 14, 2007
229
0
0
GB
I have created a cgi-bin bash script that runs a treat from the commandline but fails when run from http

i think it's lacking write permissions, how can i overcome this ?

can i run the http as root to confirm that it's permission related?

some of the commands are
mkisofs
cryptsetup
losetup
mkdir
cp
mksquashfs

 
Hi

tjbradford said:
fails when run from http
Better give us details on this one :
[ul]
[li]Any error message in the browser ?[/li]
[li]HTTP response code indicating an error ?[/li]
[li]Something in the web server's error log ? ( By the way, what kind of web server you use ? )[/li]
[/ul]
Regarding the permissions, better run [tt]whoami[/tt] and/or [tt]id[/tt] from a CGI script, then [tt]su[/tt] to the user they displayed before running the script from the command line. Running a CGI script with root permission is not a good idea.


Feherke.
 
hi see below

uid=33( gid=33( groups=33(
/usr/lib/cgi-bin


DOCUMENT_ROOT=/var/www
GATEWAY_INTERFACE=CGI/1.1
HTTP_ACCEPT=application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_CONNECTION=keep-alive
HTTP_HOST=172.30.100.53
HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
PATH=/usr/local/bin:/usr/bin:/bin
PWD=/usr/lib/cgi-bin
QUERY_STRING=
REMOTE_ADDR=172.24.43.197
REMOTE_PORT=55708
REQUEST_METHOD=GET
REQUEST_URI=/cgi-bin/test2.cgi
SCRIPT_FILENAME=/usr/lib/cgi-bin/test2.cgi
SCRIPT_NAME=/cgi-bin/test2.cgi
SERVER_ADDR=172.30.100.53
SERVER_ADMIN=webmaster@localhost
SERVER_NAME=172.30.100.53
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.1
SERVER_SIGNATURE=<address>Apache/2.2.14 (Ubuntu) Server at 172.30.100.53 Port 80</address>
SERVER_SOFTWARE=Apache/2.2.14 (Ubuntu)

i can see now that im using as my id and when i su that user i don't have the permissions

how best to lift that users permissions to the right level or make the commands require less permissions ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top