]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more move to new function syntax
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Oct 2023 12:25:41 +0000 (08:25 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 6 Oct 2023 12:25:41 +0000 (08:25 -0400)
17 files changed:
doc/antora/modules/howto/pages/modules/ldap/authorization/groups.adoc
doc/antora/modules/howto/pages/modules/ldap/authorization/locating_the_user.adoc
doc/antora/modules/howto/pages/modules/ldap/base_configuration/index.adoc
doc/antora/modules/raddb/pages/sites-available/eap-aka-sim.adoc
doc/antora/modules/raddb/pages/sites-available/resource-check.adoc
doc/antora/modules/reference/pages/unlang/edit.adoc
doc/antora/modules/reference/pages/unlang/local.adoc
doc/antora/modules/reference/pages/xlat/builtin.adoc
doc/antora/modules/reference/pages/xlat/character.adoc
doc/antora/modules/tutorials/pages/dynamic-translation.adoc
raddb/mods-available/linelog
raddb/mods-available/mschap
raddb/mods-config/perl/example.pl
raddb/policy.d/debug
raddb/policy.d/operator-name
raddb/sites-available/eap-aka-sim
raddb/sites-available/resource-check

index a8293a7d80ad5688575ed0f0cc77961efaae8067..fbd1e29cf63e48a92f6d85711c769dd8d6419b16 100644 (file)
@@ -129,7 +129,7 @@ specified as a DN, and if the directory implements _variant 2_, then the group
 would be specified by name.
 ====
 
-Group checks can be performed using the xlat `%(ldap.memberof:)`.
+Group checks can be performed using the xlat `%ldap.memberof()`.
 Using this xlat, will, (if group caching is not enabled or the
 ldap module has not already been called) result in one or more
 queries being sent to the LDAP Directory to determine if the
@@ -143,7 +143,7 @@ appropriately.
 
 [source,unlang]
 ----
-if (%(ldap.memberof:cn=foo,ou=groups,dc=example,dc=com) == true) {
+if (%ldap.memberof(cn=foo,ou=groups,dc=example,dc=com) == true) {
        &reply.Reply-Message := "Welcome member of group 'foo'"
 }
 ----
@@ -152,7 +152,7 @@ if (%(ldap.memberof:cn=foo,ou=groups,dc=example,dc=com) == true) {
 
 [source,unlang]
 ----
-if (%(ldap.memberof:foo) == true) {
+if (%ldap.memberof(foo) == true) {
        &reply.Reply-Message := "Welcome member of group 'foo'"
 }
 ----
index 5f31631f45e7170e0eb990e7d6d17538a5dee51d..2bec592fbe7f98d4d5249b452a49a3260ee6a585 100644 (file)
@@ -1,7 +1,7 @@
 = Locating the user
 
 No matter how the LDAP module is called (via its `authorize`, `authenticate`,
-`accounting` methods or the `%(ldap.memberof:)` xlat) the first operation the
+`accounting` methods or the `%ldap.memberof()` xlat) the first operation the
 module performs it to populate `&control.LDAP-UserDN` with the location of
 the authenticating user's object in LDAP.
 
index 23ab9e9f2e6ffe95c6103de8918c2f9b2652a921..d2ee36b851477c2f9a52394d6e1a6bdc6eb5e63b 100644 (file)
@@ -110,7 +110,7 @@ server default {
 }
 ----
 
-Group checks may be performed  using the xlat `%(ldap.memberof:)`.
+Group checks may be performed  using the xlat `%ldap.memberof()`.
 
 [source,unlang]
 ----
@@ -118,7 +118,7 @@ server default {
        ...
        recv Access-Request {
                ldap
-               if (%(ldap.memberof:cn=authorized_users,ou=groups,dc=example,dc=com) == true) {
+               if (%ldap.memberof(cn=authorized_users,ou=groups,dc=example,dc=com) == true) {
                        reject
                }
                ...
index f23085ef0834582edf1bae60606f15fee99a807b..e4bb0c0ff7bcf400329917e6088e41e87f945a47 100644 (file)
@@ -302,7 +302,7 @@ modules.  Usually this is not an issue because EAP Negotiation
 allows the supplicant and server to negotiate a mutually acceptable
 EAP type. If, however, you want to avoid the additional round trips
 involved in that negotiation, you can use
-`%(aka_sim_id_method:%{User-Name})` in the top level virtual server,
+`%aka_sim_id_method(%{User-Name})` in the top level virtual server,
 which will return the EAP method hinted by the identity, and then
 set `&control.EAP-Type` to an appropriate value before calling the
 EAP module.
@@ -484,7 +484,7 @@ The following facilitates may be useful when generating pseudonym
 values:
 
 - The encrypt expansions of the `rlm_cipher` module.
-- The `%(3gpp_pseudonym_encrypt:)` expansion.
+- The `%3gpp_pseudonym_encrypt()` expansion.
 - The `%randstr()` expansion.
 
 NOTE: Add a `&reply.Next-Pseudonym-Id` attribute in this section to
index 94732c2b2c9b69f2fcf33a7536a6e464f328d0d5..a1da89cf30ba22412a3a5017acef73b6a5325203 100644 (file)
@@ -100,7 +100,7 @@ db_online control module.
 
 Other modules could be used here.
 
-You can even invoke synchronous checks using the %(exec:...) xlat in
+You can even invoke synchronous checks using the %exec(...) xlat in
 which case timeout should be set to less than the check trigger
 interval to avoid buildup of checks when resources do not respond.
 See rlm_exec for details.
index ac2960e6376021e5f836e8e6887c6ebd34ca00cf..d0483d5ac46a0c596609bbe636d8bee0cdb12def 100644 (file)
@@ -86,7 +86,7 @@ retrieving data from a database.
 [source,unlang]
 ----
 group {
-    &reply.Reply-Message += %(sql:SELECT ...)
+    &reply.Reply-Message += %sql("SELECT ...")
     &reply.Filter-Id := "foo"
 }
 ----
index 871fbd522bd263e10421085f53e3b04be0d69104..de25bde0e607d989b686611a68e0c0f202a905fc 100644 (file)
@@ -38,7 +38,7 @@ Local variables _cannot_ be deleted.  When the current scope exits, the local va
 if (&User-Name == "bob") {
     uint32 len
 
-    &len := %(length:%{User-Name})
+    &len := %length(%{User-Name})
 
     &Reply-Message := "Length of %{User-Name} is %{len}"
 }
@@ -60,13 +60,13 @@ if (&User-Name == "bob") {
     }
 
     #  "len" is created, and can now be used
-    &len := %(length:%{User-Name})
+    &len := %length(%{User-Name})
 
     &Reply-Message := "Length of %{User-Name} is %{len}"
 }
 ----
 
-The variable declaration and assignment must be sepaarted.  Constructions like `uint32 len = %(length:%{User-Name})` are not allowed.
+The variable declaration and assignment must be sepaarted.  Constructions like `uint32 len = %length(%{User-Name})` are not allowed.
 
 // Copyright (C) 2023 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
 // This documentation was developed by Network RADIUS SAS.
index acdb42d7f18a367f6fb6718df2a7b1a1db206ad8..a548a83dcacf1f6d543c0d352ad1f0956c919138 100644 (file)
@@ -247,7 +247,7 @@ recv Access-Request {
 ...
 ```
 
-=== %(debug_attr:<list:[index]>)
+=== %debug_attr(<list:[index]>)
 
 Print to debug output all instances of current attribute, or all attributes in a list.
 expands to a zero-length string.
@@ -260,7 +260,7 @@ expands to a zero-length string.
 ----
 recv Access-Request {
     if (&request.User-Name == "bob") {
-        "%(debug_attr:request[*])"
+        "%debug_attr(request[*])"
     }
     ...
 }
@@ -278,7 +278,7 @@ recv Access-Request {
 (0)        &request.NAS-IP-Address = 127.0.1.1
 (0)        &request.NAS-Port = 1
 (0)        &request.Message-Authenticator = 0x9210ee447a9f4c522f5300eb8fc15e14
-(0)      EXPAND %(debug_attr:request[*])
+(0)      EXPAND %debug_attr(request[*])
 (0)    } # if (&request.User-Name == "bob") (...)
 ...
 ```
index 1c08a7b566455be9caeeddd95dc55ef4bc61a2eb..5df20e795629bf3867b755d0fb6ac380f2ebf369 100644 (file)
@@ -35,7 +35,7 @@ since the Unix epoch.
 
 This expansion is only useful where the time resolution is in seconds.
 If more resolution is needed, the xref:xlat/builtin.adoc[builtin]
-`%(time:...)` expansion should be used instead.
+`%time(...)` expansion should be used instead.
 
 `%Y()`::
 
index 4d457e31b264334c713ee56b89ca5457b88155f9..16cf7b67a03c5297265a327fc19c96543a3b734d 100644 (file)
@@ -22,7 +22,7 @@ top:
 
 -------------------------------------------------------------------------------
 bob Password.Cleartext := "hello"
-    Callback-Id = "%(exec:/bin/echo Hello, there)"
+    Callback-Id = "%exec('/bin/echo', "Hello, there")
 -------------------------------------------------------------------------------
 
 The `echo` program may be in `/usr/bin/echo`, depending on your local system. On
@@ -43,7 +43,7 @@ the server should print messages similar to the following.
 (0)  files : users: Matched entry bob at line 1
 Executing: /bin/echo Hello, there:
 Program returned code (0) and output 'Hello, there'
-(0)  files : EXPAND %(exec:/bin/echo Hello, there)
+(0)  files : EXPAND %exec('/bin/echo', "Hello, there")
 (0)  files :    --> Hello, there
 (0)   [files] = ok
 -------------------------------------------------------------------------------
@@ -81,11 +81,11 @@ You should use the `bob-login-one.sh` script to send a request to match the
 first entry and should send another request with a different NAS-Port.
 
 -------------------------------------------------------------------------------
-bob    Password.Cleartext := "hello", NAS-Port == "%(exec:/usr/bin/id -u)"
+bob    Password.Cleartext := "hello", NAS-Port == "%exec('/usr/bin/id', '-u')"
        Reply-Message = "Your port is very nice.",
        Session-Timeout = "%{60 * 60}"
 
-bob    Password.Cleartext := "hello", NAS-Port != "%(exec:/usr/bin/id -u)"
+bob    Password.Cleartext := "hello", NAS-Port != "%exec('/usr/bin/id', '-u')"
         Reply-Message = "Your port is less nice.",
         Session-Timeout = "%{60 * 2}"
 -------------------------------------------------------------------------------
index 81e89c1cca907ce22cd481e394a78ae278f6470d..0eee660bbed7d5180a6792c9928971108c180f4a 100644 (file)
@@ -66,7 +66,7 @@ linelog {
        #
        #  May be an attribute reference, e.g. `&User-Name`, or `xlat`, `literal` or `exec`.
        #
-       reference = "messages.%{&reply.Packet-Type || default}"
+       reference = "messages.%{&reply.Packet-Type || 'default'}"
 
        #
        #  messages { ... }::
@@ -392,7 +392,7 @@ linelog log_accounting {
                permissions = 0600
        }
 
-       reference = "Accounting-Request.%{&Acct-Status-Type || unknown}"
+       reference = "Accounting-Request.%{&Acct-Status-Type || 'unknown'}"
 
        #
        #  Example for `Accounting-Request`.
index 13d92a4cc59c96169e69b32028542501df585a36..6f688c353f743070b335160e224714e6f75658da 100644 (file)
@@ -336,7 +336,7 @@ mschap {
                #  TIP: We give both examples here, but *only one should be used*.
                #
 #              local_cpw = %exec('/path/to/script', %mschap(User-Name), %{MS-CHAP-New-Password.Cleartext})
-               local_cpw = %sql("UPDATE radcheck set value='%{MS-CHAP-New-NT-Password}' where username='%{User-Name}' and attribute='Password.NT'")
+#              local_cpw = %sql("UPDATE radcheck set value='%{MS-CHAP-New-NT-Password}' where username='%{User-Name}' and attribute='Password.NT'")
 
        }
 
index 3fa1467467fd2bafcb36c784fbdefcb558439b5a..8412765af4258e39159012b2a32b12536c3d86fa 100644 (file)
@@ -126,7 +126,7 @@ sub authenticate {
                return RLM_MODULE_REJECT;
        } else {
                # Accept user and set some attribute
-               if (&radiusd::xlat("%(client:group)") eq 'UltraAllInclusive') {
+               if (&radiusd::xlat("%client(group)") eq 'UltraAllInclusive') {
                        # User called from NAS with unlim plan set, set higher limits
                        $RAD_REPLY{'h323-credit-amount'} = "1000000";
                } else {
index b106b8b81f4ccaa90d8075c3cc67fd6870ce54b2..76420d3e7ab26d7aac32bcafccf9a816dd50ce79 100644 (file)
@@ -2,7 +2,7 @@
 #  Outputs the contents of the control list in debugging (-X) mode
 #
 debug_control {
-       if (%(debug_attr:control)) {
+       if (%debug_attr(control)) {
                noop
        }
 }
@@ -11,7 +11,7 @@ debug_control {
 #  Outputs the contents of the request list in debugging (-X) mode
 #
 debug_request {
-       if (%(debug_attr:request)) {
+       if (%debug_attr(request)) {
                noop
        }
 }
@@ -20,7 +20,7 @@ debug_request {
 #  Outputs the contents of the reply list in debugging (-X) mode
 #
 debug_reply {
-       if (%(debug_attr:reply)) {
+       if (%debug_attr(reply)) {
                noop
        }
 }
@@ -29,7 +29,7 @@ debug_reply {
 #  Outputs the contents of the session state list in debugging (-X) mode
 #
 debug_session_state {
-       if (%(debug_attr:session-state)) {
+       if (%debug_attr(session-state)) {
                noop
        }
 }
index d3abae9b3ada33934e3f0725b6decc7d366a72b9..9cba1a86dd09978426a0dc76ae201b3420517399 100644 (file)
@@ -26,7 +26,7 @@
 #  an Operator-Name attribute
 #
 operator-name.authorize {
-       if ("%(client:Operator-Name)") {
-               &request.Operator-Name = "%(client:Operator-Name)"
+       if ("%client(Operator-Name)") {
+               &request.Operator-Name = "%client(Operator-Name)"
        }
 }
index 8f49bce7d8941bb913910fa36f75f03fa920fd91..0a82460e72f955a6a7f65614285492b35fd4c573 100644 (file)
@@ -332,7 +332,7 @@ server eap-aka-sim {
        #  allows the supplicant and server to negotiate a mutually acceptable
        #  EAP type. If, however, you want to avoid the additional round trips
        #  involved in that negotiation, you can use
-       #  `%(aka_sim_id_method:%{User-Name})` in the top level virtual server,
+       #  `%aka_sim_id_method(%{User-Name})` in the top level virtual server,
        #  which will return the EAP method hinted by the identity, and then
        #  set `&control.EAP-Type` to an appropriate value before calling the
        #  EAP module.
@@ -529,7 +529,7 @@ server eap-aka-sim {
        #  values:
        #
        #  - The encrypt expansions of the `rlm_cipher` module.
-       #  - The `%(3gpp_pseudonym_encrypt:)` expansion.
+       #  - The `%3gpp_pseudonym_encrypt()` expansion.
        #  - The `%randstr()` expansion.
        #
        #  NOTE: Add a `&reply.Next-Pseudonym-Id` attribute in this section to
index 087698c8a17fb08a6b6126b364b9f1abda89b95c..f61a33525506cdfee4df4019aef575f35fba37fd 100644 (file)
@@ -113,7 +113,7 @@ recv Status-Server {
        #
        #  Other modules could be used here.
        #
-       #  You can even invoke synchronous checks using the %(exec:...) xlat in
+       #  You can even invoke synchronous checks using the %exec(...) xlat in
        #  which case timeout should be set to less than the check trigger
        #  interval to avoid buildup of checks when resources do not respond.
        #  See rlm_exec for details.