[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python.el: why remove '' from sys.path?

From: John Sullivan
Subject: Re: python.el: why remove '' from sys.path?
Date: Sun, 15 Mar 2009 21:46:18 -0400
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

Chong Yidong <address@hidden> writes:

> John Sullivan <address@hidden> writes:
>> Why wouldn't the answer be to move '' to the end of sys.path, so that
>> overloading the emacs module with something malicious in the current
>> directory wouldn't be possible? Or how about checking the permissions of
>> the current directory before removing '' from the path? Or checking an
>> expected hash of the emacs and other imported-by-default modules?
>> Having the current working directory be in the python path is pretty
>> important to me and I think to other people as well. Moreover having the
>> emacs python shell behave too differently from the standard python shell
>> is a hassle.
> I'm open to revisiting this.  IIRC, the issue with checking permissions
> before removing '' from sys.path is that we weren't sure this would DTRT
> on platforms like Windows.  As for moving '' to the end of sys.path,
> that would itself be an incompatibility.

Moving it to the end would also be an incompatibility, that's true, but
a much less severe one. I could still import modules I'm hacking on
which are in the current directory without having to modify sys.path,
and I'd say that is the most common use case. 

I'm not sure about the Windows permissions issues -- I don't have any
ability to help test that.

> One thing to keep in mind here is that it may not be obvious to the user
> that she is executing python code---if I understand correctly, the
> python shell can be launched automatically when eldoc mode is on.

Right, and that makes sense to me as a legit reason why this is a
security issue in this case but not in the case of a standard python

John Sullivan
Emacs Planner Maintainer
GPG Key: AE8600B6

reply via email to

[Prev in Thread] Current Thread [Next in Thread]