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

Multi-user scenario keeps using the same /tmp/tito directory #465

Open
praiskup opened this issue Jul 17, 2023 · 6 comments
Open

Multi-user scenario keeps using the same /tmp/tito directory #465

praiskup opened this issue Jul 17, 2023 · 6 comments
Labels
bug Something is clearly a bug effort/low Can be done in few hours gain/high Significantly moves the project forward

Comments

@praiskup
Copy link
Member

I executed a tito command under twine user locally:

$ tito build --tgz
Creating output directory: /tmp/tito
Traceback (most recent call last):
  File "/usr/bin/tito", line 33, in <module>
    sys.exit(load_entry_point('tito==0.6.24', 'console_scripts', 'tito')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/cli.py", line 910, in main
    CLI().main(sys.argv[1:])
  File "/usr/lib/python3.11/site-packages/tito/cli.py", line 209, in main
    return module.main(argv)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/cli.py", line 388, in main
    builder = create_builder(package_name, build_tag,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/common.py", line 173, in create_builder
    builder = builder_class(
              ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tito/builder/main.py", line 392, in __init__
    BuilderBase.__init__(self, name=name, build_dir=build_dir, config=config,
  File "/usr/lib/python3.11/site-packages/tito/builder/main.py", line 107, in __init__
    self.rpmbuild_dir = mkdtemp(dir=self.rpmbuild_basedir,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/tempfile.py", line 368, in mkdtemp
    _os.mkdir(file, 0o700)
PermissionError: [Errno 13] Permission denied: '/tmp/tito/rpmbuild-mockpbtuqod0'

This failed because I did similar thing under praiskup user before.

@FrostyX FrostyX added the bug Something is clearly a bug label Jul 17, 2023
@FrostyX FrostyX added effort/low Can be done in few hours gain/low Affect only one person, corner case, has easy workaround labels Jan 1, 2024
@praiskup
Copy link
Member Author

praiskup commented Jan 5, 2024

I'd argue this is gain/high, but not sure about the needed effort.

@FrostyX
Copy link
Member

FrostyX commented Jan 5, 2024

I'd argue this is gain/high

Maybe I am misunderstanding the issue then? Of course, it is a bug and it tracebacks so it is even more ugly. But it seems that nobody needs to use Tito in multi-user scenario? And if so, it has an easy workaround with manual chmod/chown.

I'd argue this is gain/high, but not sure about the needed effort.

I'd say it is effort/low because we IMHO change the path to be /tmp/tito-$USER/

We can prioritize this issue if you think it is worth it.

@xsuchy
Copy link
Member

xsuchy commented Jan 5, 2024

Can we instead of hardcoded value use mkdtemp(prefix="tito-") ?

@FrostyX
Copy link
Member

FrostyX commented Jan 5, 2024

Can we instead of hardcoded value use mkdtemp(prefix="tito-")

I don't think we can because then every tito run would create a new directory in /tmp and pollute it. We IMHO want (and currently do) mkdtemp(prefix="something-") inside of the /tmp/tito/. I would just change it to /tmp/tito-$USER

@praiskup
Copy link
Member Author

praiskup commented Jan 5, 2024

But it seems that nobody needs to use Tito in multi-user scenario?

At least I do O:-) multi-user scenarios are pretty normal on shared machines.

@FrostyX
Copy link
Member

FrostyX commented Jan 5, 2024

multi-user scenarios are pretty normal on shared machines.

But shared machines are pretty unusual at this point :D
Anyway, it's any easyfix, I will send a PR :-)

@FrostyX FrostyX added gain/high Significantly moves the project forward and removed gain/low Affect only one person, corner case, has easy workaround labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is clearly a bug effort/low Can be done in few hours gain/high Significantly moves the project forward
Projects
None yet
Development

No branches or pull requests

3 participants