Patch for #1226

Use `chown` to ensure the user maintains access to the file, even if it is owned by a different user. Setting permissions 0404/0400 blocks the user from accessing the file.