gopass/pkg/tempfile/mount_linux.go
Dominik Schulz 71861e4a8b
chore: Update golangci-lint (#3287)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-11-12 21:09:26 +01:00

36 lines
656 B
Go

//go:build linux
package tempfile
import (
"context"
"os"
"golang.org/x/sys/unix"
)
var shmDir = "/dev/shm"
// tempdir returns a temporary directory suiteable for sensitive data. It tries
// /dev/shm but if this isn't working it will return an empty string. Using
// this with ioutil.Tempdir will ensure that we're getting the "best" tempdir.
func tempdirBase() string {
if fi, err := os.Stat(shmDir); err == nil {
if fi.IsDir() {
if unix.Access(shmDir, unix.W_OK) == nil {
return shmDir
}
}
}
return ""
}
func (t *File) mount(context.Context) error {
return nil
}
func (t *File) unmount(context.Context) error {
return nil
}