fix character classes to be happy with python 2.1
authorrmurray <>
Thu, 20 Mar 2003 03:08:58 +0000 (03:08 +0000)
committerrmurray <>
Thu, 20 Mar 2003 03:08:58 +0000 (03:08 +0000)
ud-mailgate

index e8bff01..916ea6b 100755 (executable)
@@ -180,14 +180,14 @@ def DoSSH(Str,Attrs):
 #  host in a 12.12.12.12
 #  host in cname foo.bar.    <- Trailing dot is required
 def DoDNS(Str,Attrs,DnRecord):
-   cname = re.match("^[\w-]+\s+in\s+cname\s+[\w.\-]+\.$",Str,re.IGNORECASE);
-   if re.match('^[\w-]+\s+in\s+a\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$',\
+   cname = re.match("^[-\w]+\s+in\s+cname\s+[-\w.]+\.$",Str,re.IGNORECASE);
+   if re.match('^[-\w]+\s+in\s+a\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$',\
         Str,re.IGNORECASE) == None and cname == None and \
-      re.match("^[\w-]+\s+in\s+mx\s+\d{1,3}\s+[\w.\-]+\.$",Str,re.IGNORECASE) == None:
+      re.match("^[-\w]+\s+in\s+mx\s+\d{1,3}\s+[-\w.]+\.$",Str,re.IGNORECASE) == None:
      return None;     
 
    # Check if the name is already taken
-   G = re.match('^([\w-+]+)\s',Str).groups();
+   G = re.match('^([-\w+]+)\s',Str).groups();
 
    # Check for collisions
    global l;