Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

bcml should not blindly try to chmod system files #212

Closed
tam1m opened this issue Nov 19, 2021 · 0 comments · Fixed by #213
Closed

bcml should not blindly try to chmod system files #212

tam1m opened this issue Nov 19, 2021 · 0 comments · Fixed by #213

Comments

@tam1m
Copy link
Contributor

tam1m commented Nov 19, 2021

See

BCML/bcml/util.py

Line 1444 in a57a1a2

os.chmod(bundle_path, 0o755)

It crashes, since bcml is installed to as part of a systempackage (used the aur package) and not local to the user. In that case bcml simply doesn't have the permission to chmod.

I think it would be a good idea to

  1. check if chmod is even needed
  2. check if bcml has the permission to do that
  3. inform the user, if the permission change is needed. but can't be done by bcml itself

BCML Error log when trying to rebuild/install mods

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bcml/install.py", line 653, in refresh_merges
    merger.perform_merge()
  File "/usr/lib/python3.9/site-packages/bcml/util.py", line 462, in timed_function
    res = func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/bcml/mergers/texts.py", line 422, in perform_merge
    extract_refs(ref_lang, tmp_dir)
  File "/usr/lib/python3.9/site-packages/bcml/mergers/texts.py", line 151, in extract_refs
    get_7z_path(),
  File "/usr/lib/python3.9/site-packages/bcml/util.py", line 1444, in get_7z_path
    os.chmod(bundle_path, 0o755)
PermissionError: [Errno 1] Operation not permitted: '/usr/lib/python3.9/site-packages/bcml/helpers/7z'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bcml/_api.py", line 33, in status_run
    data = func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/bcml/install.py", line 316, in do_and_refresh
    res = func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/bcml/_api.py", line 549, in remerge
    raise Exception(
Exception: There was an error merging your mods. [Errno 1] Operation not permitted: '/usr/lib/python3.9/site-packages/bcml/helpers/7z'
Note that this could leave your game in an unplayable state.
NiceneNerd added a commit that referenced this issue Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant