Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 927560 - app-arch/rpm2targz: user and group in resulting tarball are the current user, rather than root
Summary: app-arch/rpm2targz: user and group in resulting tarball are the current user,...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-22 23:22 UTC by AI0867
Modified: 2024-03-24 14:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to set uid and gid to 0 (0001-Set-user-and-group-to-0.patch,612 bytes, patch)
2024-03-22 23:22 UTC, AI0867
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description AI0867 2024-03-22 23:22:49 UTC
Created attachment 888227 [details, diff]
Patch to set uid and gid to 0

rpm2targz unpacks the rpm into a temporary directory and then creates a tarball from that directory. That means the files are at that point owned by the user running the tool.

For my usecase (which I'm guessing is the most common one: deploying rpm-packaged software to a system that lacks a package manager), this means you have to make sure you run the command as root, pass --no-same-owner when extracting (not all tar implementations have that option) or chown the extracted files afterwards.

I've instead patched the script to pass --owner=0 and --group=0 to tar, so the files are owned by root.

Given that for all users besides root, file ownership is ignored when untarring, this does not seem like it will break any other usecases.

The package appears to be maintained in one of the gentoo repositories, but I have no idea how to make a pull request there, so I'm submitting the patch here.