lua-users home
lua-l archive

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


It was thus said that the Great Coroutines once stated:
> Okay, maybe I can explain my opinion better:
> 
> Previously I would write something like this if I wanted a temporary
> package.path/cpath:
> 
> export LUA_PATH=/path1/modules/etc/
> export LUA_CPATH=/path2/cmodules/etc/
> lua some_script.lua
> unset LUA_PATH
> unset LUA_CPATH
> 
> To me this seemed inconvenient.  So Luiz and your solution is to use
> `env' for portability and for just the one lua invocation makes more
> sense as it's very temporary:  env LUA_PATH=/whatever lua etc...
> 
> My point is, for something this temporary I'd rather not modify the
> environment.  I feel like it would be more convenient to type and
> maybe a better idea to pass these paths directly to the lua binary
> under a switch:
> 
> lua -path /whatever1/ -cpath /whatever2/ -l mod1 -l mod2 -e 'prior
> code' script.lua -e 'io.read()'
> 
> ^ Something like that, imo, would be nice.

  Don't get me wrong---I wasn't saying they shouldn't be added.  Heck, I
have a program that embeds Lua [1] that has options to adjust package.path
and package.cpath (in addition to using LUA_PATH and LUA_CPATH).  And while
I can't speak for Luiz, I will state that my sugguestion was a way to get
what you wanted *now* and not have to wait for an official patch from Rio.

> My argument for avoiding the environment is that I used to write CGI
> scripts with Lua, and I once wrote a very poor one that displayed
> everything in the CGI script's environment to the web client.  It's not a
> strong argument, but not leaking information about where modules "are" in
> the environment might be a good thing.

  Yeah, I wrote the same type of program [2]---the only difference is I
don't like "security through obscurity."  And because of that, I don't care
if you see what paths Lua is looking through [3].  How will knowing that
help a cracker get into my system?  And if they want to get into my system
bad enough, *no* amount of security will help [4].

  But that's me.

  -spc (Nothing quite like two hurricanes and an inside hack job to make
	for an interesting month ... )

[1]	https://github.com/spc476/syslogintr

[2]	http://boston.conman.org/cgi-bin/raw.cgi

[3]	But my program was written in C, but that's besides the point.

[4]	http://boston.conman.org/2004/09/19.1