Forum: Cfengine Help
Subject: duplicate selection of value error
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,19046,19046#msg-19046
I'm seeing this output from cf-promises, although cf-promises does not return
an error.
!! Duplicate selection of value for variable "passwd" in scope passwd_acct_owner
!! Rule from ./hardening.cf at/before line 599
Relevant bundles and bodies:
bundle agent passwd_acct_owner {
vars:
"passwd" slist => { readstringlist("/etc/passwd","#.*","[\n]",200,20000)
};
methods:
"any" usebundle => passwd_acct_owner_entry("${passwd}");
}
bundle agent passwd_acct_owner_entry(line) {
# Reading password entry to look for owner in comment field.
classes:
"no_passwd_owner" not => regcmp("^.+?:[^:]*owner=\\S+
\\S+:.+$","${line}"),
comment => "Check for 'owner=' string and define if NOT found";
"not_ldap_passwd" not => regcmp("^...@\\w+.*$","${line}"),
comment => "Check for ldap groups (+...@unix) and define if NOT found";
reports:
no_passwd_owner.not_ldap_passwd::
"${g.pr} No owner in comment field in /etc/passwd: ${line}";
}
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine