Skip to content

Commit

Permalink
internal: enable XattrPrivileged for untar to fix selinux issue
Browse files Browse the repository at this point in the history
To be able to extract tarballs with selinux contexts, torcx needs to
turn on `XattrPrivileged`, because the default `XattrUser` option
is able to extract only selinux contexts starting with `user` prefix.

See also:
flatcar-archive/coreos-overlay#55
flatcar/scripts#16
  • Loading branch information
Dongsu Park committed Jul 31, 2019
1 parent e1ded85 commit 364a355
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/torcx/perform.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ func unpackTgz(applyCfg *ApplyConfig, tgzPath, imageName string) (string, error)

tr := tar.NewReader(gr)
untarCfg := pkgtar.ExtractCfg{}.Default()
untarCfg.XattrPrivileged = true
err = pkgtar.ChrootUntar(tr, topDir, untarCfg)
if err != nil {
return "", errors.Wrapf(err, "unpacking %q", tgzPath)
Expand Down

0 comments on commit 364a355

Please sign in to comment.