Created
May 27, 2016 19:27
-
-
Save imcleod/cd32ad41d414471756763b7de36244f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| rm -rf contents | |
| mkdir -p contents/var/foo | |
| touch contents/var/foo/nested-file | |
| chmod a+x contents/var/foo/nested-file | |
| setcap cap_net_raw+ep contents/var/foo/nested-file | |
| cd contents | |
| echo "Attributes before tar" | |
| getfattr -d -m ".*" var/foo/nested-file | |
| rm -f ../f_no.tar | |
| tar --no-selinux -cf ../f_no.tar . | |
| cd .. | |
| rm -rf untar_contents | |
| mkdir untar_contents | |
| cd untar_contents | |
| tar --xattrs-include="*" -xf ../f_no.tar | |
| echo "Attributes of extracted file" | |
| getfattr -d -m ".*" var/foo/nested-file | |
| cd .. | |
| rm -rf f_no.tar contents untar_contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment