changeset 13533:b4f5f76386f2

statichttprepo: abort if opener mode is 'r+' or 'rb+' The old version of the check failed to catch modifying modes 'r+' and 'rb+'.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 18 Feb 2011 01:19:01 +0100
parents d4c2f2ac3ff7
children 0d3cce1de233
files mercurial/statichttprepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/statichttprepo.py	Fri Mar 04 14:11:15 2011 +0100
+++ b/mercurial/statichttprepo.py	Fri Feb 18 01:19:01 2011 +0100
@@ -71,7 +71,7 @@
         """return a function that opens files over http"""
         p = base
         def o(path, mode="r", atomictemp=None):
-            if 'a' in mode or 'w' in mode:
+            if mode not in ('r', 'rb'):
                 raise IOError('Permission denied')
             f = "/".join((p, urllib.quote(path)))
             return httprangereader(f, urlopener)