If a .reg function is accessed through a symlink then write directly to the file rather than replacing it with a temp file. This preserves ownership and permissions.