LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-17-2005, 02:52 AM   #1
statman
LQ Newbie
 
Registered: Jun 2005
Posts: 9

Rep: Reputation: 0
Deleting a file created by root


Without going into too much detail:
I have a daemon running as a root process.
It creates a file (e.g. foo) that serves as a signal to a bash script.
Once the bash script detects the presence of foo, it performs its actions and then is supposed to delete the foo file.

The bash script is started automatically when any non-root account is logged into. The problem occurs when the bash script tries to delete foo, I get a 'permission denied' message.

As I understand it, since the bash script is running as a process under a user acct, it does not have the permission to delete a file created by a root process.

I tried having the root process use chmod 777 foo, but this still did not allow the bash script to delete the foo.

What am I doing wrong? I am using RedHat Fedora 3

Any help is much appreciated
 
Old 06-17-2005, 03:12 AM   #2
hardcorelinux
Member
 
Registered: Jan 2005
Location: India
Distribution: RHEL,CentOS,SUSE,Solaris10
Posts: 183

Rep: Reputation: 31
check the permissions of your script running folder also,check whether a nonroot user can able to access it or not.
 
Old 06-17-2005, 10:22 AM   #3
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
You need write access to the parent directory to delete files, not the files themselves.
 
  


Reply



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
1 can't (root can) read from partition created by fedora during install Ace2005 Fedora 8 06-24-2005 08:08 AM
Linux Executable File Help (created from a .c file) MattG1981 Linux - Newbie 7 06-06-2004 04:54 PM
Sound works for root and first user created, no one else downinthemine Linux - Hardware 7 01-15-2004 08:44 PM
Deleting the newly created files keeping the existing icorsi Linux - Newbie 2 10-07-2001 11:16 AM
Deleting newly created files keeping the existing ones icorsi Linux - General 0 10-07-2001 12:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:50 PM.

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