📄 rlm_policy.5
字号:
.\" # DS - begin display.de DS.RS.nf.sp...\" # DE - end display.de DE.fi.RE.sp...TH rlm_policy 5 "7 December 2004" "" "FreeRADIUS Module".SH NAMErlm_policy \- FreeRADIUS Module.SH DESCRIPTIONThe \fBrlm_policy\fP module implements a simple "policy" language..PPThe policy language implemented by this module is simple, and specificto RADIUS. It does not implement variables, arrays, loops, goto's, orany other feature of a real language. If those features are neededfor your system, we suggest using \fBrlm_perl\fP..PPWhat the policy module implements is a simple way to look forattributes in the request packet (or other places), and to addattributes to the reply packet (or other places) based on thosedecisions. Where the module shines is that it is significantly moreflexible than the old-style \fBusers\fP file..PPThe module has one configuration item:.IP filenameThe file where the policy is stored..SH POLICY LANGUAGE.SS Named policiesThe policy is composed of a series of named policies. The followingexample defines a policy named "foo"..PP.DS policy foo {.br ....br }.DE.PPPolicy names MAY NOT be the same as attributes in the dictionary.Defining a policy with the same name as a dictionary attribute willcause an error message to be printed, and the policy will not beloaded..PPWhen the policy module is listed in a module section like "authorize",the module calls a policy named "authorize". The "post-auth",etc. sections behave the same. These names cannot be changed..PP.DS include "policy.txt".DE.PPThe filename must be in a double-quoted string, and is assumed to berelative to the location of the current file. If the filename endswith a '/', then it is assumed to be a directory, and all files inthat directory will be read..PP.DS include "dir/".DE.PPAll file in "dir/" will be read and included into the policydefinition. Any dot files (".", "..", etc.) will not be included,however..PP.SS Including multiple filesThe main file referred to from the \fIradiusd.conf\fP may include oneor more other files, as in the following example..PP.SS Referencing a named policyThe following example references a named policy.DS foo().DEWhile the brackets are required, no arguments may be passed..PP.SS Conditions"if" statements are supported..PP if (expression) {.br ....br }.DE.PPand "else".PP if (expression) {.br ....br } else {.br ....br }.DE.PPalso, "else if".PP if (expression) {.br ....br } else if (expression) {.br ....br }.DE.PP.SS Expressions within "if" statementsAlways have to have brackets around them. Sorry..PPThe following kinds of expressions may be used, with their meanings..IP (attribute-reference)TRUE if the referenced attribute exists, FALSE otherwise. See belowfor details on attribute references..IP (!(expression))FALSE if the expression returned TRUE, and TRUE if the nested expressionreturned FALSE..IP "(attribute-reference == value)"Compares the attribute to the value. The operators here can be "==","!=", "=~", "!~", "<", "<=", ">", and ">="..IP "(string1 == string2)"A special case of the above. The "string1" is dynamically expanded atrun time, while "string2" is not. The operators here can be "==","!=", "=~",and "!~". Of these, the most useful is "=~', which letsyou do things like ("%{ldap:query...}" =~ "foo=(.*) "). The resultsof the regular expression match are put into %{1}, and can be usedlater. See "doc/variables.txt" for more information..IP "((expression1) || (expression2))"Short-circuit "or". If expression1 is TRUE, expression2 is notevaluated..IP "((expression1) && (expression2))"Short-circuit "and". If expression1 is FALSE, expression2 is notevaluated..IP Limitations.The && and || operators have equal precedence. You can't call afunction as a expression..PP.PP.SS Attribute referencesAttribute references are:.IP Attribute-NameRefers to an attribute of that name in the Access-Request orAccounting-Request packet. May also refer to "server-side"attributes, which are not documented anywhere..IP request:Attribute-NameAn alternate way of referencing an attribute in the request packet..PP.IP reply:Attribute-NameAn attribute in the reply packet.PP.IP proxy-request:Attribute-NameAn attribute in the Access-Request or Accounting-Request packet whichwill be proxied to the home server..PP.IP proxy-reply:Attribute-NameAn attribute in the Access-Accept or other packet which was receivedfrom a home server..PP.IP control:Attribute-NameAn attribute in the per-request configuration and control attributes.Also known as "check" attributes (doc/variables.txt)..PP.PP.SS Adding attributes to reply packet (or other location) reply .= {.br attribute-name = value.br ....br attribute-name = value.br }.DE.PPThe first name can be "request", "reply", "control", "proxy-request",or "proxy-reply"..PPThe operator can be.PP .= - appends attributes to end of the list.PP := - replaces existing list with the attributes in the list (bad idea).PP = - use operators from "attribute = value" to decide what to do. (see "users").PPThe block must contain only attributes and values. Nothing else is permitted..SH SECTIONS.BR authorize.BR post-auth.BR pre-proxy.BR post-proxy.PP.SH FILES.I /etc/raddb/radiusd.conf.PP.SH "SEE ALSO".BR radiusd (8),.BR users (5),.BR radiusd.conf (5).SH AUTHORAlan DeKok <aland@ox.org>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -