-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snap/unsquashfs: pass -xattrs-include ^user. #14906
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ func (s *Snap) Unpack(src, dstDir string) error { | |
usw := newUnsquashfsStderrWriter() | ||
|
||
var output bytes.Buffer | ||
cmd := exec.Command("unsquashfs", "-n", "-f", "-d", dstDir, s.path, src) | ||
cmd := exec.Command("unsquashfs", "-xattrs-include", "^user.", "-n", "-f", "-d", dstDir, s.path, src) | ||
cmd.Stderr = io.MultiWriter(&output, usw) | ||
if err := cmd.Run(); err != nil { | ||
return fmt.Errorf("cannot extract %q to %q: %v", src, dstDir, osutil.OutputErr(output.Bytes(), err)) | ||
|
@@ -234,7 +234,7 @@ func (s *Snap) withUnpackedFile(filePath string, f func(p string) error) error { | |
defer os.RemoveAll(tmpdir) | ||
|
||
unpackDir := filepath.Join(tmpdir, "unpack") | ||
if output, err := exec.Command("unsquashfs", "-n", "-i", "-d", unpackDir, s.path, filePath).CombinedOutput(); err != nil { | ||
if output, err := exec.Command("unsquashfs", "-xattrs-include", "^user.", "-n", "-i", "-d", unpackDir, s.path, filePath).CombinedOutput(); err != nil { | ||
return fmt.Errorf("cannot run unsquashfs: %v", osutil.OutputErr(output, err)) | ||
} | ||
|
||
|
@@ -419,7 +419,7 @@ func (s *Snap) Walk(relative string, walkFn filepath.WalkFunc) error { | |
// ListDir returns the content of a single directory inside a squashfs snap. | ||
func (s *Snap) ListDir(dirPath string) ([]string, error) { | ||
output, stderr, err := osutil.RunSplitOutput( | ||
"unsquashfs", "-no-progress", "-dest", "_", "-l", s.path, dirPath) | ||
"unsquashfs", "-xattrs-include", "^user.", "-no-progress", "-dest", "_", "-l", s.path, dirPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need it with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, probably not, that was overeager. |
||
if err != nil { | ||
return nil, osutil.OutputErrCombine(output, stderr, err) | ||
} | ||
|
@@ -640,7 +640,7 @@ func BuildDate(path string) time.Time { | |
N: 1, | ||
} | ||
|
||
cmd := exec.Command("unsquashfs", "-n", "-s", path) | ||
cmd := exec.Command("unsquashfs", "-xattrs-include", "^user.", "-n", "-s", path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also here with |
||
cmd.Env = []string{"TZ=UTC"} | ||
cmd.Stdout = m | ||
cmd.Stderr = m | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not supported by old versions of unsquashfs. We will need to see if we can drop all xattrs or if we need more elaborate logic.