Closed stich86 closed 3 months ago
yes, but then I would like it to also work as non-root, so you'd need to catch PermissionError from os.chown, or maybe use a different option, like --preserve-owner
.
yes, but then I would like it to also work as non-root, so you'd need to catch PermissionError from os.chown, or maybe use a different option, like
--preserve-owner
.
I think run as-root should be necessary, because if you extract files that has root as owner, or stuff like special files or something else..
Do you want to rework it?
I also added a try-except PermissionError around os.mknod
.
I mostly use ubidump to analyze the contents of the filesystem, not nescesarily to exactly reproduce it in my local filesystem. Therefore I think it is nescesary that it keeps working for non-root users.
I have pushed an update.
Thanks mate,
i've tested and works as expected :)
I'm closing the issue!
hi @nlitsme
have you pushed the mods on PyPi? I'm still see old version
thanks!
Hi @nlitsme,
is it possible to modify the code and allow the "--preserve" switch to export UID and GID?
I had lot of problem on repacking a firmware from a vendor, because they use some custom UID\GID, and when exported with ubidump, all stuff is owned by root.
I've just change that part in this way:
Adding
os.chown
function will export files with their original UID\GID.I can create a pull request if you want.
Thanks!