I have here a POSIX tar archive call Debian9.ova.

Interestingly enough, listing it with tar in MacOS High Sierra, shows:

$ tar -tvf Debian9.ova 
-rw-r--r--  0 someone someone  5344 26 Feb 13:57 Debian9.ovf
-rw-r--r--  0 someone someone   179 26 Feb 13:57 Debian9.mf
-rw-r--r--  0 someone someone 2113245184 26 Feb 13:59 Debian9-disk1.vmdk

Now the interesting point is, that I do not have a someone user and group.

$ id someone
id: someone: no such user

Listing it with --numeric-owner, it shows as uid 64, and gid 64, which clearly are not present in my system.

$ tar -tvf Debian9.ova --numeric-owner
-rw-r--r--  0 64     64       5344 26 Feb 13:57 Debian9.ovf
-rw-r--r--  0 64     64        179 26 Feb 13:57 Debian9.mf
-rw-r--r--  0 64     64 2113245184 26 Feb 13:59 Debian9-disk1.vmdk

Listing the users in the system does not find a somebody user:

dscl . list  /Users | grep someone

Where is then someone coming from? Is it a tar "feature" when it finds an unknown uid and gid?

PS. In debian just for comparison:

$ tar -tvf a.tar
-rw-r--r-- 64/64          3212 2018-02-27 02:01 dead.letter
$ bsdtar -tvf a.tar
-rw-r--r--  0 64     64       3212 Feb 27 02:01 dead.letter

I have here a POSIX tar archive […]

In a standard format tar archive, the header information for each file contains fields for both a symbolic user and group name and a numeric user and group ID.

As you have seen, tar can list either one set of fields or the other.

With a conformant pax utility one should be able to list these fields altogether:

$ pax -o listopt="%(uid)s %(gid)s %(uname)s %(gname)s %L\n" < Debian9.ova

However, I believe that no standard-conformant pax utility currently exists.

Further reading

  • "ustar header block". pax. Single Unix Specification. IEEE 1003.1-2008:2016.
  • Tim Kientzle (2016-12-27). tar. § 5. FreeBSD File Formats Manual.
  • A conforming pax implementation dumps core with your proposed command line. Use listopt="%(uid)d %(gid)d %(uname)s %(gname)s %L\n" on Solaris, AIX, HP-UX and it will work. – schily May 31 '18 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.