xmnt/util/mount.go

17 lines
248 B
Go
Raw Normal View History

2022-10-07 02:19:04 +09:00
package util
import (
"path/filepath"
"regexp"
)
var mountPointPattern = regexp.MustCompile(`^/[\w/.-]*$`)
func IsValidMountPoint(mp string) bool {
if !mountPointPattern.MatchString(mp) {
return false
}
return filepath.Clean(mp) == mp
}