I've set the SUID & SGID bit on a folder belonging to user foo with sudo chmod g+s myfolder
& sudo chmod u+s myfolder
drwsr-sr-x 24 foo www-data 4,0K Okt 25 16:17 myfolder
Then I went inside and created a folder with sudo mkdir xyz
, but the user of the folder gets overwritten with root
while the group was protected successfully.
drwxr-sr-x 2 root www-data 4,0K Okt 25 16:24 xyz
I expect the user to be protected, it should stay at foo
after executing sudo mkdir xyz
. What have I missed?