简体   繁体   中英

Why in nautilus you can access directories without execution privileges, and in terminal you can't?

When I remove execution privileges (and just leave it with r) from a directory using

chmod 400 sampledir

and try to acces with

cd sampledir

it says permission denied, but if I use nautilus to open it, i can open it and see its contents, Why is that? I read in some place that i terminal you have to execute the directory and the directory will lists its contents, but I think when you use cd, cd is the program and the directory name would be the parametter. That is just an hipothesis becouse i've been reading on google and i cannot understand yet. Thanks a lot for any help.

chdir(2) requires search (execute) permissions on every component in the path. open(2) and readdir(3) do not. By not attempting to change the process' working directory, nautilus bypasses the execute permission requirement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM