Skip to content

tar: mimic fakeroot behaviour#22

Merged
mholt merged 1 commit intomholt:mainfrom
M0Rf30:chore/fakeroot
Mar 26, 2025
Merged

tar: mimic fakeroot behaviour#22
mholt merged 1 commit intomholt:mainfrom
M0Rf30:chore/fakeroot

Conversation

@M0Rf30
Copy link
Contributor

@M0Rf30 M0Rf30 commented Mar 7, 2025

As the title suggests, hereby I add a Fakeroot flag in order to set Uid, Gid, Uname and Gname to root. This is very useful to mimic fakeroot behaviour. In my use case, I need something like this to avoid the usage of any fakeroot facility, just before archival operations. I'm using these edits for days and everything seems to work just fine.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think instead of hard-coding root, would it make more sense to let the user choose the Uid/Uname/Gid/Gname?

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Mar 7, 2025

Do you think instead of hard-coding root, would it make more sense to let the user choose the Uid/Uname/Gid/Gname?

I don't think that it make more sense. original mode can be retrieved by fileInfo, so it's always possible to use a chown logic before tar creation. I would consider root a notable case, particularly towards fakeroot functionality.

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Mar 11, 2025

Do you think instead of hard-coding root, would it make more sense to let the user choose the Uid/Uname/Gid/Gname?

I've done some edits to add customization

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry I didn't reply sooner. I do think this approach is probably better overall, since it's more flexible, but I also don't know much about the use cases for these properties. I appreciate it though. This works for you alright?

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Mar 11, 2025

Thanks! Sorry I didn't reply sooner. I do think this approach is probably better overall, since it's more flexible, but I also don't know much about the use cases for these properties. I appreciate it though. This works for you alright?

It perfectly works.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I had merged this already 🙈 Thank you!

@mholt mholt merged commit a639a2a into mholt:main Mar 26, 2025
3 checks passed
@M0Rf30 M0Rf30 deleted the chore/fakeroot branch October 2, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants