fix: firejail integration
use buildContents for correct handling symlinks
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||||
<text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
<text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||||
<text x="33.5" y="14">coverage</text>
|
<text x="33.5" y="14">coverage</text>
|
||||||
<text x="86" y="15" fill="#010101" fill-opacity=".3">19.2%</text>
|
<text x="86" y="15" fill="#010101" fill-opacity=".3">19.4%</text>
|
||||||
<text x="86" y="14">19.2%</text>
|
<text x="86" y="14">19.4%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B |
@ -240,39 +240,10 @@ func createFirejailedBinary(
|
|||||||
return nil, fmt.Errorf("failed to create wrapper script: %w", err)
|
return nil, fmt.Errorf("failed to create wrapper script: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
profile, err := getContentFromPath(dest, dirs.PkgDir)
|
return buildContents(pkg, dirs, &[]string{
|
||||||
if err != nil {
|
origFilePath,
|
||||||
return nil, err
|
dest,
|
||||||
}
|
})
|
||||||
|
|
||||||
bin, err := getContentFromPath(origFilePath, dirs.PkgDir)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return []*files.Content{
|
|
||||||
bin,
|
|
||||||
profile,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func getContentFromPath(path, base string) (*files.Content, error) {
|
|
||||||
absPath := filepath.Join(base, path)
|
|
||||||
|
|
||||||
fi, err := os.Lstat(absPath)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("failed to get file info: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &files.Content{
|
|
||||||
Source: absPath,
|
|
||||||
Destination: path,
|
|
||||||
FileInfo: &files.ContentFileInfo{
|
|
||||||
MTime: fi.ModTime(),
|
|
||||||
Mode: fi.Mode(),
|
|
||||||
Size: fi.Size(),
|
|
||||||
},
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateSafeName(destination string) (string, error) {
|
func generateSafeName(destination string) (string, error) {
|
||||||
|
Reference in New Issue
Block a user