Hello,<br><br>I have Freeradius 2.1.8.<br><br>I want to return an error code if my freeradius can't contact with the backend.<br><br>Here is my authorize section:<br><br>authorize {<br> . . .<br> switch "%{Realm}" {<br>
case '<a href="http://temp.unex.es">temp.unex.es</a>' {<br> sql {<br>
fail = 1<br>
}<br> if (!fail && ("%D" < "%{control:Expiration-Init}")) {<br> update reply {<br> Codigo-Reject := Cuenta-Inactiva<br>
}<br> reject<br> }<br> }<br> case '<a href="http://unex.es">unex.es</a>' {<br> ldap {<br> fail = 1<br> }<br>
}<br> case {<br> update reply {<br> Codigo-Reject := Error-Dominio<br> }<br> reject<br> }<br> }<br><br> if (fail) {<br> update reply {<br>
Codigo-Reject := Imposible-Contactar-Backend<br> }<br> reject<br> }<br><br> expiration {<br> userlock = 1<br> }<br> if (userlock) {<br> update reply {<br>
Codigo-Reject := Cuenta-Expirada<br> }<br> }<br> pap<br>}<br><br><br>My problem is when Freeradius can't contact ldap. Here is my debug info:<br><br>rad_recv: Access-Request packet from host X.X.X.X port 48454, id=116, length=56<br>
User-Name = "<a href="mailto:usuario@unex.es">usuario@unex.es</a>"<br> User-Password = "1631"<br>server rinuex {<br>. . .<br>++- entering switch %{Realm} {...}<br>+++- entering case <a href="http://unex.es">unex.es</a> {...}<br>
[ldap] performing user authorization for usuario<br>[ldap] expand: %{Stripped-User-Name} -> usuario<br>[ldap] expand: (cn=%{%{Stripped-User-Name}:-%{User-Name}}) -> (cn=usuario)<br>[ldap] expand: ou=saser,dc=unex,dc=es -> ou=saser,dc=unex,dc=es<br>
[ldap] ldap_get_conn: Checking Id: 0<br> [ldap] ldap_get_conn: Got Id: 0<br> [ldap] attempting LDAP reconnection<br> [ldap] (re)connect to X.X.X.X, authentication 0<br> [ldap] bind as cn=...<br> [ldap] waiting for bind result ...<br>
[ldap] LDAP login failed: check identity, password settings in ldap section of radiusd.conf<br> [ldap] (re)connection attempt failed<br>[ldap] search failed<br> [ldap] ldap_release_conn: Release Id: 0<br>++++[ldap] returns fail<br>
+++- case <a href="http://unex.es">unex.es</a> returns fail<br>++- switch %{Realm} returns fail<br>} # server rinuex<br>Using Post-Auth-Type Reject<br>+- entering group REJECT {...}<br>++[reply] returns noop<br>++? if ("%{reply:Codigo-Reject}")<br>
expand: %{reply:Codigo-Reject} -> Credenciales-Erroneas<br>? Evaluating ("%{reply:Codigo-Reject}") -> TRUE<br>++? if ("%{reply:Codigo-Reject}") -> TRUE<br>++- entering if ("%{reply:Codigo-Reject}") {...}<br>
+++- if ("%{reply:Codigo-Reject}") returns noop<br>++- group REJECT returns noop<br>[sql] expand: %{Stripped-User-Name} -> usuario<br>[sql] expand: %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} -> usuario<br>
[sql] sql_set_user escaped user --> 'usuario'<br>[sql] expand: INSERT INTO radpostauth (username, mac, client, reply, authdate,codreject) VALUES ( '%{User-Name}', LOWER('%{Calling-Station-Id}'), '%C', '%{reply:Packet-Type}', NOW(), '%{reply:Codigo-Reject}') -> INSERT INTO radpostauth (username, mac, client, reply, authdate,codreject) VALUES ( '<a href="mailto:usuario@unex.es">usuario@unex.es</a>', LOWER(''), 'CAU2', 'Access-Reject', NOW(), 'Credenciales-Erroneas')<br>
rlm_sql (sql) in sql_postauth: query is INSERT INTO radpostauth (username, mac, client, reply, authdate,codreject) VALUES ( 'usuario<br>@<a href="http://unex.es">unex.es</a>', LOWER(''), 'CAU2', 'Access-Reject', NOW(), 'Credenciales-Erroneas')<br>
rlm_sql (sql): Reserving sql socket id: 2<br>rlm_sql (sql): Released sql socket id: 2<br>++[sql] returns ok<br>[attr_filter.access_reject] expand: %{User-Name} -> <a href="mailto:usuario@unex.es">usuario@unex.es</a><br>
attr_filter: Matched entry DEFAULT at line 11<br>++[attr_filter.access_reject] returns updated<br>Delaying reject of request 0 for 1 seconds<br>Going to the next request<br>Waking up in 0.9 seconds.<br>Sending delayed reject for request 0<br>
Sending Access-Reject of id 116 to X.X.X.X port 48454<br> Codigo-Reject = Credenciales-Erroneas<br><br>I need help. Thank you and sorry for y english.<br><br><br clear="all"><br>-- <br>____________________<br><br> Ana Gallardo Gómez<br>
____________________<br>