[PATCH 6 of 6] use untrusted settings in hgwebdir
Alexis S. L. Carvalho
alexis at cecm.usp.br
Wed Oct 18 04:52:20 UTC 2006
# HG changeset patch
# User Alexis S. L. Carvalho <alexis at cecm.usp.br>
# Date 1161149398 10800
# Node ID 0ad79af184196771f041baccc8fb16b822c0ddc8
# Parent 72f1422f240f8e933ae9eb2bd3cbe1207f0f9853
use untrusted settings in hgwebdir
diff -r 72f1422f240f -r 0ad79af18419 mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py Wed Oct 18 02:29:56 2006 -0300
+++ b/mercurial/hgweb/hgwebdir_mod.py Wed Oct 18 02:29:58 2006 -0300
@@ -83,9 +83,10 @@ class hgwebdir(object):
"url": url})
def archivelist(ui, nodeid, url):
- allowed = ui.configlist("web", "allow_archive")
+ allowed = ui.configlist("web", "allow_archive", untrusted=True)
for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
- if i[0] in allowed or ui.configbool("web", "allow" + i[0]):
+ if i[0] in allowed or ui.configbool("web", "allow" + i[0],
+ untrusted=True):
yield {"type" : i[0], "extension": i[1],
"node": nodeid, "url": url}
@@ -110,7 +111,8 @@ class hgwebdir(object):
u.readconfig(os.path.join(path, '.hg', 'hgrc'))
except IOError:
pass
- get = u.config
+ def get(section, name, default=None):
+ return u.config(section, name, default, untrusted=True)
url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
.replace("//", "/")) + '/'
More information about the Mercurial-devel
mailing list