]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rename ldap escape and unescape xlats...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 Jan 2024 23:09:44 +0000 (17:09 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 Jan 2024 23:09:44 +0000 (17:09 -0600)
doc/antora/modules/raddb/pages/mods-available/ldap.adoc
raddb/mods-available/ldap
src/modules/rlm_ldap/rlm_ldap.c
src/tests/modules/ldap/xlat.unlang

index e8a6d5fc79c7a42a94ec708adb5fee8a3086163f..1fc1b45ce69b4c87dd996c15c3b6b80cce82b82a 100644 (file)
@@ -744,7 +744,7 @@ binds which there can be on a single thread.
 
 The rlm_ldap provides the below xlat's functions.
 
-### %ldap_escape(...}
+### %ldap.escape(...}
 
 Escape a string for use in an LDAP filter or DN.
 
@@ -755,7 +755,7 @@ Escape a string for use in an LDAP filter or DN.
 [source,unlang]
 ----
 &my-string := "ldap:///ou=profiles,dc=example,dc=com??sub?(objectClass=radiusprofile)"
-&reply.Reply-Message := "The LDAP url is %ldap_escape(%{my-string}}"
+&reply.Reply-Message := "The LDAP url is %ldap.escape(%{my-string}}"
 ----
 
 .Output
@@ -764,7 +764,7 @@ Escape a string for use in an LDAP filter or DN.
 "The LDAP url is ldap:///ou=profiles,dc=example,dc=com??sub?\28objectClass=radiusprofile\29"
 ```
 
-### %ldap_unescape(...)
+### %ldap.unescape(...)
 
 Unescape a string for use in an LDAP filter or DN.
 
@@ -775,7 +775,7 @@ Unescape a string for use in an LDAP filter or DN.
 [source,unlang]
 ----
 &my-string := "ldap:///ou=profiles,dc=example,dc=com??sub?\28objectClass=radiusprofile\29"
-&reply.Reply-Message := "The LDAP url is %ldap_unescape(%{my-string})"
+&reply.Reply-Message := "The LDAP url is %ldap.unescape(%{my-string})"
 ----
 
 .Output
index 912452f8032d12d41f24cf7ffc0fda19c6c709ad..ec45c5cfe9ada39ffd05727bb6ff851ae4fb611b 100644 (file)
@@ -884,7 +884,7 @@ ldap {
 #
 #  The rlm_ldap provides the below xlat's functions.
 #
-#  ### %ldap_escape(...}
+#  ### %ldap.escape(...}
 #
 #  Escape a string for use in an LDAP filter or DN.
 #
@@ -895,7 +895,7 @@ ldap {
 #  [source,unlang]
 #  ----
 #  &my-string := "ldap:///ou=profiles,dc=example,dc=com??sub?(objectClass=radiusprofile)"
-#  &reply.Reply-Message := "The LDAP url is %ldap_escape(%{my-string}}"
+#  &reply.Reply-Message := "The LDAP url is %ldap.escape(%{my-string}}"
 #  ----
 #
 #  .Output
@@ -904,7 +904,7 @@ ldap {
 #  "The LDAP url is ldap:///ou=profiles,dc=example,dc=com??sub?\28objectClass=radiusprofile\29"
 #  ```
 #
-#  ### %ldap_unescape(...)
+#  ### %ldap.unescape(...)
 #
 #  Unescape a string for use in an LDAP filter or DN.
 #
@@ -915,7 +915,7 @@ ldap {
 #  [source,unlang]
 #  ----
 #  &my-string := "ldap:///ou=profiles,dc=example,dc=com??sub?\28objectClass=radiusprofile\29"
-#  &reply.Reply-Message := "The LDAP url is %ldap_unescape(%{my-string})"
+#  &reply.Reply-Message := "The LDAP url is %ldap.unescape(%{my-string})"
 #  ----
 #
 #  .Output
index 513b0ffd613e38cef65b695c06421b77c5583e33..a64c3a6e6070af2ac5306d8a299af0995afd0473 100644 (file)
@@ -2562,10 +2562,10 @@ static int mod_load(void)
 {
        xlat_t  *xlat;
 
-       if (unlikely(!(xlat = xlat_func_register(NULL, "ldap_escape", ldap_escape_xlat, FR_TYPE_STRING)))) return -1;
+       if (unlikely(!(xlat = xlat_func_register(NULL, "ldap.escape", ldap_escape_xlat, FR_TYPE_STRING)))) return -1;
        xlat_func_mono_set(xlat, ldap_escape_xlat_arg);
        xlat_func_flags_set(xlat, XLAT_FUNC_FLAG_PURE);
-       if (unlikely(!(xlat = xlat_func_register(NULL, "ldap_unescape", ldap_unescape_xlat, FR_TYPE_STRING)))) return -1;
+       if (unlikely(!(xlat = xlat_func_register(NULL, "ldap.unescape", ldap_unescape_xlat, FR_TYPE_STRING)))) return -1;
        xlat_func_mono_set(xlat, ldap_escape_xlat_arg);
        xlat_func_flags_set(xlat, XLAT_FUNC_FLAG_PURE);
 
@@ -2574,8 +2574,8 @@ static int mod_load(void)
 
 static void mod_unload(void)
 {
-       xlat_func_unregister("ldap_escape");
-       xlat_func_unregister("ldap_unescape");
+       xlat_func_unregister("ldap.escape");
+       xlat_func_unregister("ldap.unescape");
 }
 
 /* globally exported name */
index b8aa18259b930dd10e4b7f57c69ece4de6cb6878..8daae49be23322265bdc0237989e82c8ef5b6408 100644 (file)
@@ -8,13 +8,13 @@ string result_string
 &test_string := "safe string"
 
 # String with no escaping
-&result_string := %ldap_escape(%{test_string})
+&result_string := %ldap.escape(%{test_string})
 
 if (!(&result_string == "safe string")) {
         test_fail
 }
 
-&result_string := %ldap_unescape(%{result_string})
+&result_string := %ldap.unescape(%{result_string})
 
 if (!(&result_string == 'safe string')) {
         test_fail
@@ -22,13 +22,13 @@ if (!(&result_string == 'safe string')) {
 
 # String with some characters to escape
 &test_string := 'non safe,+"\<>;*=() string'
-&result_string := %ldap_escape(%{test_string})
+&result_string := %ldap.escape(%{test_string})
 
 if (!(&result_string == 'non safe\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29 string')) {
         test_fail
 }
 
-&result_string := %ldap_unescape(%{result_string})
+&result_string := %ldap.unescape(%{result_string})
 
 if (!(&result_string == 'non safe,+"\<>;*=() string')) {
         test_fail
@@ -36,13 +36,13 @@ if (!(&result_string == 'non safe,+"\<>;*=() string')) {
 
 # String where all characters require escaping
 &test_string := ',+"\<>;*=()'
-&result_string := %ldap_escape(%{test_string})
+&result_string := %ldap.escape(%{test_string})
 
 if (!(&result_string == '\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29')) {
         test_fail
 }
 
-&result_string := %ldap_unescape(%{result_string})
+&result_string := %ldap.unescape(%{result_string})
 
 if (!(&result_string == ',+"\<>;*=()')) {
         test_fail