LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-23-2004, 12:35 AM   #1
sheikhsa
LQ Newbie
 
Registered: Aug 2004
Posts: 25

Rep: Reputation: 15
could cron/any batch run at my will


i have a major problem regarding saving files from nobody:
i use a trick i.e call a shell script from php, but it too error that

chown: getting attributes of `/home/adam/.vacation.msg': Permission denied

now i tried to call from php a schedular like cron/at etc. and put the entry of that script to cron/at etc. and call from there.
any comments..
will be very helpfull...and apreciated.
thanks in advance
 
Old 09-23-2004, 02:04 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
I don't think this will be able to help you, since if your PHP script is running as user nobody, it will only be able to edit nobody's crontab, which runs with the permissions of -- you guessed it -- nobody. There are a couple of ways around this whole problem:

-- run PHP as a CGI with seExec as opposed to an Apache module (this is what I do on a couple of my Web hosting servers).
-- create a small C program in /usr/local/bin (or whatever directory you have as your PHP safe_mode_exec_dir in PHP) that's setuid to your user and does what you need to do, and have PHP invoke it (e.g. via a popen call to capture output).
-- redo your permissions so that the user Apache is running under has permissions to read what it needs to read.

Or are you saying you would edit crontab as yourself and have your crontab call the PHP script? This would probably work, but that wouldn't help people trying to access the page through your Web server.
 
Old 09-23-2004, 08:00 PM   #3
sheikhsa
LQ Newbie
 
Registered: Aug 2004
Posts: 25

Original Poster
Rep: Reputation: 15
run PHP as a CGI with suExec will produce security hole. as
httpd.apache.org/docs-2.0/suexec.html give detail about that it will produce a high VA, and each user could access to others files.

by editing crontab from php: i tested it but it also permission denied error. becz this is unix theory that child process could not override parent process...!

there is no way to escape from there but to run cron/at outside it...
thanks for your interes...t
 
  


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
cron weekly does not run jordanthompson Linux - Software 21 01-16-2005 09:52 AM
trying to get cron to run naijaguy Linux - General 12 08-18-2004 05:32 PM
Linux box calling a batch script on a windows box to run? Is it possible? joelhop Programming 8 05-17-2004 04:49 PM
Cron job does not run brentos Linux - General 6 12-12-2003 02:37 PM
sftp-run with a batch? JeRrYmAn Linux - Newbie 2 10-07-2003 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration