Find the answer to your Linux question:
Results 1 to 3 of 3
I'm reading the excellent "rute" Linux tutorial from cover to cover and it is worth its weight in gold! I'm running ArchLinux w/ bash. But there is something that came ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3

    File owner can't execute file with g+x perms only even if member of owning grp

    I'm reading the excellent "rute" Linux tutorial from cover to cover and it is worth its weight in gold!

    I'm running ArchLinux w/ bash.

    But there is something that came up in my current chapter that seems strange.

    I compiled a simple "Hello World" console executable using a regular user (we'll call him "user1").

    user1 is part of the "user1" group as well.

    The file (a.out) is owned by user "user1" and group "user1."

    Then, using root, I cleared all permissions except group execute (------x---).

    Now I also have another user on the system. We'll call him "foo." Foo is NOT a member of his own group, but part of the "user1" group.

    If I login to the system as foo and run a.out, it works. I presume that is because I am a member of the group that owns the file.

    But if I login as user1 and try to run the file, "Permission Denied."

    Now of course I have turned off all access for the file's owner at the user level.

    BUT, I am still a member of the user1 group. And I can't run it?

    Extrapolating a little bit, it would seem that if I was able to run the file, then user permissions really would be irrelevant since groups could "circumvent" users.

    So then it would appear there is some kind of precedence being enforced that prevents failure at one level to go to the next?

    I just got confused because my understanding of the file's permissions said that no one but members of the group owning the file could run it.

    user1 was a member of the group. And I couldn't run it?

    Many thanks in advance for any insight!

    -gabe

  2. #2
    Just Joined!
    Join Date
    May 2008
    Posts
    36
    Your question got me curious about this too, so I visited the repository of all knowledge (Wikipedia) and there in the Filesystem permissions article, I found this:

    the user who is the owner of the file will have the permissions given to the owner class regardless of the permissions assigned to the group class or others class.
    So yes, it seems that there is a preference:
    If you are the owner, only the owner permissions apply to you,
    otherwise, if you are a member of the group only the group permissions apply,
    otherwise only the "other" permissions apply.

  3. #3
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    trutheality-

    Many thanks for your help! Answer is cut-and-dry; just the way I like 'em

    -gabe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...