Permission needed to create/remove file in a directory with sticky bit set

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I understand that creating/removing a file from a directory with sticky bit set requires one of the followings



  • you are root

  • you are the owner of the file

  • you are the owner of the directory

and you must also have +w on the directory.



The problem is with +x on the directory. I understand that if sticky bit of the directory is not set, +x is needed to create/remove files in it. However, my prof says that if the sticky bit is set, +x is not needed.



I tried it on Ubuntu 16.04, and it seems that +x is still needed even when the sticky bit is set.



Bob@david-VirtualBox:/home/Alice$ ls -ld InBox/
drwx----wT 2 Alice Alice 4096 十一 7 01:09 InBox/
Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
touch: cannot touch 'InBox/some_file': Permission denied
Bob@david-VirtualBox:/home/Alice$ rm InBox/link
rm: cannot remove 'InBox/link': Permission denied
Bob@david-VirtualBox:/home/Alice$ su Alice
Password:
Alice@david-VirtualBox:~$ chmod 1703 InBox/
Alice@david-VirtualBox:~$ su Bob
Password:
Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
Bob@david-VirtualBox:/home/Alice$ rm InBox/link
Bob@david-VirtualBox:/home/Alice$


My problem



  1. Is this behavior consistent across different distributions or described in some standard?

  2. I tried to google, but most resources about sticky bit on directory emphasize the 3 points mentioned above. I'd like to know if there is some (historical?) reason why my prof says so.

