agent007 wrote:Yeah, someone gave me the tar file and when I extracted it (in root) guess it found the User number and the files *belonged* to someone else....I wonder if this is a good feature..I mean by default why should it restore the permissions? ( even though in case of backups it maybe a plus point, but thats a different case alltogether)
As I mentioned. Don't extract archives as root if you don't want permissions to be restored. I rarely extract tar archives as root. There are other reasons for not extracting tar archives as root, as well as the general rule of thumb of not being root unless you absolutely have to. That reason is if the person that created the archive included leading slashes "/" then you could overwrite key system files if you are not careful. For instance, if you have an archive that includes the file "/etc/passwd" instead of "etc/passwd" or "./etc/passwd" then you will overwrite your real /etc/passwd when you extract it if you are root and do not take special precautions.
I believe it is a good default to extract permissions. I don't like an OS that babies me, takes too long to get stuff done.