niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » security
permission wrt different types of files
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
Wayne
*nix forums Guru


Joined: 20 Feb 2005
Posts: 527

PostPosted: Sat Jul 08, 2006 12:41 am    Post subject: Re: permission wrt different types of files Reply with quote

perltcl@yahoo.com wrote:
Quote:
ynotssor wrote:

perltcl@yahoo.com> wrote in message
news:1152031467.149394.102510@v61g2000cwv.googlegroups.com


I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
I found a lot of pages on this stuff, but no page has complete
information.

http://www.yiluda.net/manual/linux/rute/node17.html#table:permissions


what page has only info wrt file and directory, but not other types...


There really are no other types. The permission bits don't so much
have an effect depending on the file type, as what system call you
are making to that object. For example to use the readdir() system call
to locate a file in a directory, you need "x" (search) on that directory.
to read() a directory (say for "ls") you need "r" on that directory.

Now, to read or write to a socket or device file is no different. If you
use the read() and write() system calls you need "r" and "w" permission.

The special mode bits such as SUID have an effect on some system calls,
beyond just allowing access. For example SUID has no affect on
whether or not some file can be used by exec() (that's what "x"
is for), but if you are allowed to exec() a file, the EUID is changed
from the real UID to the UID (owner) of the file if SUID is set.

From this it should be clear that the extra bits have no special
effect for special file types such as sockets or FIFOs or devices
or even directories. It's just that you usually make different
system calls to directories than to other things. The normal rules
for all file system objects apply: "r" to read, "w" to write.

The only possible special case not normally found in the books
or on-line is that a file with the SGID bit on, if the filesystem
was mounted as "mount -o mand ...", means that manditory file
locking applies. Of course not all file system types support
that. But I mention it because if one process has open() a file
or socket or whatever, another may fail to open it.

For a pretty through review of file permissions and related
concepts see my "more than you really wanted to know" guide
at http://wpollock.com/AUnix1/FilePermissions.htm

-Wayne
Back to top
Lew Pitcher
*nix forums Guru


Joined: 21 Feb 2005
Posts: 675

PostPosted: Tue Jul 04, 2006 7:28 pm    Post subject: Re: permission wrt different types of files Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Tyler McHenry wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
I hereby accuse perltcl@yahoo.com of stating:
ynotssor wrote:
perltcl@yahoo.com> wrote in message
news:1152031467.149394.102510@v61g2000cwv.googlegroups.com

I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
http://www.yiluda.net/manual/linux/rute/node17.html#table:permissions

what page has only info wrt file and directory, but not other types...

According to the linux VFS, everything *is* either a file or a directory.

P'haps the OP is concerned about the subvarieties of file known as
"block special device", "character special device", "symbolic link",
and "unix socket". While all of these behave within the Unix
file/directory paradyme, they do exhibit differences in permission bit
values and interpretations.

[snip]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12

iD8DBQFEqsFWagVFX4UWr64RAvdeAKDRNd/AcQFBR0pcikzSGqaESYGZMwCg6mn2
8qYySYkgAT2OpvbkcWgOqUg=
=fagm
-----END PGP SIGNATURE-----
Back to top
Unruh
*nix forums Guru


Joined: 22 Mar 2005
Posts: 1166

PostPosted: Tue Jul 04, 2006 7:24 pm    Post subject: Re: permission wrt different types of files Reply with quote

perltcl@yahoo.com writes:

Quote:
hi

i'm trying to detailed information about what permissions do wrt
different types of files (directory,file,pipes,socket,devices,etc).
What are the correct behaviors.
I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
I found a lot of pages on this stuff, but no page has complete
information.
I need to write a test script.

man 1p chmod

Now, why should someone write you " a full table listing "all"
combinations."?
Back to top
ynotssor
*nix forums Guru Wannabe


Joined: 09 Mar 2005
Posts: 209

PostPosted: Tue Jul 04, 2006 5:48 pm    Post subject: Re: permission wrt different types of files Reply with quote

<perltcl@yahoo.com> wrote in message
news:1152033655.328645.173340@j8g2000cwa.googlegroups.com

