]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
get rid of some alternation
authorAlan T. DeKok <aland@freeradius.org>
Sun, 1 Oct 2023 17:45:33 +0000 (13:45 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 2 Oct 2023 12:13:59 +0000 (08:13 -0400)
doc/antora/modules/ROOT/pages/index.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/howto/pages/modules/ldap/ldapsearch/translating_to_the_ldap_module.adoc
doc/antora/modules/howto/pages/modules/mschap/index.adoc
doc/antora/modules/howto/pages/modules/sqlippool/index.adoc
doc/antora/modules/installation/pages/upgrade.adoc
doc/antora/modules/tutorials/pages/multiple_modules.adoc

index a20be7c7e7ea88680361117698d25057644b1d3c..fc3d3f6e966924c347849a4987bd6bb38237138d 100644 (file)
@@ -73,7 +73,7 @@ following limitations:
 * Dynamic expansions have changed from `%{md5:foo}` to `%md5(foo)`.
   * The new syntax is much clearer, and supports multiple comma-separated arguments: `%function(a, b, c)`
   * Expansions such as `%{User-Name}` will still work.  We plan on making `%{1+2}` work, too.
-  * We plan on replacing `%{foo:-%{bar}}` by `%{foo || bar}`, which is clearer and uses less nesting.
+  * Alternation `%{%{foo}:-%{bar}}` has been replaced by `%{&foo || &bar}`, which is clearer and uses less nesting.
 
 Please be aware that v4 is in "alpha" right now.  If it works, great.
 If it doesn't work, then please return to using v3.
index aae74d7f94f002f7ee3c22a7008f39fe79f22281..5f31631f45e7170e0eb990e7d6d17538a5dee51d 100644 (file)
@@ -19,8 +19,8 @@ ldap {
                # example - ou=people,${..base_dn}
                base_dn = "<user.base_dn>" <1>
 
-               # example - (&(objectClass=posixAccount)(uid=%{%{Stripped-User-Name}:-%{User-Name}}))
-               filter = "(&(<user.filter>)(<user_uid_attribute>=%{%{Stripped-User-Name}:-%{User-Name}}))"  <2>
+               # example - (&(objectClass=posixAccount)(uid=%{&Stripped-User-Name || &User-Name}))
+               filter = "(&(<user.filter>)(<user_uid_attribute>=%{&Stripped-User-Name || &User-Name}))"  <2>
        }
 }
 ----
index cf1f37555f79ca022c1beba571aeddcfa4335ea7..23ab9e9f2e6ffe95c6103de8918c2f9b2652a921 100644 (file)
@@ -45,8 +45,8 @@ ldap {
                # example - base_dn = "ou=people,${..base_dn}"
                base_dn = "<path_from_base_dn_to_user_obj_dn>,${..base_dn}"  <5>
 
-               # example = "(&(uid=%{%{Stripped-User-Name}:-%{User-Name}})(objectClass=posixAccount))"
-               filter = "(&(<user_uid_attribute>=%{%{Stripped-User-Name}:-%{User-Name}})(<user_filter>))"  <6>
+               # example = "(&(uid=%{&Stripped-User-Name || &User-Name)(objectClass=posixAccount))"
+               filter = "(&(<user_uid_attribute>=%{&Stripped-User-Name || &User-Name)(<user_filter>))"  <6>
        }
 }
 ----
index 207013ffc4a14827e67de00206a0bc1f66d3730d..ffc47ff78c40eb7f0a051b3fd14cbf60a295f9df 100644 (file)
@@ -23,7 +23,7 @@
 |===
 | Purpose                                     | `ldap { user { ... } }` config item
 | Specify where to search for users           | ```base_dn = '<user_base_dn>'```
-| Specify how to find a user                  | ```filter = "(&(<user_filter>)(<user_uid_attribute>=%{%{Stripped-User-Name}:-%{User-Name}})"```
+| Specify how to find a user                  | ```filter = "(&(<user_filter>)(<user_uid_attribute>=%{&Stripped-User-Name || &User-Name)"```
 | Retrieve a "known good" password            | ```&control.Password.With-Header = <user_password_attribute>```
 | Allow accounts to be explicitly disabled    | ```access_attribute = '<user_access_disabled_attribute>'``` +
                                                 ```access_positive = 'no'```
