LinuxQuestions.org
Visit Jeremy's Blog.
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 04-25-2011, 01:25 AM   #1
etika
Member
 
Registered: Dec 2010
Posts: 38

Rep: Reputation: 0
Red face problem in executing cron file ...


i have made a cron file in /etc/cron.d directory

i am appending a cron file in this directory through a jsp which is executed by tomcat .
The permissions of the file is made
-rwxrwxrwx 1 root root 462 2011-04-25 11:20 fi

and iam running this file through root
but its not executing
but on changing the permissions of the file to 644 the script starts executing.(why it is happening so?)

why the file stop excuting when its permissions are changed to 777
 
Old 04-25-2011, 01:52 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Since version xxx (cannot find the proper reference, right now) the cron daemon refuses to run crontab files that have execute permissions for the "other" part of the permission bits. This is due to a kernel bug discovered in the past, for which an external user could gain control by running a cron job which generated a core dump in /etc/cron.d directory. I leave the security concerns to real experts in this field, but I can confirm that the behaviour you've noticed is the default, despite it's poorly documented.

Edit: just found a brief reference here: http://slackrw.wordpress.com/2006/08...d-permissions/. My explanation was slightly incorrect: according to this article the permission bits are set to avoid the creation of the core dump inside /etc/cron.d (not necessarily from a cron job executed from /etc/cron.d itself).

Last edited by colucix; 04-25-2011 at 01:57 AM.
 
Old 04-25-2011, 02:19 PM   #3
spankbot
Member
 
Registered: Aug 2007
Posts: 133

Rep: Reputation: 16
It should also be noted that modifying systems files (/etc) via a a web server is extremely dangerous and considered bad form.
 
  


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 executing scripts from cron. glore2002 Debian 6 10-01-2009 10:40 AM
problem executing file tamoneya Linux - Newbie 1 02-24-2008 08:02 PM
Problem in executing .run file (updating PB) art.love Linux - Software 6 02-01-2008 01:48 PM
cron not executing yusufs Linux - Newbie 38 12-27-2007 05:01 PM
Cron not Executing PHP script Badnoodles Linux - General 2 10-25-2006 04:56 PM

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

All times are GMT -5. The time now is 06:41 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