In case somebody asks, I would have asked my prof directly if he replies my email :(



Thank you in advance.









share







New contributor




David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I understand that creating/removing a file from a directory with sticky bit set requires one of the followings



    • you are root

    • you are the owner of the file

    • you are the owner of the directory

    and you must also have +w on the directory.



    The problem is with +x on the directory. I understand that if sticky bit of the directory is not set, +x is needed to create/remove files in it. However, my prof says that if the sticky bit is set, +x is not needed.



    I tried it on Ubuntu 16.04, and it seems that +x is still needed even when the sticky bit is set.



    Bob@david-VirtualBox:/home/Alice$ ls -ld InBox/
    drwx----wT 2 Alice Alice 4096 十一 7 01:09 InBox/
    Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
    touch: cannot touch 'InBox/some_file': Permission denied
    Bob@david-VirtualBox:/home/Alice$ rm InBox/link
    rm: cannot remove 'InBox/link': Permission denied
    Bob@david-VirtualBox:/home/Alice$ su Alice
    Password:
    Alice@david-VirtualBox:~$ chmod 1703 InBox/
    Alice@david-VirtualBox:~$ su Bob
    Password:
    Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
    Bob@david-VirtualBox:/home/Alice$ rm InBox/link
    Bob@david-VirtualBox:/home/Alice$


    My problem



    1. Is this behavior consistent across different distributions or described in some standard?

    2. I tried to google, but most resources about sticky bit on directory emphasize the 3 points mentioned above. I'd like to know if there is some (historical?) reason why my prof says so.

    In case somebody asks, I would have asked my prof directly if he replies my email :(



    Thank you in advance.









    share







    New contributor




    David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I understand that creating/removing a file from a directory with sticky bit set requires one of the followings



      • you are root

      • you are the owner of the file

      • you are the owner of the directory

      and you must also have +w on the directory.



      The problem is with +x on the directory. I understand that if sticky bit of the directory is not set, +x is needed to create/remove files in it. However, my prof says that if the sticky bit is set, +x is not needed.



      I tried it on Ubuntu 16.04, and it seems that +x is still needed even when the sticky bit is set.



      Bob@david-VirtualBox:/home/Alice$ ls -ld InBox/
      drwx----wT 2 Alice Alice 4096 十一 7 01:09 InBox/
      Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
      touch: cannot touch 'InBox/some_file': Permission denied
      Bob@david-VirtualBox:/home/Alice$ rm InBox/link
      rm: cannot remove 'InBox/link': Permission denied
      Bob@david-VirtualBox:/home/Alice$ su Alice
      Password:
      Alice@david-VirtualBox:~$ chmod 1703 InBox/
      Alice@david-VirtualBox:~$ su Bob
      Password:
      Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
      Bob@david-VirtualBox:/home/Alice$ rm InBox/link
      Bob@david-VirtualBox:/home/Alice$


      My problem



      1. Is this behavior consistent across different distributions or described in some standard?

      2. I tried to google, but most resources about sticky bit on directory emphasize the 3 points mentioned above. I'd like to know if there is some (historical?) reason why my prof says so.

      In case somebody asks, I would have asked my prof directly if he replies my email :(



      Thank you in advance.









      share







      New contributor




      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I understand that creating/removing a file from a directory with sticky bit set requires one of the followings



      • you are root

      • you are the owner of the file

      • you are the owner of the directory

      and you must also have +w on the directory.



      The problem is with +x on the directory. I understand that if sticky bit of the directory is not set, +x is needed to create/remove files in it. However, my prof says that if the sticky bit is set, +x is not needed.



      I tried it on Ubuntu 16.04, and it seems that +x is still needed even when the sticky bit is set.



      Bob@david-VirtualBox:/home/Alice$ ls -ld InBox/
      drwx----wT 2 Alice Alice 4096 十一 7 01:09 InBox/
      Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
      touch: cannot touch 'InBox/some_file': Permission denied
      Bob@david-VirtualBox:/home/Alice$ rm InBox/link
      rm: cannot remove 'InBox/link': Permission denied
      Bob@david-VirtualBox:/home/Alice$ su Alice
      Password:
      Alice@david-VirtualBox:~$ chmod 1703 InBox/
      Alice@david-VirtualBox:~$ su Bob
      Password:
      Bob@david-VirtualBox:/home/Alice$ touch InBox/some_file
      Bob@david-VirtualBox:/home/Alice$ rm InBox/link
      Bob@david-VirtualBox:/home/Alice$


      My problem



      1. Is this behavior consistent across different distributions or described in some standard?

      2. I tried to google, but most resources about sticky bit on directory emphasize the 3 points mentioned above. I'd like to know if there is some (historical?) reason why my prof says so.

      In case somebody asks, I would have asked my prof directly if he replies my email :(



      Thank you in advance.







      permissions directory sticky-bit





      share







      New contributor




      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 7 mins ago









      David Chen

      1334




      1334




      New contributor




      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      David Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Your professor is wrong:



          If you like to remove something from a directory you need the so called "search permission" and this is granted by the x bit on the directory.



          If you don't have the x bit, you are not allowed to verify whether the file to be removed is present.





          share




















            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
            );



            );






            David Chen is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480186%2fpermission-needed-to-create-remove-file-in-a-directory-with-sticky-bit-set%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Your professor is wrong:



            If you like to remove something from a directory you need the so called "search permission" and this is granted by the x bit on the directory.



            If you don't have the x bit, you are not allowed to verify whether the file to be removed is present.





            share
























              up vote
              0
              down vote













              Your professor is wrong:



              If you like to remove something from a directory you need the so called "search permission" and this is granted by the x bit on the directory.



              If you don't have the x bit, you are not allowed to verify whether the file to be removed is present.





              share






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Your professor is wrong:



                If you like to remove something from a directory you need the so called "search permission" and this is granted by the x bit on the directory.



                If you don't have the x bit, you are not allowed to verify whether the file to be removed is present.





                share












                Your professor is wrong:



                If you like to remove something from a directory you need the so called "search permission" and this is granted by the x bit on the directory.



                If you don't have the x bit, you are not allowed to verify whether the file to be removed is present.






                share











                share


                share










                answered 5 mins ago









                schily

                10.4k31640




                10.4k31640




















                    David Chen is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    David Chen is a new contributor. Be nice, and check out our Code of Conduct.












                    David Chen is a new contributor. Be nice, and check out our Code of Conduct.











                    David Chen is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480186%2fpermission-needed-to-create-remove-file-in-a-directory-with-sticky-bit-set%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)