@@ -79,7 +79,7 @@ Group objects reference users using user names.
 [width="100%",cols="30%,70%",options="header",]
 |===
 | Purpose                                     | `ldap { group { ... } }` config item
-| Specify how to find group objects referencing a user by name. | ```membership_filter = "(<group_membership_uid_attribute>=%{%{Stripped-User-Name}:-%{User-Name}})"```
+| Specify how to find group objects referencing a user by name. | ```membership_filter = "(<group_membership_uid_attribute>=%{&Stripped-User-Name || &User-Name)"```
 |===
 
 .Mixing and matching group membership schemes
@@ -95,6 +95,6 @@ both on user DN and user name e.g.
 
 [source,config]
 ----
-membership_filter = "(|(<group_membership_filter_by_uid>=%{control.Ldap-UserDn})(<group_membership_filter_by_name>=%{%{Stripped-User-Name}:-%{User-Name}}))"
+membership_filter = "(|(<group_membership_filter_by_uid>=%{control.Ldap-UserDn})(<group_membership_filter_by_name>=%{&Stripped-User-Name || &User-Name))"
 ----
 ****
index d60bb755caf51f06117d30a778fc25ea3f2f6b19..70a8ff0fa7911a4fe7dd1f21f3392ab58f80275b 100644 (file)
@@ -82,7 +82,7 @@ mschap {
     # initial data to send
     # this MUST be supplied
     ntlm_auth_username = "username: %(mschap:User-Name)"
-    ntlm_auth_domain = "nt-domain: %{%(mschap:NT-Domain):-YOURDOMAIN}"
+    ntlm_auth_domain = "nt-domain: %{%(mschap:NT-Domain) || 'YOURDOMAIN'}"
 
     # Or, you could try:
     ntlm_auth_username = "full-username: %{User-Name}"
index b87acb4242480c2888cf7b7d3199d932bb4b11ec..fcae9b7c7bb8b9a91b30dbb0149e7b894609906e 100644 (file)
@@ -873,7 +873,7 @@ release_clear = "\
                 nasipaddress = '', \
                 pool_key = 0, \
                 expiry_time = NOW() \
-        WHERE nasipaddress = '%{%{Nas-IP-Address}:-%{Nas-IPv6-Address}}' \
+        WHERE nasipaddress = '%{&NAS-IP-Address || &NAS-IPv6-Address}' \
         AND pool_key = '${pool_key}' \
         AND username = '%{User-Name}' \
         AND callingstationid = '%{Calling-Station-Id}' \
@@ -885,7 +885,7 @@ bulk_release_clear = "\
                 nasipaddress = '', \
                 pool_key = 0, \
                 expiry_time = NOW() \
-        WHERE nasipaddress = '%{%{Nas-IP-Address}:-%{Nas-IPv6-Address}}'"
+        WHERE nasipaddress = '%{&NAS-IP-Address || &NAS-IPv6-Address}'"
 
 ...
 ----
index 5dc8f29e59a3814a52c58999f637dbf472e943fd..50d2d8873e3538a64f071383b913679b938cc6e9 100644 (file)
@@ -958,7 +958,7 @@ In v4 they must now be specified as::
 counter_name    = &control.Daily-Session-Time
 check_name      = &control.Max-Daily-Session
 reply_name      = &reply.Session-Timeout
-key             = "%{%{Stripped-User-Name}:-%{User-Name}}"
+key             = "%{&Stripped-User-Name || &User-Name}"
 ```
 
 Just adding the `&` prefix to the attribute name is not sufficient.
@@ -975,7 +975,7 @@ functionality has been moved to the configuration.  To get the same
 functionality, the key should now be specified as a dynamic expansion:
 
 ```
-key = "%{%{Stripped-User-Name}:-%{User-Name}}"
+key = "%{&Stripped-User-Name || &User-Name}"
 ```
 
 The `count_attribute` has been removed, as it is no longer necessary.
index 1070647833537a1c91f398cd2a6cda2231e32337..dc638acae4418262858ef3bf0dedef118f8281fd 100644 (file)
@@ -23,7 +23,7 @@ for each date. The following information should be added to the
 
 --------------------------------------------------------------------
 detail byname {
-       filename = ${radacctdir}/byname/%{%{User-Name}:-none}
+       filename = ${radacctdir}/byname/%{&User-Name || 'none'}
        permissions = 0600
 }