help-cfengine
[Top][All Lists]
Advanced

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

absolute path errors in 2.1.16


From: Chip Seraphine
Subject: absolute path errors in 2.1.16
Date: Tue, 04 Oct 2005 16:50:40 -0500
User-agent: Mozilla Thunderbird 1.0.5 (X11/20050711)

I am seeing apparently-spurious errors like this:

cf:cfengine::/var/cfengine/inputs/cf.networkinfo:219: ExecResult(/command) must specify an absolute path

The command in question is fine:

master1_hostline=
( ExecResult(${workdir}/bin/get-hostline master1 master1) )


The workdir variable is unconditionally set earlier in the run (in cfagent.conf), and this line has never thrown errors in the past.

The error seems to come from HandleExecResult in function.c, which does a hard check to see if the first character in the *args string is a '/'. This appears to be part of the parser, and my guess is that it fires before variable expansion takes place. (A similar situation might exist in HandleFunctionExec in the same file.)

If I am guessing correctly, then presumably variable expansion needs to take place earlier. If that can't be done, an obvious (but hacky) workaround would be to allow $ followed by some manner of open-brace as an alternative to a slash character.

I commented out the check in my own setup and recompiled, and the problem went away.

Personally I'm of the opinion that the forced-abspath stuff is much more pain than it is worth.... if we can't trust the maintainer to set up his PATH correctly, we are probably already doomed :)




reply via email to

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