FOREACH error message?

Stefan Paetow Stefan.Paetow at jisc.ac.uk
Fri Aug 10 16:01:31 CEST 2018


Alan, Arran et al, 

I'm getting this message:

/etc/raddb/policy.d/moonshot-assertion[46]: MUST use attribute or list reference in 'foreach'
/etc/raddb/policy.d/moonshot-assertion[46]: Failed to parse "foreach" subsection.
/etc/raddb/policy.d/moonshot-assertion[38]: Failed to parse "if" subsection.
/etc/raddb/policy.d/moonshot-assertion[105]: Failed to parse "saml_add_affiliation" entry.

The policy in question is this (I've marked line 46 with '46>'):

#  This policy adds the eduPersonAffiliation if it exists
saml_add_affiliation.post-auth {
        #  Only try to add the Affiliation when the attribute exists
        if (&reply:Reply-eduPersonAffiliation) {
                update control {
                        SAML-Attribute-Value !* ANY
                        SAML-Attribute-Value += "%{explode:&reply:Reply-eduPersonAffiliation ,}"
                }
                update reply {
                        SAML-AAA-Assertion += '<saml:Attribute Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">'
                }
46>                foreach &control:SAML-Attribute-Value {
                        update reply {
                                SAML-AAA-Assertion += '<saml:AttributeValue xsi:type="xs:string">'
                                SAML-AAA-Assertion += "%{Foreach-Variable-0}"
                                SAML-AAA-Assertion += '</saml:AttributeValue>'
                        }
                }
                update reply {
                        SAML-AAA-Assertion += '</saml:Attribute>'
                }
        }
}

I can't see where I'm going wrong here... It's probably something *very* obvious that I can't see. I'm using FreeRADIUS 3.0.15 (I know, I know... It's not the newest).

Can someone point out the obvious mistake? :-/

Thank you :-)

Stefan Paetow
Consultant, Trust and Identity

t: +44 (0)1235 822 125
gpg: 0x3FCE5142
xmpp: stefanp at jabber.dev.ja.net
skype: stefan.paetow.janet

jisc.ac.uk

Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.
 




More information about the Freeradius-Users mailing list