Debians deb packages are simple things, all files the package is going to install is stored in an archive.
This archive contains the full tree of files, and also their permissions and ownership data. During install, the archive is extracted into the root filesystem as is.
An Example
The package fping contains an archive with the follwing files:
/usr/bin/fping
/usr/bin/fping6
/usr/share/doc/fping/README
/usr/share/doc/fping/changelog.Debian.gz
/usr/share/doc/fping/changelog.gz
/usr/share/doc/fping/copyright
/usr/share/lintian/overrides/fping
/usr/share/man/man8/fping.8.gz
/usr/share/man/man8/fping6.8.gz
Permissions and owner data (with owner almost always beeing root) is only taken from the archive.
With that in mind, it is impossible to extract the archive with correct ownership preserved without having superuser privileges. Without any knowlegde of the inner workings of rpm and alien, i'd guess alien is extracting the source archive during convert.
Answering your questions:
How are the file ownerships different when run as root vs. a normal user?
Normal users can only create files they self own, and cannot change ownership of files.
Why does file ownership in a package matter?
Maybe it does, maybe it doesn't. Remember: Without beiing root, the files will be owned by the uid who converted the package. While not beeing good practice having unprivileged user install binaries in /usr/bin , it might work. But it will break when the stuff installed has to be owner by root.
Back to the example, fping needs to be setuid root to work -> package broken due wrong ownership.
3I would suspect to need root so you can apply the proper permissions on the new file so that they match the source. – Ƭᴇcʜιᴇ007 – 2014-06-28T19:40:52.257
@techie007 Thanks for sharing your suspicions! I don't think the ownership of the
.rpm
archive matters, though. More specifically, aren't the file permissions assigned by the package manager when it reads that information from the.rpm
spec file during the extraction and installation process? – kdbanman – 2014-06-29T03:04:39.210