Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-23-2004, 12:35 AM   #1
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
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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
LQ Newbie
Registered: Aug 2004
Posts: 25

Original Poster
Rep: Reputation: 15
run PHP as a CGI with suExec will produce security hole. as 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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:09 PM.

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