From ccab8340021b5ea2db172fdfb74045f8f26ab376 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Mon, 11 Oct 2004 16:24:42 +0000
Subject: [PATCH] Commit old change: In dbcheck, if the regex from table_regex
 is not "anchored" (^xxx$) then force it to be anchored by wrapping it.

---
 db/libdb.pm.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/db/libdb.pm.in b/db/libdb.pm.in
index 2a93d873a2..081842f763 100644
--- a/db/libdb.pm.in
+++ b/db/libdb.pm.in
@@ -4242,6 +4242,13 @@ sub TBcheck_dbslot($$$;$)
 	    "    Functional DB checks not implemented: $table/$column!\n");
     }
 
+    # Make sure the regex is anchored. Its a mistake not to be!
+    $check = "^" . $check
+	if (! ($check =~ /^\^/));
+
+    $check = $check . "\$"
+	if (! ($check =~ /\Q$/));
+
     # Check regex.
     return 0
 	if (! ("$token" =~ /$check/));
-- 
GitLab