mirror of
https://github.com/Mic92/sops-nix.git
synced 2024-12-14 11:57:52 +00:00
fix(darwin): use chown only on non user mode
On the latest version of macOS (Ventura 13.4 as of this date), this change ownership will always fail with the error: > Failed to mount filesystem for secrets: Cannot change owner/group of '.../secrets.d' to 0/0: chown .../secrets.d: operation not permitted
This commit is contained in:
parent
d299d05382
commit
4ce3cc3428
1 changed files with 4 additions and 2 deletions
|
@ -102,8 +102,10 @@ func MountSecretFs(mountpoint string, keysGid int, userMode bool) error {
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if err := os.Chown(mountpoint, 0, int(keysGid)); err != nil {
|
if !userMode {
|
||||||
return fmt.Errorf("Cannot change owner/group of '%s' to 0/%d: %w", mountpoint, keysGid, err)
|
if err := os.Chown(mountpoint, 0, int(keysGid)); err != nil {
|
||||||
|
return fmt.Errorf("Cannot change owner/group of '%s' to 0/%d: %w", mountpoint, keysGid, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue