<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello list,<div><br></div><div>I'm trying to check if a symlink is linked to a certain directory. Basically what I want to do is:</div><div>- fill a local variable using a file_object, basically returning all directories in a directory.</div><div>- check with a symlink_test that a symlink target is one of these directories</div><div><br></div><div>Unfortunately, oscap returns error when trying to get this to work. Looking in the verbose log, I see </div><div><i>I: oscap:     Variable 'oval:com.flubber.internal.test.test_link_target:var:1' has no values.</i><br></div><div>Seems it never collects the directories.</div><div><br></div><div><div>Is this related to <a href="https://www.redhat.com/archives/open-scap-list/2018-April/msg00000.html" target="_blank">https://www.redhat.com/archives/open-scap-list/2018-April/msg00000.html</a> ?</div><br class="m_4772884856414782889m_-5857431859834785211gmail-Apple-interchange-newline"></div><div><br></div><div>Example:</div><div><br></div><div>$ mkdir -p /tmp/link-target/foo /tmp/link-target/foo2</div><div>$ ln -s /tmp/link-target/foo2 /tmp/link-source</div><div><br></div><div>-----------------------------------------------------------------------------------------------</div><div><div>  <definitions></div><div>    <definition class="compliance" id="oval:com.flubber.internal.test.test:def:1" version="1"></div><div>      <metadata></div><div>        <title>TEST</title></div><div>        <description>Test</description></div><div>        <reference ref_id="tst-000001" source="XCCDF"/></div><div>        <affected family="unix"></div><div>          <platform>Red Hat Enterprise Linux 7</platform></div><div>        </affected></div><div>      </metadata></div><div>      <criteria operator="AND"></div><div>        <criterion comment="TEST" test_ref="oval:com.flubber.internal.test.test:tst:1"/></div><div>      </criteria></div><div>    </definition></div><div>  </definitions></div><div>  <tests></div><div>    <symlink_test check="all" check_existence="all_exist" comment="TEST" id="oval:com.flubber.internal.test.test:tst:1" version="1" xmlns="<a href="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" target="_blank">http://oval.mitre.org/XMLSchema/oval-definitions-5#unix</a>"></div><div>      <object object_ref="oval:com.flubber.internal.test.test:obj:2"/></div><div>      <state state_ref="oval:com.flubber.internal.test.test:ste:1"/></div><div>    </symlink_test></div><div>  </tests></div><div>  <objects></div><div>    <file_object id="oval:com.flubber.internal.test.test:obj:1" version="1" xmlns="<a href="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" target="_blank">http://oval.mitre.org/XMLSchema/oval-definitions-5#unix</a>"></div><div>      <behaviors max_depth="1" recurse_direction="down"/></div><div>      <path>/tmp/link-target</path></div><div>      <filename operation="pattern match">^.*$</filename></div><div>    </file_object></div><div>    <symlink_object id="oval:com.flubber.internal.test.test:obj:2" version="1" xmlns="<a href="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" target="_blank">http://oval.mitre.org/XMLSchema/oval-definitions-5#unix</a>"></div><div>      <filepath var_ref="oval:com.flubber.internal.test.test_link_source:var:1"/></div><div>    </symlink_object></div><div>  </objects></div><div><div>  <states></div><div>    <symlink_state id="oval:com.flubber.internal.test.test:ste:1" version="1" xmlns="<a href="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" target="_blank">http://oval.mitre.org/XMLSchema/oval-definitions-5#unix</a>"></div><div>      <filepath var_check="at least one" var_ref="oval:com.flubber.internal.test.test_link_target:var:1"/></div><div>    </symlink_state></div><div>  </states></div><div>  <variables></div><div>    <constant_variable comment="Link source" datatype="string" id="oval:com.flubber.internal.test.test_link_source:var:1" version="1"></div><div>      <value>/tmp/link-source</value></div><div>    </constant_variable></div><div>    <local_variable comment="Link target" datatype="string" id="oval:com.flubber.internal.test.test_link_target:var:1" version="1"></div><div>      <object_component item_field="filepath" object_ref="oval:com.flubber.internal.test.test:obj:1"/></div><div>    </local_variable></div><div>  </variables></div><div></oval_definitions></div></div></div><div>-----------------------------------------------------------------------------------------------  <br></div><div><br></div><div>Anyone any idea?</div></div></div></div></div></div>
</div></div>