From: Alan T. DeKok Date: Sun, 1 Oct 2023 17:45:33 +0000 (-0400) Subject: get rid of some alternation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f580913a981b1b4d75e01372db505a9efda8ab08;p=thirdparty%2Ffreeradius-server.git get rid of some alternation --- diff --git a/doc/antora/modules/ROOT/pages/index.adoc b/doc/antora/modules/ROOT/pages/index.adoc index a20be7c7e7e..fc3d3f6e966 100644 --- a/doc/antora/modules/ROOT/pages/index.adoc +++ b/doc/antora/modules/ROOT/pages/index.adoc @@ -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. diff --git a/doc/antora/modules/howto/pages/modules/ldap/authorization/locating_the_user.adoc b/doc/antora/modules/howto/pages/modules/ldap/authorization/locating_the_user.adoc index aae74d7f94f..5f31631f45e 100644 --- a/doc/antora/modules/howto/pages/modules/ldap/authorization/locating_the_user.adoc +++ b/doc/antora/modules/howto/pages/modules/ldap/authorization/locating_the_user.adoc @@ -19,8 +19,8 @@ ldap { # example - ou=people,${..base_dn} base_dn = "" <1> - # example - (&(objectClass=posixAccount)(uid=%{%{Stripped-User-Name}:-%{User-Name}})) - filter = "(&()(=%{%{Stripped-User-Name}:-%{User-Name}}))" <2> + # example - (&(objectClass=posixAccount)(uid=%{&Stripped-User-Name || &User-Name})) + filter = "(&()(=%{&Stripped-User-Name || &User-Name}))" <2> } } ---- diff --git a/doc/antora/modules/howto/pages/modules/ldap/base_configuration/index.adoc b/doc/antora/modules/howto/pages/modules/ldap/base_configuration/index.adoc index cf1f37555f7..23ab9e9f2e6 100644 --- a/doc/antora/modules/howto/pages/modules/ldap/base_configuration/index.adoc +++ b/doc/antora/modules/howto/pages/modules/ldap/base_configuration/index.adoc @@ -45,8 +45,8 @@ ldap { # example - base_dn = "ou=people,${..base_dn}" base_dn = ",${..base_dn}" <5> - # example = "(&(uid=%{%{Stripped-User-Name}:-%{User-Name}})(objectClass=posixAccount))" - filter = "(&(=%{%{Stripped-User-Name}:-%{User-Name}})())" <6> + # example = "(&(uid=%{&Stripped-User-Name || &User-Name)(objectClass=posixAccount))" + filter = "(&(=%{&Stripped-User-Name || &User-Name)())" <6> } } ---- diff --git a/doc/antora/modules/howto/pages/modules/ldap/ldapsearch/translating_to_the_ldap_module.adoc b/doc/antora/modules/howto/pages/modules/ldap/ldapsearch/translating_to_the_ldap_module.adoc index 207013ffc4a..ffc47ff78c4 100644 --- a/doc/antora/modules/howto/pages/modules/ldap/ldapsearch/translating_to_the_ldap_module.adoc +++ b/doc/antora/modules/howto/pages/modules/ldap/ldapsearch/translating_to_the_ldap_module.adoc @@ -23,7 +23,7 @@ |=== | Purpose | `ldap { user { ... } }` config item | Specify where to search for users | ```base_dn = ''``` -| Specify how to find a user | ```filter = "(&()(=%{%{Stripped-User-Name}:-%{User-Name}})"``` +| Specify how to find a user | ```filter = "(&()(=%{&Stripped-User-Name || &User-Name)"``` | Retrieve a "known good" password | ```&control.Password.With-Header = ``` | Allow accounts to be explicitly disabled | ```access_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 = "(=%{%{Stripped-User-Name}:-%{User-Name}})"``` +| Specify how to find group objects referencing a user by name. | ```membership_filter = "(=%{&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 = "(|(=%{control.Ldap-UserDn})(=%{%{Stripped-User-Name}:-%{User-Name}}))" +membership_filter = "(|(=%{control.Ldap-UserDn})(=%{&Stripped-User-Name || &User-Name))" ---- **** diff --git a/doc/antora/modules/howto/pages/modules/mschap/index.adoc b/doc/antora/modules/howto/pages/modules/mschap/index.adoc index d60bb755caf..70a8ff0fa79 100644 --- a/doc/antora/modules/howto/pages/modules/mschap/index.adoc +++ b/doc/antora/modules/howto/pages/modules/mschap/index.adoc @@ -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}" diff --git a/doc/antora/modules/howto/pages/modules/sqlippool/index.adoc b/doc/antora/modules/howto/pages/modules/sqlippool/index.adoc index b87acb42424..fcae9b7c7bb 100644 --- a/doc/antora/modules/howto/pages/modules/sqlippool/index.adoc +++ b/doc/antora/modules/howto/pages/modules/sqlippool/index.adoc @@ -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}'" ... ---- diff --git a/doc/antora/modules/installation/pages/upgrade.adoc b/doc/antora/modules/installation/pages/upgrade.adoc index 5dc8f29e59a..50d2d8873e3 100644 --- a/doc/antora/modules/installation/pages/upgrade.adoc +++ b/doc/antora/modules/installation/pages/upgrade.adoc @@ -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. diff --git a/doc/antora/modules/tutorials/pages/multiple_modules.adoc b/doc/antora/modules/tutorials/pages/multiple_modules.adoc index 10706478335..dc638acae44 100644 --- a/doc/antora/modules/tutorials/pages/multiple_modules.adoc +++ b/doc/antora/modules/tutorials/pages/multiple_modules.adoc @@ -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 }