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

tmpdir_factory and absolute paths that coincide with tmpdir_factory fails #6937

Closed
zerothi opened this issue Mar 18, 2020 · 2 comments
Closed

Comments

@zerothi
Copy link

zerothi commented Mar 18, 2020

Prior to #5686 (I think) one could provide absolute paths to tmpdir_factory. I understand the security issues this brings. However, I had a conftest.py implementation which used tmpdir_factory.getbasetemp() and it self created full paths with the base being getbasetemp().

I think in such cases pytest should not fail since the directory is valid and could easily be checked against.

I.e. the directory/file passed should be resolved and if it is prefixed with getbasetemp then all is good, else fails.

I am only now encountering these problems in Travis, pytest version 5.4.1 (not on my local box, since I haven't updated pytest, I am still on 5.0.1).

See here for the output which creates the fails.

See here for the implementation which itself collects the directories and files that are created.

If anymore information is required, feel free to contact me.

@Zac-HD
Copy link
Member

Zac-HD commented Mar 18, 2020

Hmm. Validating that a path is safe just makes me nervous - is there a workaround you could try like calculating the relative paths you want?

@zerothi
Copy link
Author

zerothi commented Mar 18, 2020

Thanks!
I have now made a work-around, but it has some quirks. I'll see if I can simplify it out...

@Zac-HD Zac-HD closed this as completed Mar 18, 2020
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

2 participants