linux - Permission denied when attempt to create/remove/rename files in write-only directory -
there tons of posts on net saying write permission on directory allows affected user create/remove/rename
files in directory, found not done without execute permission set. tried calling open/fopen/remove/rename
, without exception, failed.
there should missed or misunderstood. there explanation operations on directory involves file operation. if right, wonder operation involved. if directory maintains mappings filename inode, seems no reason file operation involved when renaming.
if unexpected file operation involved, possible manipulate directory directly, bypassing such operations?
you right, net full of wrong things , unix file permission rules. first links found common search engine wrong. interesting!
what file permissions on directories means:
x have "access" files in directory means can use them. if not have read access access rights, can work file know can't see!
mkdir 1 touch one/x.h chmod -r 1 ls 1 // fails! cat one/x.h // works!
and write permission used changing content of directory. adding , removing files dir possible if have write permission on dir!
because impossible read/write/execute file inside dir can't access, need access rights dir work files inside.
sounds bit strange, implemented way.
Comments
Post a Comment