(#19391) Find the catalog for the specified node name

Previously, the test was invoking the Catalog.indirection.find method
but passing in a Node instance. This used to "work" in 2.7.x, because
the compiler terminus only looked at `request.key`, in this case the
node name, and ignored the `request.instance`.

The test appears to verify that we can compile a node with the specified
facts. But the test doesn't verify that the facts are in the returned
catalog (they're not). So in reality, this test is passing when it
shouldn't.

To pass a Node instance through to the compiler, you need to use the
`use_node` option, e.g. :use_node => node.to_yaml. To pass facts, use
the use the `facts` option, e.g. :facts => facts.to_yaml.

Since the test passes in a Node instance, the node is cached instead of
the compiled catalog, which is one of the issues described in
CVE-2013-1652.

This commit changes the test to pass in the node.name, and it ensures we
can compile a catalog for it.
This commit is contained in:
Josh Cooper 2013-03-10 11:54:58 -07:00 коммит произвёл Matthaus Owens
Родитель c24029980c
Коммит 3ecd3761cd
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -494,7 +494,7 @@ class TestSnippets < Test::Unit::TestCase
catalog = nil
assert_nothing_raised("Could not compile catalog") {
catalog = Puppet::Resource::Catalog.indirection.find(node)
catalog = Puppet::Resource::Catalog.indirection.find(node.name)
}
assert_nothing_raised("Could not convert catalog") {