LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-23-2010, 05:06 PM   #1
shifter
Member
 
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Rep: Reputation: 30
permissions denied with perl/cgi script


My /usr/lib/cgi-bin/script.cgi must create a directory in my /home/myname directory, but in firefox appears:
Quote:
Software error:

Cannot mkdir: Permission denied at /usr/lib/cgi-bin/script.cgi line 17.

For help, please send mail to the webmaster (webmaster@localhost), giving this error message and the time and date of the error.
What is the problem?
 
Old 02-23-2010, 05:17 PM   #2
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: PC-BSD / FreeBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 438

Rep: Reputation: 57
Does the user executing the script have the permissions to that directory?

Also... why would a CGI script be creating a directory on an end-user's machine? (or did I just read that wrong)
 
Old 02-23-2010, 05:30 PM   #3
shifter
Member
 
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Original Poster
Rep: Reputation: 30
cgi-bin directory has following permissions:
Quote:
ls -lh /usr/lib
.........
.........
drwxr-xr-x 2 root root 4,0K 2010-02-23 22:44 cgi-bin
.........
.........
and
Quote:
root@desktop:/usr/lib/cgi-bin# ls -lh
totale 16K
-rwxr-xr-x 1 root root 322 2010-02-23 23:18 script.cgi
root@desktop:/usr/lib/cgi-bin#
My home direcory is /home/savio:
Quote:
root@desktop:~# ls -lh /home
totale 4,0K
drwxr-xr-x 54 savio savio 4,0K 2010-02-23 23:21 savio
root@desktop:~#
I have the same problem also when I want make a folder in /var/www directory.
In fact, if I type:

su www-data

I enter in sh shell of apache2 user/group (www-data).
I want to give to www-data user (apache2 user) permissions for make directory in specific directory.
How can solve this problem?

Last edited by shifter; 02-23-2010 at 05:59 PM.
 
Old 02-23-2010, 06:05 PM   #4
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: PC-BSD / FreeBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 438

Rep: Reputation: 57
So you want the apache user to have these rights to your home directory?
Well, if it is running chroot, it probably can't even get there (depending on where the chroot base directory is).

If it's not, then you can add your user group to the apache user, then give your group rights to create files in your home dir.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with perl modules declaration and perl/cgi script shifter Programming 9 02-24-2010 10:09 AM
perl cgi script and images. sholah Linux - Software 2 03-02-2007 12:20 PM
Permission denied executing cgi-script Geminias Linux - Networking 4 07-31-2006 11:02 PM
Python CGI script can't write files, permission denied The_Nerd Programming 4 03-17-2005 01:19 PM
Need Help With My Perl/cgi Authentication Script dutch357 Programming 0 04-11-2003 10:54 AM


All times are GMT -5. The time now is 08:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration