The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Hardware > Filesystems, Disks and Memory
.
google unix.com



Filesystems, Disks and Memory Discuss NAS, SAN, RAID, Robotic Libraries, backup devices, RAM, DRAM, SCSI, IDE, EIDE topics here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Basic question re. permission denied justinwyllie UNIX for Dummies Questions & Answers 2 03-07-2008 11:36 AM
Tricky script question budrito Shell Programming and Scripting 3 06-30-2006 03:06 AM
Tricky Sed bestbuyernc Shell Programming and Scripting 2 11-22-2005 01:03 PM
The file permission ust UNIX for Dummies Questions & Answers 2 05-05-2005 09:18 AM
Tricky one... saabir Windows & DOS: Issues & Discussions 1 12-12-2002 05:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-30-2002
Hook Hook is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 2
Tricky File Permission Question

I'm trying to answer the following question about file permissions in Unix. Consider a file with the following permissions:

rwx---r--

I am not the owner of this file, but I am a member of the group of this file.

My question is: do I have read access to this file?

I thought the answer was YES, since the world has read access to this file. But, a sysadmin is telling me that the answer is NO, since the group access bits are all off.

Can someone provide an authoritative answer?

I would try to answer this for myself, but at the moment, I don't have access to a Unix box with sufficient priveleges.

Thanks.

--
Hook
  #2 (permalink)  
Old 06-30-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
If your kernel is working correctly, you should be unable to read the file. This behavior is mandated by Posix and all posix compliant systems should behave this way.

Which way this should work was debated during the early 80's. The overriding element was that rwx---r-- and rwxr--r-- really should behave differently. The currently accepted behavior allows a user to revoke permission for one group while allowing all other groups access. If you want rwxr--r-- then all you need is a chmod to get it.
  #3 (permalink)  
Old 06-30-2002
Hook Hook is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 2
Re: Tricky File Permission

Thanks for the reply. I was hoping this was the answer.

Can you point me at a source that describes this behavior?

--
Hook
  #4 (permalink)  
Old 07-16-2002
rene_metaal rene_metaal is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 24
Question File permissions rwx---r--

The way Unix handles the permission is by reading the permission from the left to the right.
So
If the permission looks like rwx---r--
And you are not the owner but are a group member you cannot read this file.
##############Demo on HP-UX 11i, Logged on as rene
Home dir /home/rene
$ id
uid=102(rene) gid=20(users)
$ ls -la
total 14
drwxr-xr-x 2 rene users 1024 Jul 16 21:17 .
drwxr-xr-x 4 root root 96 Jul 9 23:13 ..
-rw-r--r-- 1 rene users 832 Jul 9 23:13 .cshrc
-rw-r--r-- 1 rene users 347 Jul 9 23:13 .exrc
-rw-r--r-- 1 rene users 334 Jul 9 23:13 .login
-rw-r--r-- 1 rene users 439 Jul 9 23:13 .profile
-rw------- 1 rene users 146 Jul 16 21:22 .sh_history
-rwx---r-- 1 root users 32 Jul 16 21:19 permtest
$ cat permtest
cat: Cannot open permtest: Permission denied
$
# Permissions are read from the left to the right and it first tells that the group users have NO permissions bits set.
-- I hope this helps
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0