you must create it with the right permissions to begin with. Else you have race condition where a unprivileged user could write to the file before the permissions are changed.
you must create it with the right permissions to begin with.
Else you have race condition where a unprivileged user could write to the file before the permissions are changed.