]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add test of !~ for rlm_files conditions
authorNick Porter <nick@portercomputing.co.uk>
Thu, 18 Dec 2025 17:19:23 +0000 (17:19 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 18 Dec 2025 17:49:42 +0000 (17:49 +0000)
src/tests/modules/files/authorize
src/tests/modules/files/regex-not.attrs [new file with mode: 0644]
src/tests/modules/files/regex-not.unlang [new file with mode: 0644]

index 8ecc37a3f61ef1ff62c4917beb32951afc9a6ff2..abc16eed6c9f04a6aa49dad79051433ba1f6b581 100644 (file)
@@ -115,6 +115,9 @@ addcontrol  Reply-Message += "success2"
 regex  NAS-Identifier =~ /der/, Password.Cleartext := "testing123"
        Reply-Message := "wonderful"
 
+regex  NAS-Identifier !~ /der/, NAS-Identifier !~ /foo/, Password.Cleartext := "testing123"
+       Reply-Message := "totally amazing"
+
 vendor Password.Cleartext := "we_are_so_smart"
        Cisco.AVPair := "1",
        Cisco.AVPair += "2"
diff --git a/src/tests/modules/files/regex-not.attrs b/src/tests/modules/files/regex-not.attrs
new file mode 100644 (file)
index 0000000..ffb20da
--- /dev/null
@@ -0,0 +1,13 @@
+#
+#  Input packet
+#
+Packet-Type = Access-Request
+User-Name = "regex"
+User-Password = "testing123"
+NAS-Identifier = "special"
+
+#
+#  Expected answer
+#
+Packet-Type == Access-Accept
+Reply-Message == "totally amazing"
diff --git a/src/tests/modules/files/regex-not.unlang b/src/tests/modules/files/regex-not.unlang
new file mode 100644 (file)
index 0000000..027271b
--- /dev/null
@@ -0,0 +1 @@
+files