You can see that webgate|Webgate|webGate are some of the many possible paths to the cacert.pm that I need to update if the sha1 value does not match a master copy of the certificate file to compare to. Is there a way to wildcard a relevance statement for a directory path?
You can use “folders of folder” to get a wildcard function in a path. Like this:
files "cacert.pem" of folders "simpleCA" of folders "openssl" of folders "tools" of folders "oblix" of folders "access" of folders of folders "oracle" of folders "/opt"
That covers the first three paths. The last one would have an extra “oam” folder in there.
I use this relevance to check if the size and sha1 of a given file are correct:
size of it = 7038 AND sha1 of it = “328533622c33323d0c66bf56fcf57d018fe97bb9”
You’ll have to go and grab the size and sha1 of the file yourself (the easiest way is to use the fixlet debugger).
So, in the end, your relevance should look something like this:
(size of it = 7038 AND sha1 of it = “328533622c33323d0c66bf56fcf57d018fe97bb9”) of
files “cacert.pem” of folders “simpleCA” of folders “openssl” of folders “tools” of folders “oblix” of folders “access” of folders of folders “oracle” of folders “/opt”
So since the result of above will display multiple answers, I want to know if any of the files do not have the defined sha1 value and return a true answer, but what if I get some true, some false, what will the overall relevance in a fixlet evaluate to? Like in this case below
(sha1 of it != “da39a3ee5e6b4b0d3255bfef95601890afd80709”) of files “cacert.pem” of folders “simpleCA” of folders “openssl” of folders “tools” of folders “oblix” of folders “access” of folders of folders “oracle” of folders “/opt”
A: True
A: False
So I want to update all the files if any of them do not match
I don’t have the ability to test this, so someone else will probably need to chime in, but you’ll need to do something like this:
(pathname of it, sha1 of it != “da39a3ee5e6b4b0d3255bfef95601890afd80709”) of files “cacert.pem” of folders “simpleCA” of folders “openssl” of folders “tools” of folders “oblix” of folders “access” of folders of folders “oracle” of folders “/opt”
Ok you onto an idea, but does not work in all cases:
Q: sha1 of file “/opt/oracle/Webgate/access/oblix/tools/openssl/simpleCA/cacert.pem”
A: e5b2e01ad9d40ad406ba14ad18bf775f21c81561
Q: sha1 of file “/opt/oracle/webgate/access/oblix/tools/openssl/simpleCA/cacert.pem”
A: 68c9e4730f3d45a4c3de811b8783dc4126059ac2
Q: exists ((descendants of folder “/opt/oracle”) whose (name of it contains “cacert.pem”)) whose(sha1 of it != “68c9e4730f3d45a4c3de811b8783dc4126059ac2”)
A: True
Q: ((descendants of folder “/opt/oracle”) whose (name of it contains “cacert.pem”)) whose(sha1 of it != “68c9e4730f3d45a4c3de811b8783dc4126059ac2”)
This might be what you are looking for: (I have no way to test this)
files whose(“cacert.pem” = name of it as lowercase) of folders “access/oblix/tools/openssl/simpleCA” of folders whose(“webgate” = name of it as lowercase) of (it | folders “oam” of it) of folders “/opt/oracle”
T/F relevance:
exists files whose((“cacert.pem” = name of it as lowercase) AND (sha1 of it != “da39a3ee5e6b4b0d3255bfef95601890afd80709”)) of folders “access/oblix/tools/openssl/simpleCA” of folders whose(“webgate” = name of it as lowercase) of (it | folders “oam” of it) of folders “/opt/oracle”