Fix for [ 1932310 ] security check always fail for windows.

git-svn-id: https://tftpy.svn.sourceforge.net/svnroot/tftpy/trunk@82 63283fd4-ec1e-0410-9879-cb7f675518da
This commit is contained in:
msoulier 2008-05-20 02:20:54 +00:00
parent 596af4075f
commit 70f22b1ca1

View file

@ -289,7 +289,7 @@ class TftpServerHandler(TftpSession):
self.filename = os.path.abspath(self.filename)
logger.debug("The absolute path is %s" % self.filename)
# Security check. Make sure it's prefixed by the tftproot.
if re.match(r'%s' % self.root, self.filename):
if self.filename.find(self.root) == 0:
logger.debug("The path appears to be safe: %s" %
self.filename)
else: