> How to avoid these issues? > > Overa...
# macos
f
How to avoid these issues?
Overall the best if the directory and the file permissions are aligned. Files in a given directory should follow the ownership and rights of the directory, in the cases we saw here, it would involve that processes running as 
root
 shouldn’t touch files in directories where the owner is someone else. If you really have to do that, you should protect the file with the 
uchg
 flag, so no one, beside a root could modify it. Although there would be still a race condition as for changing the file, the flag has to be lifted up, and then someone could change it.