When fs.protected_regular=1 root cannot open temp files that are owned by other users read-write. So unlink temporary file before shutil.copy to it. Fixes: https://pagure.io/freeipa/issue/7907 Signed-off-by: François Cami fcami@redhat.com Reviewed-By: Christian Heimes <cheimes@redhat.com>