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

Clash 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
- Is this behavior consistent across different distributions or described in some standard?
- 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
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.
add a comment |Â
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
- Is this behavior consistent across different distributions or described in some standard?
- 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
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.
add a comment |Â
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
- Is this behavior consistent across different distributions or described in some standard?
- 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
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
- Is this behavior consistent across different distributions or described in some standard?
- 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
permissions directory sticky-bit
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.
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.
add a comment |Â
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered 5 mins ago
schily
10.4k31640
10.4k31640
add a comment |Â
add a comment |Â
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.
David Chen is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password