Stuart Langley | "Words to memorize, words hypnotize,
Wollongong, | words all fail the magic prize,
Australia | nothing I can say when I'm in your thighs."
) Not a very clear question...please enumerate further.
) : Could someone explain the difference between by group and by others when
) : using the chmod command. The man chmod did not help on this one.
I think I know what Ken is asking...
In "man chmod", when it says "by owner" it means
"by any process whose effective UID (User IDentification)
number is the same as the UID that owns the file (as shown
by `ls -l')".
When it says "by group", it means
"by any process whose effective GID (Group IDentification)
number (or one of its supplemental groups) is the same as the
GID that owns the file (as shown by `ls -g' or `ls -l')".
When it says "by others", it means
"by any process"
(some systems may define "by group" so that if you are "owner" you
are never "group" and "by others" so that if you are "owner" or
"group" you are never "other" -- see my last paragraph as well).
This is from "man 2 intro" on my system:
If the effective user ID of the process is equal to the
user ID of the owner of the file, and the requested
access mode bit is set in the ``owner'' bits of the
mode, access is granted; otherwise access checking con-
If the effective group ID (or any of the supplementary
group IDs of the process) matches the owning group of
the file and the requested access mode bit is set in
the ``group'' bits of the mode, access is granted; oth-
erwise, access checking continues.
If the above checks fail, and the requested access mode
bit is set in the ``other'' bits of the mode, access is
granted; otherwise, access is denied (EACCES is
returned). These checks are performed on every com-
ponent of the pathname, including the object itself.
If any of the checks fail, the privileges of the cal-
ling process are examined to determine if the calling
process has the appropriate privilege for the mode
requested (P_DACREAD for read and execute/search
access, P_DACWRITE for write access).
Some systems may replace "otherwise access checking continues"
with "otherwise permission is denied" (or I may have imagined
the existence of such systems or they may have been non-Unix
systems). Reading more of "man 2 intro" may be informative.
Nothing is obvious unless you are overlooking something
I was just thinking, what would happen if, logged in as root, I typed
chmod a-x /bin/chmod? How could you fix it?
i don't think i want to try it.