Details
Description
No authorization checks should be made when a user tries to create (mkdirs -p) an existing folder hierarchy.
For example, if we start with /home/hdiuser/prefix pre-created, and do the following operations, the results should be as shown below.
hdiuser@hn0-0d2f67:~$ sudo chown root:root prefix hdiuser@hn0-0d2f67:~$ sudo chmod 555 prefix hdiuser@hn0-0d2f67:~$ ls -l dr-xr-xr-x 3 root root 4096 Aug 29 08:25 prefix hdiuser@hn0-0d2f67:~$ mkdir -p /home hdiuser@hn0-0d2f67:~$ mkdir -p /home/hdiuser hdiuser@hn0-0d2f67:~$ mkdir -p /home/hdiuser/prefix hdiuser@hn0-0d2f67:~$ mkdir -p /home/hdiuser/prefix/1 mkdir: cannot create directory â/home/hdiuser/prefix/1â: Permission denied The first three mkdirs succeed, because the ancestor is already present. The fourth one fails because of a permission check against the (shorter) ancestor (as compared to the path being created).