Re: libseed-list imports.searchPath
- From: Jonatan Liljedahl <lijon kymatica com>
- To: Seed - Gnome Javascript <libseed-list gnome org>
- Subject: Re: libseed-list imports.searchPath
- Date: Wed, 16 Jun 2010 18:44:55 +0200
Tim Horton wrote:
At least in $PATH, the current directory isn't put first for security
reasons (if you're in a publicly writable directory, you don't want
malicious users putting their own copy of -- for example -- 'ls' in that
directory and having that unknowingly run by you when you're in that
directory).
I'm going to go with "that's by design". Or at least, by copying other
people's design. It's not clear it matters as much here.
Ok, I can see the point of that.
There's no reason the directory of the currently running script couldn't be
first, though. I think. I don't know :-)
That would be very good, I think!
Also perhaps adding a modules path at the beginning while importing a
module?
say you have foo/Foo.js, foo/Bar.js and in Foo.js you do "b=imports.Bar"
and you know that it will use the one in the same directory. In a
security point of view, if we *don't* do this, then an evil user might
alter imports.searchPath so it uses their evil version of Bar.js
instead, etc..
/Jonatan
On Wed, Jun 16, 2010 at 09:14, Jonatan Liljedahl <lijon kymatica com> wrote:
I see. But looking at imports.searchPath it has automatic added entries for
the home path of the running script and the current directory, but these are
added at the end. Shouldn't they be added to the beginning?
Tim Horton wrote:
No, we iterate over it in order (from first to last) as far as I remember,
just like $PATH. If you want your stuff to get found first, prepend it to
searchPath, again, just like $PATH.
Could be wrong, it's been a while...
On 2010.06.16, at 06:37, Jonatan Liljedahl wrote:
In what direction is imports.searchPath searched? I guess it should start
from the last one added? So that any custom paths are searched before system
ones..
/Jonatan
_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list
_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]