mirror of
https://github.com/siderolabs/talos.git
synced 2025-12-07 18:41:33 +01:00
feat: allow hardlinks in the system extension images
They should cause no harm as every extension as an image on its own, so hardlinks are only available between the files in one image only. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
parent
1e982808fb
commit
58cb9db1e2
@ -10,7 +10,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
hashiversion "github.com/hashicorp/go-version"
|
||||
|
||||
@ -70,18 +69,6 @@ func (ext *Extension) validateContents() error {
|
||||
return fmt.Errorf("world-writeable files are not allowed: %q", itemPath)
|
||||
}
|
||||
|
||||
var st fs.FileInfo
|
||||
|
||||
st, err = d.Info()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// no hardlinks
|
||||
if !d.IsDir() && st.Sys().(*syscall.Stat_t).Nlink > 1 {
|
||||
return fmt.Errorf("hardlinks are not allowed: %q", itemPath)
|
||||
}
|
||||
|
||||
// no special files
|
||||
if !d.IsDir() && !d.Type().IsRegular() && d.Type().Type() != os.ModeSymlink {
|
||||
return fmt.Errorf("special files are not allowed: %q", itemPath)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user