Fixed #1264 - permission error in kubernetes (#1265)

This commit is contained in:
hashfunc 2025-02-21 02:50:42 +09:00 committed by GitHub
parent 299ec932fc
commit 5b050e5cbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ fn maybe_apply_permissions<P: AsRef<Path>>(
permissions: std::fs::Permissions,
) -> std::io::Result<()> {
let current = std::fs::metadata(&path)?.permissions();
if current != permissions {
if (current.mode() & 0o777) != permissions.mode() {
std::fs::set_permissions(path, permissions)?;
}
Ok(())