Permission changes after extracting tgz file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
7
down vote

favorite












While extracting a tgz file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games



[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz


What is the issue here?







share|improve this question

















  • 1




    consider gnu tar's --no-same-owner
    – Jeff Schaller
    Jul 19 at 14:44
















up vote
7
down vote

favorite












While extracting a tgz file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games



[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz


What is the issue here?







share|improve this question

















  • 1




    consider gnu tar's --no-same-owner
    – Jeff Schaller
    Jul 19 at 14:44












up vote
7
down vote

favorite









up vote
7
down vote

favorite











While extracting a tgz file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games



[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz


What is the issue here?







share|improve this question













While extracting a tgz file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games



[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz


What is the issue here?









share|improve this question












share|improve this question




share|improve this question








edited Jul 19 at 14:22









Anderson

987




987









asked Jul 19 at 12:26









mahmood

291515




291515







  • 1




    consider gnu tar's --no-same-owner
    – Jeff Schaller
    Jul 19 at 14:44












  • 1




    consider gnu tar's --no-same-owner
    – Jeff Schaller
    Jul 19 at 14:44







1




1




consider gnu tar's --no-same-owner
– Jeff Schaller
Jul 19 at 14:44




consider gnu tar's --no-same-owner
– Jeff Schaller
Jul 19 at 14:44










1 Answer
1






active

oldest

votes

















up vote
15
down vote



accepted










The tarball contains a scalapack-2.0.2 directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running



tar tvf scalapack-2.0.2.tgz


Tar archives store ownership and permissions in addition to the file contents; since you’re extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.



Since you’re running CentOS, you’re presumably running GNU tar, and you can use the --no-same-owner and --no-same-permissions options to extract tarballs without applying the stored ownership and permissions. Other tar implementations may have similar options (e.g. -o on FreeBSD tar).






share|improve this answer























  • POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
    – Jörg W Mittag
    Jul 19 at 22:57










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457203%2fpermission-changes-after-extracting-tgz-file%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
15
down vote



accepted










The tarball contains a scalapack-2.0.2 directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running



tar tvf scalapack-2.0.2.tgz


Tar archives store ownership and permissions in addition to the file contents; since you’re extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.



Since you’re running CentOS, you’re presumably running GNU tar, and you can use the --no-same-owner and --no-same-permissions options to extract tarballs without applying the stored ownership and permissions. Other tar implementations may have similar options (e.g. -o on FreeBSD tar).






share|improve this answer























  • POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
    – Jörg W Mittag
    Jul 19 at 22:57














up vote
15
down vote



accepted










The tarball contains a scalapack-2.0.2 directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running



tar tvf scalapack-2.0.2.tgz


Tar archives store ownership and permissions in addition to the file contents; since you’re extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.



Since you’re running CentOS, you’re presumably running GNU tar, and you can use the --no-same-owner and --no-same-permissions options to extract tarballs without applying the stored ownership and permissions. Other tar implementations may have similar options (e.g. -o on FreeBSD tar).






share|improve this answer























  • POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
    – Jörg W Mittag
    Jul 19 at 22:57












up vote
15
down vote



accepted







up vote
15
down vote



accepted






The tarball contains a scalapack-2.0.2 directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running



tar tvf scalapack-2.0.2.tgz


Tar archives store ownership and permissions in addition to the file contents; since you’re extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.



Since you’re running CentOS, you’re presumably running GNU tar, and you can use the --no-same-owner and --no-same-permissions options to extract tarballs without applying the stored ownership and permissions. Other tar implementations may have similar options (e.g. -o on FreeBSD tar).






share|improve this answer















The tarball contains a scalapack-2.0.2 directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running



tar tvf scalapack-2.0.2.tgz


Tar archives store ownership and permissions in addition to the file contents; since you’re extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.



Since you’re running CentOS, you’re presumably running GNU tar, and you can use the --no-same-owner and --no-same-permissions options to extract tarballs without applying the stored ownership and permissions. Other tar implementations may have similar options (e.g. -o on FreeBSD tar).







share|improve this answer















share|improve this answer



share|improve this answer








edited Jul 19 at 16:04


























answered Jul 19 at 12:27









Stephen Kitt

139k22296359




139k22296359











  • POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
    – Jörg W Mittag
    Jul 19 at 22:57
















  • POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
    – Jörg W Mittag
    Jul 19 at 22:57















POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
– Jörg W Mittag
Jul 19 at 22:57




POSIX pax has the (standardized) option -p p (preserve only permissions) for that.
– Jörg W Mittag
Jul 19 at 22:57












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457203%2fpermission-changes-after-extracting-tgz-file%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay