automake
[Top][All Lists]
Advanced

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

Re: Baked-in paths


From: Reuben Thomas
Subject: Re: Baked-in paths
Date: Mon, 15 Mar 2010 10:27:01 +0000

On 15 March 2010 01:30, Bob Friesenhahn <address@hidden> wrote:
> On Sun, 14 Mar 2010, Reuben Thomas wrote:
>
>> I imagine this question has been asked before, but searching the
>> archives, the net and the manual didn't help me with the following:
>>
>> I have a C program which loads some scripts at runtime. These are
>> stored in datadir (e.g. /usr/local/share/prog). But I also want to be
>> able to run the program from its build directory.
>>
>> At the moment I bake in the relevant path; I imagine that for "make
>> install" I have to rebuild the binary, baking in the installation
>> path, having baked the build directory path in a normal "make".
>>
>> Is there a recommended way to deal with this situation?
>
> I use environment variables to tell the test programs where the source
> directory is.

This does indeed sound like a security weakness.

>  If the test programs are executed via a test script, then the
> test script can format program arguments appropriately.

There are no program arguments for this case, because the scripts are
part of the program: the program is written partly in C, partly in
Lua.

>  If you also test
> using your main installable program, you need to take care that any embedded
> environment variables don't cause a security problem.

That is why I was asking whether automake would let me make "make
install" build another version with a different path baked in.

It is sounding as though the answer is "no", in which case I may just
end up baking the Lua into the C program, since that is
straightforward, but it does seem to be a weakness of the autotools
for this case.

-- 
http://rrt.sc3d.org




reply via email to

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