comparison mercurial/hgweb/webutil.py @ 39471:15e8250a82da

hgweb: do not audit URL path as working-directory path Since hgweb is an interface to repository data, we don't need to prohibit any paths conflicting within the filesystem. Still an access to working files is audited by filectx.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 26 Aug 2018 22:18:09 +0900
parents d7e6e109eaae
children 4f44f747f094
comparison
equal deleted inserted replaced
39470:17ca967e9fca 39471:15e8250a82da
318 318
319 return templateutil.mappinggenerator(entries) 319 return templateutil.mappinggenerator(entries)
320 320
321 def cleanpath(repo, path): 321 def cleanpath(repo, path):
322 path = path.lstrip('/') 322 path = path.lstrip('/')
323 return pathutil.canonpath(repo.root, '', path) 323 auditor = pathutil.pathauditor(repo.root, realfs=False)
324 return pathutil.canonpath(repo.root, '', path, auditor=auditor)
324 325
325 def changectx(repo, req): 326 def changectx(repo, req):
326 changeid = "tip" 327 changeid = "tip"
327 if 'node' in req.qsparams: 328 if 'node' in req.qsparams:
328 changeid = req.qsparams['node'] 329 changeid = req.qsparams['node']