CVS: tmda-cgi Install.py,1.34,1.35

Jim Ramsay <[email protected]> Fri, 19 Mar 2004 12:05:53 -0800
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda-cgi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20139

Modified Files:
	Install.py 
Log Message:
The RE search now returns the first (from the left) directory with a '.' in it 
as the Domain.

This will cause funny results for systems who have regular users whose HOME path
has a directory level with a '.' in it.

If that is a real issue, it should not be too difficult to only check for the 
domain using this RE if virtual users are enabled.



Index: Install.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Install.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- Install.py	19 Mar 2004 16:54:58 -0000	1.34
+++ Install.py	19 Mar 2004 20:05:51 -0000	1.35
@@ -660,7 +660,7 @@
   }
   Dict["ShortUrlDom"] = re.sub("^www\.", "", Dict["UrlDomain"], re.I)
   Dict["qUser"] = re.sub("\.", ":", Dict["User"])
-  Match = re.search(".*/([^\./]+\.[^/]+)/([^/]+/)*[^/]+/?$", Dict["Home"])
+  Match = re.search("^/(?:[^\./]+/)+([^\./]+\.[^/]+)/(?:[^/]+/)+/?$", Dict["Home"])
   if Match: Dict["Domain"] = Match.group(1)
 
   # Load the display template