|
|
|
|
|
|
| Author |
Message |
perltcl@yahoo.com *nix forums beginner
Joined: 04 Jul 2006
Posts: 3
|
Posted: Tue Jul 04, 2006 4:44 pm Post subject:
permission wrt different types of files
|
|
|
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 |
|
 |
ynotssor *nix forums Guru Wannabe
Joined: 09 Mar 2005
Posts: 209
|
Posted: Tue Jul 04, 2006 5:01 pm Post subject:
Re: permission wrt different types of files
|
|
|
<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
|
Posted: Tue Jul 04, 2006 5:20 pm Post subject:
Re: permission wrt different types of files
|
|
|
ynotssor wrote:
what page has only info wrt file and directory, but not other types... |
|
| Back to top |
|
 |
Tyler McHenry *nix forums beginner
Joined: 29 Jun 2006
Posts: 6
|
Posted: Tue Jul 04, 2006 5:38 pm Post subject:
Re: permission wrt different types of files
|
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I hereby accuse perltcl@yahoo.com of stating:
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 |
|
 |
ynotssor *nix forums Guru Wannabe
Joined: 09 Mar 2005
Posts: 209
|
Posted: Tue Jul 04, 2006 5:48 pm Post subject:
Re: permission wrt different types of files
|
|
|
<perltcl@yahoo.com> wrote in message
news:1152033655.328645.173340@j8g2000cwa.googlegroups.com
In Unix/Linux, there *is* no other. |
|
| Back to top |
|
 |
Unruh *nix forums Guru
Joined: 22 Mar 2005
Posts: 1166
|
Posted: Tue Jul 04, 2006 7:24 pm Post subject:
Re: permission wrt different types of files
|
|
|
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 |
|
 |
Lew Pitcher *nix forums Guru
Joined: 21 Feb 2005
Posts: 675
|
Posted: Tue Jul 04, 2006 7:28 pm Post subject:
Re: permission wrt different types of files
|
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tyler McHenry wrote:
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 |
|
 |
Wayne *nix forums Guru
Joined: 20 Feb 2005
Posts: 527
|
Posted: Sat Jul 08, 2006 12:41 am Post subject:
Re: permission wrt different types of files
|
|
|
perltcl@yahoo.com wrote:
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 |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 11:38 am | All times are GMT
|
|
Remortgages | Loans | Turbo Tax software | Personal Loans | Millsberry
|
|
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
|
|