LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2003, 02:07 PM   #1
cosmicperl
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Rep: Reputation: 0
Giving Perl chmod authority?


Hi,
This probably isn't what your expecting. No I don't want to know how to chmod 0755 perl files. I have been coding with Perl for year. The problem I'm having is that I've just setup a new Linux box with SlackWare 9. I've got perl, MySQL, dbi, lwp, etc running. But I've hit an age old problem I've had on some servers for years. That is when I have a chmod command in my code, Unix isn't letting Perl change the Chmod settings. I've always wondered why only some servers do this, and I guess now I'm about to find out. I'm old to Perl, but new to working with Unix directly. Is this because of SlackWare? Or is it a config setting I haven't hit?

The web folder is under ownership of user 'lyle', when I login directly or with SSH I can chmod using the standard Unix commands.

Please tell me what you need to know, or if I need to post to a different forum.

Thanks!

 
Old 08-31-2003, 02:10 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

"Perl" or commands in perl scripts will have the same permissions as the user who is running them. If you need root permissions to make the specific chmod command then you may want to look at "sudo" be careful though - this can be dangerous.
 
Old 08-31-2003, 02:19 PM   #3
cosmicperl
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Original Poster
Rep: Reputation: 0
Hi,
The people running then could be anyone on the net. Whoever hits the URL.

How do I set the permissions? I'm new to this.
 
Old 08-31-2003, 02:27 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
In that case it will be the user that the webserver runs as. Usually the "apache" user. I would be very careful if you are thinking of doing this as it could be a major security risk. What is it you are trying to do? I would reccomend finding another way round it if you can.
 
Old 08-31-2003, 02:54 PM   #5
cosmicperl
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Original Poster
Rep: Reputation: 0
I've been coding Perl for years.

I have an install script for one of my products, which creates directories, chmods files, etc.

On some servers I have installed my software on about 2/5. Recently it's been 1/5. They do not let my install script chmod the files or create the directories.

I don't know how to change permissions for a user. What program do I use, or file do I edit in SlackWare.

Thank you for your help.
 
Old 08-31-2003, 02:58 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I think that if you make apache the owner of the base directory for your product before you run your web based script then the server should have the ability to chmod as it sees fit.
 
Old 08-31-2003, 04:00 PM   #7
cosmicperl
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Original Poster
Rep: Reputation: 0
I tried
chown apache www

but it gave invalid user
 
Old 08-31-2003, 04:04 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It could be "nobody". check httpd.conf and see which user it is configured to run as. Is www the base dir into which your product is installed? It seems kind of odd.
 
Old 08-31-2003, 05:38 PM   #9
cosmicperl
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Original Poster
Rep: Reputation: 0
I've checked and it's nobody

www is the main folder for everything available through http.
cgi-bin/af/
is where the program files are.
 
  


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
Burning a .dmg file Perl Script giving zlib error zwyrbla Linux - General 1 08-19-2005 04:02 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM
user's authority Xiangbuilder Linux - Newbie 1 12-29-2004 09:32 AM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
Giving a user CHMOD rights to the /var/www/html directory? scubes13 Linux - Networking 3 08-18-2002 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:28 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
Open Source Consulting | Domain Registration