Quote:
I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
....
http://www.yiluda.net/manual/linux/rute/node17.html#table:permissions

what page has only info wrt file and directory, but not other
types...

In Unix/Linux, there *is* no other.
Back to top
Tyler McHenry
*nix forums beginner


Joined: 29 Jun 2006
Posts: 6

PostPosted: Tue Jul 04, 2006 5:38 pm    Post subject: Re: permission wrt different types of files Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I hereby accuse perltcl@yahoo.com of stating:

Quote:

ynotssor wrote:
perltcl@yahoo.com> wrote in message
news:1152031467.149394.102510@v61g2000cwv.googlegroups.com

I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
I found a lot of pages on this stuff, but no page has complete
information.

http://www.yiluda.net/manual/linux/rute/node17.html#table:permissions

what page has only info wrt file and directory, but not other types...

According to the linux VFS, everything *is* either a file or a directory. A
permission will have the same effect on a device node as on a file, i.e. if
it's +r you can read from it, and if it's +w you can write to it (+x is
meaningless).

- --
S. Tyler McHenry

http://www.nerdland.net/~tyler/info/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)

iD8DBQFEqqd8yhIpIIGf1i4RAjwEAJ9LrL5fiQEAIPm6ztWFsr7XJv+hdgCdH91u
koZOTzNV9voeEx3wJRpn1BI=
=9kk4
-----END PGP SIGNATURE-----
Back to top
perltcl@yahoo.com
*nix forums beginner


Joined: 04 Jul 2006
Posts: 3

PostPosted: Tue Jul 04, 2006 5:20 pm    Post subject: Re: permission wrt different types of files Reply with quote

ynotssor wrote:
Quote:
perltcl@yahoo.com> wrote in message
news:1152031467.149394.102510@v61g2000cwv.googlegroups.com

I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
I found a lot of pages on this stuff, but no page has complete
information.

http://www.yiluda.net/manual/linux/rute/node17.html#table:permissions

what page has only info wrt file and directory, but not other types...
Back to top
ynotssor
*nix forums Guru Wannabe


Joined: 09 Mar 2005
Posts: 209

PostPosted: Tue Jul 04, 2006 5:01 pm    Post subject: Re: permission wrt different types of files Reply with quote

<perltcl@yahoo.com> wrote in message
news:1152031467.149394.102510@v61g2000cwv.googlegroups.com

Quote:
I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
I found a lot of pages on this stuff, but no page has complete
information.

http://www.yiluda.net/manual/linux/rute/node17.html#table:permissions
Back to top
perltcl@yahoo.com
*nix forums beginner


Joined: 04 Jul 2006
Posts: 3

PostPosted: Tue Jul 04, 2006 4:44 pm    Post subject: permission wrt different types of files Reply with quote

hi

i'm trying to detailed information about what permissions do wrt
different types of files (directory,file,pipes,socket,devices,etc).
What are the correct behaviors.
I need a full table listing "all" combinations. (don't forget
suid,sticky bit,etc)
I found a lot of pages on this stuff, but no page has complete
information.
I need to write a test script.

Thanks
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Sat Nov 22, 2008 8:29 am | All times are GMT
navigation Forum index » *nix » Linux » security
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Permission denied executing apachectl Josep Sanmarti Apache 1 Fri Jul 21, 2006 10:06 am
No new posts ImportError: libclntsh.so.10.1: cannot open shared object... gmax2006 python 2 Thu Jul 20, 2006 7:05 pm
No new posts howto log in from one bsd-server to another and move file... Tobias Steer FreeBSD 3 Thu Jul 20, 2006 10:02 am
No new posts Problem with Oracle selecting object types sam.lumbroso@gmail.com PHP 3 Wed Jul 19, 2006 11:29 pm
No new posts Binary Files Ronin C++ 8 Wed Jul 19, 2006 3:12 pm

Mortgage Calculator | Advertising | Secured Loans | Cadillac | Personal Loans
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2668s ][ Queries: 20 (0.1701s) ][ GZIP on - Debug on ]