fix 32-bit build

This commit is contained in:
Jörg Thalheim 2021-02-01 09:25:59 +01:00
parent b37a5b9a45
commit d665aecd88
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4
2 changed files with 14 additions and 2 deletions

View file

@ -251,7 +251,7 @@ func decryptSecrets(secrets []secret) error {
return nil
}
const RAMFS_MAGIC = 0x858458f6
const RAMFS_MAGIC int32 = -2054924042
func mountSecretFs(mountpoint string, keysGid int) error {
if err := os.MkdirAll(mountpoint, 0750); err != nil {
@ -262,7 +262,7 @@ func mountSecretFs(mountpoint string, keysGid int) error {
if err := unix.Statfs(mountpoint, &buf); err != nil {
return fmt.Errorf("Cannot get statfs for directory '%s': %w", mountpoint, err)
}
if buf.Type != RAMFS_MAGIC {
if int32(buf.Type) != RAMFS_MAGIC {
if err := unix.Mount("none", mountpoint, "ramfs", unix.MS_NODEV|unix.MS_NOSUID, "mode=0750"); err != nil {
return fmt.Errorf("Cannot mount: %s", err)
}