Permission inherit strange in centos linux











up vote
1
down vote

favorite












System: CentOS release 6.4 (Final)



Problem: in same system have same umask: 022 but in /B/test/2018 folder have strange issue of inheritation when create folder and move file



test@CMS-OPER-01 ~]$ umask 
0022


Flow working:





  • Tomcat run as root:



    [test@CMS-OPER-01 ~]$ ps aux | grep tomcat
    root 15633 2.1 3.4 14387604 1118180 ? Sl 2017 2848:00 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:PermSize=256m -XX:MaxPermSize=256m -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start


  • Webapps do move file from folder /A/test/2018 to /B/test/2018



Storage mount in the system:



[test@OPER-01 201801]$
1.1.1.10:/hnas1-data01
200T 176T 25T 88% /A
1.1.1.11:/hnas1-data02
200T 72T 129T 36% /B


Parent folder same permission:



[test@OPER-01 -]$ getfacl /A/test/201801
getfacl: Removing leading '/' from absolute path names
# file: A/test/201801
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

[test@OPER-01 -]$ getfacl /B/test/201801
getfacl: Removing leading '/' from absolute path names
# file: B/test/201801
# owner: root
# group: root
user::rwx
group::r-x
other::r-x


Folder create in parent folder, and file moved have different permission although have same umask 022:



