Skip to content

fix:unarchive fails for user id != 1000 #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

borismw
Copy link

@borismw borismw commented May 22, 2025

Refers to issue #239. If the paperless_ngx_conf_usermap_uid variable is set to an id different from 1000, the unarchive fails to unpack files and change their ownership. This seems to be because the user unpacking the archive is different from the one owning the files.

This PR adds a lookup step to find out the correct user name with id == 1000 in cause paperless_ngx_conf_usermap_uid != 1000. The user name stored in the variable _paperless_ngx_untar_username will then later be used as the become_user in the unarchive step.

Note that with this solution

  • if there's no user with id 1000 yet
  • and paperless_ngx_conf_usermap_uid is not defined
    the lookup step will fail even though the user might perchance be created with the id 1000.

In order to prevent this one might to either have to move the system user creation step to an earlier stage or make paperless_ngx_conf_usermap_uid mandatory. I was not sure if it was okay to go down any of these routes.

@borismw borismw force-pushed the fix/unarchive-fails-for-user-other-than-id-1000 branch from 80be532 to 4da6829 Compare May 22, 2025 22:46
@borismw borismw force-pushed the fix/unarchive-fails-for-user-other-than-id-1000 branch from 4da6829 to 2c92b58 Compare May 22, 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.

1 participant