File Permission Problem | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

File Permission Problem

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-11-2007
bluepluto bluepluto is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 27 February 2011, 7:44 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Data File Permission Problem

Hi,I am a newbie, in a hp-ux box,i create a file testfile as root,
ls -l testfile
-rw-r--r-- 1 root sys 1 Jan 11 17:51 testfile
then l login the box as user ivan,then I execute
rm testfile
It prompts me testfile : 644 mode ? (y/n) ,if I enter y,then the testfile is deleted.So why could other user delete that file,it seems impossible according to the file permission setting ?
Thanks you all !
Sponsored Links
    #2  
Old 01-11-2007
tomduck tomduck is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 12 March 2007, 2:57 PM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
You are allowed to do this because your user ivan has write permissions on the directory which this file is in.
Sponsored Links
    #3  
Old 01-11-2007
bluepluto bluepluto is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 27 February 2011, 7:44 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
no, ivan has no write permission to the directory where testfile is in, actually in my opinion, according to the permission setting, the permission of the file should overwrite the permission of the directory, am i right ?
    #4  
Old 01-11-2007
Tornado's Avatar
Tornado Tornado is offline
Registered User
 
Join Date: Nov 2006
Last Activity: 2 October 2014, 6:55 PM EDT
Location: Melbourne
Posts: 261
Thanks: 1
Thanked 11 Times in 8 Posts
Type ls -al of the directory where the file is in.
ie:
If the file is in directory /var/test type ls -al /var/test and post the output here.
Sponsored Links
    #5  
Old 01-11-2007
bluepluto bluepluto is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 27 February 2011, 7:44 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
^_^
# ls -al /testdir
total 16
drwxr-xr-x 2 root sys 96 Jan 11 19:14 .
drwxr-xr-x 24 root root 8192 Jan 11 19:14 ..
-rw-r--r-- 1 root sys 0 Jan 11 19:14 testfile

ls -ld /testdir
drwxr-xr-x 2 root sys 96 Jan 11 19:14 /testdir
Sponsored Links
    #6  
Old 01-11-2007
Tornado's Avatar
Tornado Tornado is offline
Registered User
 
Join Date: Nov 2006
Last Activity: 2 October 2014, 6:55 PM EDT
Location: Melbourne
Posts: 261
Thanks: 1
Thanked 11 Times in 8 Posts
According to that, Ivan should not be able to remove the file..

Code:
bash-2.05$ ls -al testdir
total 32
drwxr-xr-x   2 root     sys         182 Jan 11 23:03 .
drwxr-xr-x   3 root     root         181 Jan 11 23:02 ..
-rw-r--r--   1 root     sys           0 Jan 11 23:03 testfile
bash-2.05$ rm testfile
rm: testfile: override protection 644 (yes/no)? yes
rm: testfile not removed: Permission denied
bash-2.05$

Sponsored Links
    #7  
Old 01-11-2007
bluepluto bluepluto is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 27 February 2011, 7:44 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Tornado, maybe there is something wrong with my unix box, I have tried in another one, it worked in the correct way, thanks !
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with execute my file permission qral_hdr Shell Programming and Scripting 0 05-16-2010 09:08 PM
file permission problem akumargolf2000 UNIX for Dummies Questions & Answers 3 07-05-2008 12:37 PM
file permission problem skully Solaris 2 05-26-2008 03:29 AM
unable to delete file for permission problem sabyasm UNIX for Dummies Questions & Answers 4 02-26-2006 08:55 PM
File permission problem jodie UNIX for Dummies Questions & Answers 2 11-11-2003 10:35 PM



All times are GMT -4. The time now is 10:43 PM.