Show More
@@ -138,7 +138,7 b' def ispathsafe(path):' | |||
|
138 | 138 | """Determine if a path is safe to use for filesystem access.""" |
|
139 | 139 | parts = path.split('/') |
|
140 | 140 | for part in parts: |
|
141 |
if (part in ('', os.curdir, |
|
|
141 | if (part in ('', os.curdir, pycompat.ospardir) or | |
|
142 | 142 | pycompat.ossep in part or |
|
143 | 143 | pycompat.osaltsep is not None and pycompat.osaltsep in part): |
|
144 | 144 | return False |
@@ -65,7 +65,7 b' class pathauditor(object):' | |||
|
65 | 65 | parts = util.splitpath(path) |
|
66 | 66 | if (os.path.splitdrive(path)[0] |
|
67 | 67 | or _lowerclean(parts[0]) in ('.hg', '.hg.', '') |
|
68 |
or |
|
|
68 | or pycompat.ospardir in parts): | |
|
69 | 69 | raise error.Abort(_("path contains illegal component: %s") % path) |
|
70 | 70 | # Windows shortname aliases |
|
71 | 71 | for p in parts: |
@@ -51,6 +51,7 b' if ispy3:' | |||
|
51 | 51 | oslinesep = os.linesep.encode('ascii') |
|
52 | 52 | osname = os.name.encode('ascii') |
|
53 | 53 | ospathsep = os.pathsep.encode('ascii') |
|
54 | ospardir = os.pardir.encode('ascii') | |
|
54 | 55 | ossep = os.sep.encode('ascii') |
|
55 | 56 | osaltsep = os.altsep |
|
56 | 57 | if osaltsep: |
@@ -323,6 +324,7 b' else:' | |||
|
323 | 324 | oslinesep = os.linesep |
|
324 | 325 | osname = os.name |
|
325 | 326 | ospathsep = os.pathsep |
|
327 | ospardir = os.pardir | |
|
326 | 328 | ossep = os.sep |
|
327 | 329 | osaltsep = os.altsep |
|
328 | 330 | stdin = sys.stdin |
@@ -1600,7 +1600,7 b' def stylemap(styles, paths=None):' | |||
|
1600 | 1600 | for style in styles: |
|
1601 | 1601 | # only plain name is allowed to honor template paths |
|
1602 | 1602 | if (not style |
|
1603 |
or style in (os.curdir, |
|
|
1603 | or style in (os.curdir, pycompat.ospardir) | |
|
1604 | 1604 | or pycompat.ossep in style |
|
1605 | 1605 | or pycompat.osaltsep and pycompat.osaltsep in style): |
|
1606 | 1606 | continue |
General Comments 0
You need to be logged in to leave comments.
Login now