Skip to content
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

[Bug]: Flaggie requires privileged access to run the --pretend option #45

Open
Kangie opened this issue Oct 15, 2023 · 0 comments
Open

Comments

@Kangie
Copy link

Kangie commented Oct 15, 2023

kangie@monolith ~ $ flaggie --version
flaggie 0.99.8

What I did:

kangie@monolith ~ $ flaggie --pretend '*/*' '+use::potato' --no-package-manager

What I got:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/flaggie", line 8, in <module>
    sys.exit(entry_point())
             ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flaggie/__main__.py", line 367, in entry_point
    sys.exit(main(*sys.argv))
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flaggie/__main__.py", line 347, in main
    save_config_files(config_files, confirm_cb=confirm_cb)
  File "/usr/lib/python3.11/site-packages/flaggie/config.py", line 193, in save_config_files
    with tempfile.NamedTemporaryFile(mode="w",
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 563, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 560, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/etc/portage/package.use/tmplx_mj8wo'

What I expected

kangie@monolith ~ $ flaggie --pretend '*/*' '+use::potato' --no-package-manager
diff --git a/tmp/package.use/wayland b/tmp/package.use/tmpaijlpnc2
index c603ae2..6a2dfb5 100644
--- a/tmp/package.use/wayland
+++ b/tmp/package.use/tmpaijlpnc2
@@ -1,2 +1,2 @@
*/* {+potato+} wayland
media-libs/libsdl2 gles2
Time: 0h:00m:03s 

Can we just write out to /tmp instead? I don't always want to invoke Flaggie from a user that can actually write to /etc/portage/package.use

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

No branches or pull requests

1 participant