0

I am confused about the 2nd part of this question (see photo below). As user and group permissions are contradicting. User doesn't have the execute permission but the group has. Can user also execute as user is the part of the group? or are all permissions are independent of each other?

Assignment question

A system has the following ordinary users and groups (and no others):

User Groups
alice staff, users, course
bob admin, users
carol admin, users, course
dave staff, users
eve course, users
fred admin, staff, users

Consider the following directory listing:

-r-x--xr-- 1 alice course   138856 Apr 27 10:46 file1
----rwxr-x 1 dave  staff   2190232 Apr 27 11:49 file2
---xr--r-x 1 carol course    24000 Apr 27 09:14 file3.sh
-rwx-----x 1 fred  admin    123456 Apr 27 11:50 file4.txt

and the following command output:

$ file file*
filel:     ASCII text
file2:     POSIX shell script, ASCII text executable
file3.sh:  POSIX shell script, ASCII text executable
file4.txt: ELF 64-bit ISB executable, ×86-64

List all of the users who are allowed to do the following.

  1. Read from file1

    Alice, bob, dave, fred (+2)

  2. Write to file2

    Alice, fred (+1)

Dave is owner who cannot write, but he is also in the group that can write. ????Confused here As far as i understand it, you can only have one set of permissions per person. So since dave is the owner, they are only affected by the 'owner' permissions. Similarly, a group member's permissions are unaffected by what permissions the owner has

tripleee
  • 7,699
sam
  • 1
  • @JaromandaX I think the question is whether dave can write or not, and you will find that they can not, even though they are part of the staff group. An answer would explain why this is the case. – Kusalananda Nov 11 '22 at 08:30
  • 1
    Please do not vandalize your posts. By posting on the Stack Exchange network, you've granted a non-revocable right for SE to distribute that content (under the CC BY-SA 4.0 license). By SE policy, any vandalism will be reverted. – tripleee Nov 11 '22 at 08:48

1 Answers1

0

Owner permissions take precedence over group permissions which take precedence over other permissions.

So as dave is the owner of file2, he will have owner permissions, which are ---, so he cannot read from or write to the file (or execute it). Whether dave is part of group staff is irrelevant here.

Note that these examples are for educational purposes only and you are unlikely to encounter file permissions like this in real life. There are simply no practical examples, why group permissions should be more permissive than owner permissions.

treuss
  • 282