Bug 15186 - Allow permissions to be preserved when running as non-root
Summary: Allow permissions to be preserved when running as non-root
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-17 22:10 UTC by taaparthur
Modified: 2022-12-17 22:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Patch to allow permissions to be preserved as non-root (1.60 KB, application/octet-stream)
2022-12-17 22:10 UTC, taaparthur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description taaparthur 2022-12-17 22:10:47 UTC
Created attachment 9421 [details]
Patch to allow permissions to be preserved as non-root

Previously we explicitly checked our uid and if it wasn't 0, set ARCHIVE_DONT_RESTORE_PERM flag. There wasn't a lot of info in the commit message and this seems like a bug. 

This commit effectively reverts ebad0294c9 and adds a test.

For my usecase, I built and tar-ed a package and wanted to untar it into a chroot as a non-root user. busybox tar removed the setuid bit so programs like `su` broke.