Question about unlang functionality

Markus Moeller huaraz at moeller.plus.com
Sat Jan 26 22:55:18 CET 2008


I have a internal check Attribute My-Test defined as string. I have the 
following in authorize

          update reply {
                                Reply-Message = " Hi "
         }
        switch control:My-Test {
                case "500" {
                        update control {
                                Auth-Type := Reject
                        }
                        update reply {
                                Reply-Message = " Rejected "
                        }
                }
                case {
                        update control {
                                Auth-Type := PAM
                        }
                        update reply {
                                Reply-Message = " Accepted "
                        }
                }


Firstly I noticed that I can not update an attribute twice as I always get 
the reply message Hi. Secondly the switch case does not work but an if does

        if (control:My-Test == "500" ) {
                        update control {
                                Auth-Type := Reject
                        }
                        update reply {
                                Reply-Message = " Rejected "
                        }
        }
        else {
                        update control {
                                Auth-Type := PAM
                        }
                        update reply {
                                Reply-Message = " Accepted "
                        }
        }

Is this a bug or wrong programming ?

Thank you
Markus 





More information about the Freeradius-Users mailing list