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 starts 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 710b2b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/torcx/perform.go
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 710b2b6

Please sign in to comment.