I reported the issue in Mantis:

http://bug.cfengine.com/view.php?id=35

You get

!? Unresolved or non-existent variables in function call arguments, skipping

on the following promise file:

body common control
{
    bundlesequence => {"try"};
}

bundle agent try
{
    methods:
        "any" usebundle => tryBundle("password");
}

bundle agent tryBundle(argument)
{
    classes:
        "DoesNotWork" expression => returnszero("/bin/echo
${const.dollar}(cat ${argument})", "useshell");
        #"Works" expression => returnszero("/bin/echo
${const.dollar}(/bin/cat ${argument})", "useshell");
        #"AlsoWorks" expression => returnszero("/bin/echo
${const.dollar}(cat /etc/${argument})", "useshell");

    commands:
    DoesNotWork::
        "/bin/echo Hello";
}

body contain shell
{
    useshell => "true";
}

Note the promise file is deliberately wrong, but the point is that the
command is not loaded at all, whereas it should be (My actual policy file
uses mysql instead of cat, with an argument which makes sense).

Thanks

-- 
Jean-Noël Rivasseau
_______________________________________________
Bug-cfengine mailing list
Bug-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to