-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update check prevents import if home dir not readable #799
Comments
Huh. I'll fix this sometime tomorrow, unless you want to contribute a pull
request first!
…On Sun, Nov 27, 2016 at 1:31 PM Grazfather ***@***.***> wrote:
This is the case on pwnable.kr right now
***@***.***:~$ python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.>>> from pwn import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pwn/__init__.py", line 16, in <module>
pwnlib.update.check_automatically()
File "/usr/local/lib/python2.7/dist-packages/pwnlib/update.py", line 185, in check_automatically
if should_check():
File "/usr/local/lib/python2.7/dist-packages/pwnlib/update.py", line 101, in should_check
if read(cache_file()).strip() == 'never':
File "/usr/local/lib/python2.7/dist-packages/pwnlib/update.py", line 88, in cache_file
os.makedirs(cache_dir)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/asm/.pwntools-cache'
So basically because the update decided to try today, and because pwnable
has a weird setup, I can't 'conveniently' use pwntools.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#799>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG0GFpDDlS_Rrq_grXtLygQ8UfFoM0rks5rCeibgaJpZM4K9P22>
.
|
You can get around this by setting I expect that this will break in a few other interesting ways. For example, Mako requires caching templates someplace.
|
Glad to see that pwnable has worked around it. Maybe auto-check should be opt-in? I have it setup on a pwning box, for example, in site-packages, where the update check might work but anyone with a shell account will see but cannot update it. Either way, I worked around it (I forget how) on pwnable, and have it working locally, so mostly just wanted to bring this to your attention. |
The intent of the update check is to inform users of the package, even if they cannot update it themselves. Most of this is to avoid support requests for outdated versions. In the case of In any case, the Pull Request adds some code which removes the need for any cache directory to exist anywhere. |
Users that wish to manually perform the check can still use
|
* Handle the home directory being read-only / cache directory being unavailable Fixes #799 * Add doctest for context.cache_dir
Fixed via #814 |
This is the case on pwnable.kr right now
So basically because the update decided to try today, and because pwnable has a weird setup, I can't 'conveniently' use pwntools.
The text was updated successfully, but these errors were encountered: