why setting acl for a user changes group perms in ls output?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















I'm trying to figure out why the output of ls command has changed. I mean group permissions for a file.



I've created a file named "file" and changed its owner&group:



[root@training group3]# touch file
[root@training group3]# ls -la file
-rw-r--r--. 1 root root 0 Sep 8 15:29 file
[root@training group3]# chown uczen file
[root@training group3]# chgrp group3 file
[root@training group3]# ls -la file
-rw-r--r--. 1 uczen group3 0 Sep 8 15:29 file
[root@training group3]# getfacl file
# file: file
# owner: uczen
# group: group3
user::rw-
group::r--
other::r--


Then I've added additional rwx rights for the user "ula":



[root@training group3]# setfacl -m u:ula:rwx file
[root@training group3]# getfacl file
# file: file
# owner: uczen
# group: group3
user::rw-
user:ula:rwx
group::r--
mask::rwx
other::r--


My question is why the output of ls -la command (below) shows now "rwx" for the group compared to "r--" shown by getfacl above. Why the perms for the group have been (seemingly?) changed if by setfacl I've only added rights for some user (ula)



[root@training group3]# ls -la file
-rw-rwxr--+ 1 uczen group3 0 Sep 8 15:29 file









share|improve this question





























    3















    I'm trying to figure out why the output of ls command has changed. I mean group permissions for a file.



    I've created a file named "file" and changed its owner&group:



    [root@training group3]# touch file
    [root@training group3]# ls -la file
    -rw-r--r--. 1 root root 0 Sep 8 15:29 file
    [root@training group3]# chown uczen file
    [root@training group3]# chgrp group3 file
    [root@training group3]# ls -la file
    -rw-r--r--. 1 uczen group3 0 Sep 8 15:29 file
    [root@training group3]# getfacl file
    # file: file
    # owner: uczen
    # group: group3
    user::rw-
    group::r--
    other::r--


    Then I've added additional rwx rights for the user "ula":



    [root@training group3]# setfacl -m u:ula:rwx file
    [root@training group3]# getfacl file
    # file: file
    # owner: uczen
    # group: group3
    user::rw-
    user:ula:rwx
    group::r--
    mask::rwx
    other::r--


    My question is why the output of ls -la command (below) shows now "rwx" for the group compared to "r--" shown by getfacl above. Why the perms for the group have been (seemingly?) changed if by setfacl I've only added rights for some user (ula)



    [root@training group3]# ls -la file
    -rw-rwxr--+ 1 uczen group3 0 Sep 8 15:29 file









    share|improve this question

























      3












      3








      3


      2






      I'm trying to figure out why the output of ls command has changed. I mean group permissions for a file.



      I've created a file named "file" and changed its owner&group:



      [root@training group3]# touch file
      [root@training group3]# ls -la file
      -rw-r--r--. 1 root root 0 Sep 8 15:29 file
      [root@training group3]# chown uczen file
      [root@training group3]# chgrp group3 file
      [root@training group3]# ls -la file
      -rw-r--r--. 1 uczen group3 0 Sep 8 15:29 file
      [root@training group3]# getfacl file
      # file: file
      # owner: uczen
      # group: group3
      user::rw-
      group::r--
      other::r--


      Then I've added additional rwx rights for the user "ula":



      [root@training group3]# setfacl -m u:ula:rwx file
      [root@training group3]# getfacl file
      # file: file
      # owner: uczen
      # group: group3
      user::rw-
      user:ula:rwx
      group::r--
      mask::rwx
      other::r--


      My question is why the output of ls -la command (below) shows now "rwx" for the group compared to "r--" shown by getfacl above. Why the perms for the group have been (seemingly?) changed if by setfacl I've only added rights for some user (ula)



      [root@training group3]# ls -la file
      -rw-rwxr--+ 1 uczen group3 0 Sep 8 15:29 file









      share|improve this question














      I'm trying to figure out why the output of ls command has changed. I mean group permissions for a file.



      I've created a file named "file" and changed its owner&group:



      [root@training group3]# touch file
      [root@training group3]# ls -la file
      -rw-r--r--. 1 root root 0 Sep 8 15:29 file
      [root@training group3]# chown uczen file
      [root@training group3]# chgrp group3 file
      [root@training group3]# ls -la file
      -rw-r--r--. 1 uczen group3 0 Sep 8 15:29 file
      [root@training group3]# getfacl file
      # file: file
      # owner: uczen
      # group: group3
      user::rw-
      group::r--
      other::r--


      Then I've added additional rwx rights for the user "ula":



      [root@training group3]# setfacl -m u:ula:rwx file
      [root@training group3]# getfacl file
      # file: file
      # owner: uczen
      # group: group3
      user::rw-
      user:ula:rwx
      group::r--
      mask::rwx
      other::r--


      My question is why the output of ls -la command (below) shows now "rwx" for the group compared to "r--" shown by getfacl above. Why the perms for the group have been (seemingly?) changed if by setfacl I've only added rights for some user (ula)



      [root@training group3]# ls -la file
      -rw-rwxr--+ 1 uczen group3 0 Sep 8 15:29 file






      linux permissions acl






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 8 '13 at 20:54









      ulaula

      182




      182






















          2 Answers
          2






          active

          oldest

          votes


















          6














          I don't remember where I found the rationale explained, but it's basically to avoid surprises.



          Most people are used to the three sets visible in ls describing all access that anyone may obtain. So if the "group" column retained its original meaning, it might create accidental security holes. For example, you have this file...



          -rw-rwxr--+ 1 uczen group3 0 Sep  8 15:29 file


          ...and you want to restrict anyone but the owner from writing it, so you run chmod go-w, and end up with this:



          -rw-r-xr--+ 1 uczen group3 0 Sep  8 15:29 file


          Now, if you're in a hurry, you might not notice the + sign of ACLs being present, or not know about its meaning. If there is an ACL allowing someone else to write to that file, you end up with the permissions being more open than expected.



          Note that this applies to programs as well, not just humans. Some programs – for example, ssh – check the Unix permission bits and require group/other to have no permissions at all. If the file had a permissive ACL, ssh wouldn't know it. (Even if someone updated OpenSSH to know about ACLs, older versions would still not know about them.)



          Because of this, POSIX ACLs have a special mask: entry to set the maximum of all permissions granted to the default group and to all ACL members, and the "group" field of Unix permissions is changed to display the value of mask: instead of the Unix group. For example, if you do chmod g=rx, you will actually set mask::rx.



          So if you see rw-r--r--+ there, you can be sure that nobody can write that file, regardless of what ACLs may be present, and without actually having to check them. Similarly, if a program sees a file having permissions 0600, it also can be sure of that without needing special knowledge about POSIX ACLs (and in the future RichACLs, NFSv4 ACLs, or other types – if they follow this special behavior).



          Notice that the getfacl output still lists the default group entry as group::r--. If you want to actually change that specific entry, you will need to do it using setfacl.



          See also:




          • Andreas Grünbacher, SuSE Labs, POSIX Access Control Lists on Linux






          share|improve this answer































            1














            The link in the above post is dead, and this one has a different answer: https://www.usenix.org/legacy/publications/library/proceedings/usenix03/tech/freenix03/full_papers/gruenbacher/gruenbacher_html/main.html



            Accordingly, the acl mask is shown in the group permissions field, instead of the group permissions being shown.



            Here is a better explanation: https://unix.stackexchange.com/questions/65888/setfacl-incorrectly-changes-group-permissions/498907#498907






            share|improve this answer


























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f642668%2fwhy-setting-acl-for-a-user-changes-group-perms-in-ls-output%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              6














              I don't remember where I found the rationale explained, but it's basically to avoid surprises.



              Most people are used to the three sets visible in ls describing all access that anyone may obtain. So if the "group" column retained its original meaning, it might create accidental security holes. For example, you have this file...



              -rw-rwxr--+ 1 uczen group3 0 Sep  8 15:29 file


              ...and you want to restrict anyone but the owner from writing it, so you run chmod go-w, and end up with this:



              -rw-r-xr--+ 1 uczen group3 0 Sep  8 15:29 file


              Now, if you're in a hurry, you might not notice the + sign of ACLs being present, or not know about its meaning. If there is an ACL allowing someone else to write to that file, you end up with the permissions being more open than expected.



              Note that this applies to programs as well, not just humans. Some programs – for example, ssh – check the Unix permission bits and require group/other to have no permissions at all. If the file had a permissive ACL, ssh wouldn't know it. (Even if someone updated OpenSSH to know about ACLs, older versions would still not know about them.)



              Because of this, POSIX ACLs have a special mask: entry to set the maximum of all permissions granted to the default group and to all ACL members, and the "group" field of Unix permissions is changed to display the value of mask: instead of the Unix group. For example, if you do chmod g=rx, you will actually set mask::rx.



              So if you see rw-r--r--+ there, you can be sure that nobody can write that file, regardless of what ACLs may be present, and without actually having to check them. Similarly, if a program sees a file having permissions 0600, it also can be sure of that without needing special knowledge about POSIX ACLs (and in the future RichACLs, NFSv4 ACLs, or other types – if they follow this special behavior).



              Notice that the getfacl output still lists the default group entry as group::r--. If you want to actually change that specific entry, you will need to do it using setfacl.



              See also:




              • Andreas Grünbacher, SuSE Labs, POSIX Access Control Lists on Linux






              share|improve this answer




























                6














                I don't remember where I found the rationale explained, but it's basically to avoid surprises.



                Most people are used to the three sets visible in ls describing all access that anyone may obtain. So if the "group" column retained its original meaning, it might create accidental security holes. For example, you have this file...



                -rw-rwxr--+ 1 uczen group3 0 Sep  8 15:29 file


                ...and you want to restrict anyone but the owner from writing it, so you run chmod go-w, and end up with this:



                -rw-r-xr--+ 1 uczen group3 0 Sep  8 15:29 file


                Now, if you're in a hurry, you might not notice the + sign of ACLs being present, or not know about its meaning. If there is an ACL allowing someone else to write to that file, you end up with the permissions being more open than expected.



                Note that this applies to programs as well, not just humans. Some programs – for example, ssh – check the Unix permission bits and require group/other to have no permissions at all. If the file had a permissive ACL, ssh wouldn't know it. (Even if someone updated OpenSSH to know about ACLs, older versions would still not know about them.)



                Because of this, POSIX ACLs have a special mask: entry to set the maximum of all permissions granted to the default group and to all ACL members, and the "group" field of Unix permissions is changed to display the value of mask: instead of the Unix group. For example, if you do chmod g=rx, you will actually set mask::rx.



                So if you see rw-r--r--+ there, you can be sure that nobody can write that file, regardless of what ACLs may be present, and without actually having to check them. Similarly, if a program sees a file having permissions 0600, it also can be sure of that without needing special knowledge about POSIX ACLs (and in the future RichACLs, NFSv4 ACLs, or other types – if they follow this special behavior).



                Notice that the getfacl output still lists the default group entry as group::r--. If you want to actually change that specific entry, you will need to do it using setfacl.



                See also:




                • Andreas Grünbacher, SuSE Labs, POSIX Access Control Lists on Linux






                share|improve this answer


























                  6












                  6








                  6







                  I don't remember where I found the rationale explained, but it's basically to avoid surprises.



                  Most people are used to the three sets visible in ls describing all access that anyone may obtain. So if the "group" column retained its original meaning, it might create accidental security holes. For example, you have this file...



                  -rw-rwxr--+ 1 uczen group3 0 Sep  8 15:29 file


                  ...and you want to restrict anyone but the owner from writing it, so you run chmod go-w, and end up with this:



                  -rw-r-xr--+ 1 uczen group3 0 Sep  8 15:29 file


                  Now, if you're in a hurry, you might not notice the + sign of ACLs being present, or not know about its meaning. If there is an ACL allowing someone else to write to that file, you end up with the permissions being more open than expected.



                  Note that this applies to programs as well, not just humans. Some programs – for example, ssh – check the Unix permission bits and require group/other to have no permissions at all. If the file had a permissive ACL, ssh wouldn't know it. (Even if someone updated OpenSSH to know about ACLs, older versions would still not know about them.)



                  Because of this, POSIX ACLs have a special mask: entry to set the maximum of all permissions granted to the default group and to all ACL members, and the "group" field of Unix permissions is changed to display the value of mask: instead of the Unix group. For example, if you do chmod g=rx, you will actually set mask::rx.



                  So if you see rw-r--r--+ there, you can be sure that nobody can write that file, regardless of what ACLs may be present, and without actually having to check them. Similarly, if a program sees a file having permissions 0600, it also can be sure of that without needing special knowledge about POSIX ACLs (and in the future RichACLs, NFSv4 ACLs, or other types – if they follow this special behavior).



                  Notice that the getfacl output still lists the default group entry as group::r--. If you want to actually change that specific entry, you will need to do it using setfacl.



                  See also:




                  • Andreas Grünbacher, SuSE Labs, POSIX Access Control Lists on Linux






                  share|improve this answer













                  I don't remember where I found the rationale explained, but it's basically to avoid surprises.



                  Most people are used to the three sets visible in ls describing all access that anyone may obtain. So if the "group" column retained its original meaning, it might create accidental security holes. For example, you have this file...



                  -rw-rwxr--+ 1 uczen group3 0 Sep  8 15:29 file


                  ...and you want to restrict anyone but the owner from writing it, so you run chmod go-w, and end up with this:



                  -rw-r-xr--+ 1 uczen group3 0 Sep  8 15:29 file


                  Now, if you're in a hurry, you might not notice the + sign of ACLs being present, or not know about its meaning. If there is an ACL allowing someone else to write to that file, you end up with the permissions being more open than expected.



                  Note that this applies to programs as well, not just humans. Some programs – for example, ssh – check the Unix permission bits and require group/other to have no permissions at all. If the file had a permissive ACL, ssh wouldn't know it. (Even if someone updated OpenSSH to know about ACLs, older versions would still not know about them.)



                  Because of this, POSIX ACLs have a special mask: entry to set the maximum of all permissions granted to the default group and to all ACL members, and the "group" field of Unix permissions is changed to display the value of mask: instead of the Unix group. For example, if you do chmod g=rx, you will actually set mask::rx.



                  So if you see rw-r--r--+ there, you can be sure that nobody can write that file, regardless of what ACLs may be present, and without actually having to check them. Similarly, if a program sees a file having permissions 0600, it also can be sure of that without needing special knowledge about POSIX ACLs (and in the future RichACLs, NFSv4 ACLs, or other types – if they follow this special behavior).



                  Notice that the getfacl output still lists the default group entry as group::r--. If you want to actually change that specific entry, you will need to do it using setfacl.



                  See also:




                  • Andreas Grünbacher, SuSE Labs, POSIX Access Control Lists on Linux







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 9 '13 at 0:10









                  grawitygrawity

                  244k37516576




                  244k37516576

























                      1














                      The link in the above post is dead, and this one has a different answer: https://www.usenix.org/legacy/publications/library/proceedings/usenix03/tech/freenix03/full_papers/gruenbacher/gruenbacher_html/main.html



                      Accordingly, the acl mask is shown in the group permissions field, instead of the group permissions being shown.



                      Here is a better explanation: https://unix.stackexchange.com/questions/65888/setfacl-incorrectly-changes-group-permissions/498907#498907






                      share|improve this answer






























                        1














                        The link in the above post is dead, and this one has a different answer: https://www.usenix.org/legacy/publications/library/proceedings/usenix03/tech/freenix03/full_papers/gruenbacher/gruenbacher_html/main.html



                        Accordingly, the acl mask is shown in the group permissions field, instead of the group permissions being shown.



                        Here is a better explanation: https://unix.stackexchange.com/questions/65888/setfacl-incorrectly-changes-group-permissions/498907#498907






                        share|improve this answer




























                          1












                          1








                          1







                          The link in the above post is dead, and this one has a different answer: https://www.usenix.org/legacy/publications/library/proceedings/usenix03/tech/freenix03/full_papers/gruenbacher/gruenbacher_html/main.html



                          Accordingly, the acl mask is shown in the group permissions field, instead of the group permissions being shown.



                          Here is a better explanation: https://unix.stackexchange.com/questions/65888/setfacl-incorrectly-changes-group-permissions/498907#498907






                          share|improve this answer















                          The link in the above post is dead, and this one has a different answer: https://www.usenix.org/legacy/publications/library/proceedings/usenix03/tech/freenix03/full_papers/gruenbacher/gruenbacher_html/main.html



                          Accordingly, the acl mask is shown in the group permissions field, instead of the group permissions being shown.



                          Here is a better explanation: https://unix.stackexchange.com/questions/65888/setfacl-incorrectly-changes-group-permissions/498907#498907







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 5 at 21:29

























                          answered Feb 5 at 14:56









                          user244488user244488

                          27825




                          27825






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f642668%2fwhy-setting-acl-for-a-user-changes-group-perms-in-ls-output%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Plaza Victoria

                              In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                              How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...