Mailinglist Archive: opensuse (4288 mails)

< Previous Next >
Re: [SLE] Freaky File Owner:Group
  • From: Philip Amadeo Saeli <psaeli@xxxxxxxxxxxx>
  • Date: Sat, 4 May 2002 17:45:42 -0700
  • Message-id: <200205050045.g450jgx17943@xxxxxxxxxxxxxxxxxxx>
On Sunday, 05 May 2002 02:02:35 +0200, Anders Johansso wrote:
>I tested this, and tar xvf still gives the original uid/gid (when run as root,
>that is). Hmm, odd.

IIRC, the "p" option preserves the file mode (read, write, execute perms) and
times (mtime and atime, but not ctime), and will work for any user. However,
the original uid/gid will be extracted even -without- the "p" option for the
root user.

Another way to think of it is that tar -always- attempts to set the uid/gid of
the extracted files but can only accomplish it when there is sufficient
privilege to do that. In all other cases, the files retain the uid/gid of the
tar process, i.e., that of the user running it.

>Still, one shouldn't run things like compilations as root anyway.

So true! Once, being too lazy to set things up correctly, I compiled a SuSE
source RPM file as root and the "install" portion of the build (rpm -bb)
overwrote some system files on my system. Investigation showed the root of
the problem to be an incorrect setting for the build root in the spec file
[bad pun alert!] and things were being "installed" in / rather than in
/var/tmp! Fortunately, it only overwrote files that I was going to reinstall
anyway. However, if that RPM had been destined for another system ...

Phil

--
Philip A. Saeli
SuSE Linux 7.3
psaeli@xxxxxxxxxxxx

< Previous Next >