Fix the patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=328
This commit is contained in:
parent
d38335e738
commit
9a59733bbe
@ -45,17 +45,17 @@
|
|||||||
# Part 1: top-level interface.
|
# Part 1: top-level interface.
|
||||||
|
|
||||||
def getcaps():
|
def getcaps():
|
||||||
@@ -16,6 +24,10 @@ def getcaps():
|
@@ -18,6 +26,10 @@ def getcaps():
|
||||||
where the viewing command is stored with the key "view".
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
+ if _find_unsafe(filename):
|
|
||||||
+ msg = "Refusing to use mailcap with filename %r. Use a safe temporary filename." % (filename,)
|
|
||||||
+ warnings.warn(msg, UnsafeMailcapInput)
|
|
||||||
+ return None, None
|
|
||||||
caps = {}
|
caps = {}
|
||||||
for mailcap in listmailcapfiles():
|
for mailcap in listmailcapfiles():
|
||||||
|
+ if _find_unsafe(mailcap):
|
||||||
|
+ msg = "Refusing to use mailcap with filename %r. Use a safe temporary filename." % (mailcap,)
|
||||||
|
+ warnings.warn(msg, UnsafeMailcapInput)
|
||||||
|
+ return None, None
|
||||||
try:
|
try:
|
||||||
|
fp = open(mailcap, 'r')
|
||||||
|
except IOError:
|
||||||
@@ -149,10 +161,13 @@ def findmatch(caps, MIMEtype, key='view'
|
@@ -149,10 +161,13 @@ def findmatch(caps, MIMEtype, key='view'
|
||||||
for e in entries:
|
for e in entries:
|
||||||
if 'test' in e:
|
if 'test' in e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user