[test@OPER-01 -]$ getfacl /A/test/201801/*
# file: A/test/201801/197275
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

[test@OPER-01 -]$ getfacl /B/test/201801/*
# file: B/test/201801/197258
# owner: root
# group: root
user::rwx
group::r-x
other::--x









share|improve this question




























    up vote
    1
    down vote

    favorite












    System: CentOS release 6.4 (Final)



    Problem: in same system have same umask: 022 but in /B/test/2018 folder have strange issue of inheritation when create folder and move file



    test@CMS-OPER-01 ~]$ umask 
    0022


    Flow working:





    • Tomcat run as root:



      [test@CMS-OPER-01 ~]$ ps aux | grep tomcat
      root 15633 2.1 3.4 14387604 1118180 ? Sl 2017 2848:00 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:PermSize=256m -XX:MaxPermSize=256m -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start


    • Webapps do move file from folder /A/test/2018 to /B/test/2018



    Storage mount in the system:



    [test@OPER-01 201801]$
    1.1.1.10:/hnas1-data01
    200T 176T 25T 88% /A
    1.1.1.11:/hnas1-data02
    200T 72T 129T 36% /B


    Parent folder same permission:



    [test@OPER-01 -]$ getfacl /A/test/201801
    getfacl: Removing leading '/' from absolute path names
    # file: A/test/201801
    # owner: root
    # group: root
    user::rwx
    group::r-x
    other::r-x

    [test@OPER-01 -]$ getfacl /B/test/201801
    getfacl: Removing leading '/' from absolute path names
    # file: B/test/201801
    # owner: root
    # group: root
    user::rwx
    group::r-x
    other::r-x


    Folder create in parent folder, and file moved have different permission although have same umask 022:



    [test@OPER-01 -]$ getfacl /A/test/201801/*
    # file: A/test/201801/197275
    # owner: root
    # group: root
    user::rwx
    group::r-x
    other::r-x

    [test@OPER-01 -]$ getfacl /B/test/201801/*
    # file: B/test/201801/197258
    # owner: root
    # group: root
    user::rwx
    group::r-x
    other::--x









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      System: CentOS release 6.4 (Final)



      Problem: in same system have same umask: 022 but in /B/test/2018 folder have strange issue of inheritation when create folder and move file



      test@CMS-OPER-01 ~]$ umask 
      0022


      Flow working:





      • Tomcat run as root:



        [test@CMS-OPER-01 ~]$ ps aux | grep tomcat
        root 15633 2.1 3.4 14387604 1118180 ? Sl 2017 2848:00 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:PermSize=256m -XX:MaxPermSize=256m -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start


      • Webapps do move file from folder /A/test/2018 to /B/test/2018



      Storage mount in the system:



      [test@OPER-01 201801]$
      1.1.1.10:/hnas1-data01
      200T 176T 25T 88% /A
      1.1.1.11:/hnas1-data02
      200T 72T 129T 36% /B


      Parent folder same permission:



      [test@OPER-01 -]$ getfacl /A/test/201801
      getfacl: Removing leading '/' from absolute path names
      # file: A/test/201801
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x

      [test@OPER-01 -]$ getfacl /B/test/201801
      getfacl: Removing leading '/' from absolute path names
      # file: B/test/201801
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x


      Folder create in parent folder, and file moved have different permission although have same umask 022:



      [test@OPER-01 -]$ getfacl /A/test/201801/*
      # file: A/test/201801/197275
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x

      [test@OPER-01 -]$ getfacl /B/test/201801/*
      # file: B/test/201801/197258
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::--x









      share|improve this question















      System: CentOS release 6.4 (Final)



      Problem: in same system have same umask: 022 but in /B/test/2018 folder have strange issue of inheritation when create folder and move file



      test@CMS-OPER-01 ~]$ umask 
      0022


      Flow working:





      • Tomcat run as root:



        [test@CMS-OPER-01 ~]$ ps aux | grep tomcat
        root 15633 2.1 3.4 14387604 1118180 ? Sl 2017 2848:00 /usr/java/default/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:PermSize=256m -XX:MaxPermSize=256m -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start


      • Webapps do move file from folder /A/test/2018 to /B/test/2018



      Storage mount in the system:



      [test@OPER-01 201801]$
      1.1.1.10:/hnas1-data01
      200T 176T 25T 88% /A
      1.1.1.11:/hnas1-data02
      200T 72T 129T 36% /B


      Parent folder same permission:



      [test@OPER-01 -]$ getfacl /A/test/201801
      getfacl: Removing leading '/' from absolute path names
      # file: A/test/201801
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x

      [test@OPER-01 -]$ getfacl /B/test/201801
      getfacl: Removing leading '/' from absolute path names
      # file: B/test/201801
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x


      Folder create in parent folder, and file moved have different permission although have same umask 022:



      [test@OPER-01 -]$ getfacl /A/test/201801/*
      # file: A/test/201801/197275
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x

      [test@OPER-01 -]$ getfacl /B/test/201801/*
      # file: B/test/201801/197258
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::--x






      linux centos permissions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      Rui F Ribeiro

      38.2k1475123




      38.2k1475123










      asked Jan 20 at 6:53









      DatH

      62




      62






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          umask and default ACL (not present in your case) affect newly created objects only. I.e. for regular files some process has to execute open() (or mkdir() for directories.



          The permissions are determined at creation time (from the open() parameters, umask and maybe default ACLs) and stored in the inode.



          If a file is just moved (within a file system) then rename() is called instead and this syscall does not affect the inode at all, just where in the file system hierarchy it is shown.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f418403%2fpermission-inherit-strange-in-centos-linux%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            umask and default ACL (not present in your case) affect newly created objects only. I.e. for regular files some process has to execute open() (or mkdir() for directories.



            The permissions are determined at creation time (from the open() parameters, umask and maybe default ACLs) and stored in the inode.



            If a file is just moved (within a file system) then rename() is called instead and this syscall does not affect the inode at all, just where in the file system hierarchy it is shown.






            share|improve this answer

























              up vote
              0
              down vote













              umask and default ACL (not present in your case) affect newly created objects only. I.e. for regular files some process has to execute open() (or mkdir() for directories.



              The permissions are determined at creation time (from the open() parameters, umask and maybe default ACLs) and stored in the inode.



              If a file is just moved (within a file system) then rename() is called instead and this syscall does not affect the inode at all, just where in the file system hierarchy it is shown.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                umask and default ACL (not present in your case) affect newly created objects only. I.e. for regular files some process has to execute open() (or mkdir() for directories.



                The permissions are determined at creation time (from the open() parameters, umask and maybe default ACLs) and stored in the inode.



                If a file is just moved (within a file system) then rename() is called instead and this syscall does not affect the inode at all, just where in the file system hierarchy it is shown.






                share|improve this answer












                umask and default ACL (not present in your case) affect newly created objects only. I.e. for regular files some process has to execute open() (or mkdir() for directories.



                The permissions are determined at creation time (from the open() parameters, umask and maybe default ACLs) and stored in the inode.



                If a file is just moved (within a file system) then rename() is called instead and this syscall does not affect the inode at all, just where in the file system hierarchy it is shown.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 20 at 9:44









                Hauke Laging

                55k1283130




                55k1283130






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418403%2fpermission-inherit-strange-in-centos-linux%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

                    Entries order in /etc/network/interfaces

                    新発田市

                    Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)