fix checking signed files
Rpms which are signed with unknown key would raise an error. Ignore checking of signing key validity.
This commit is contained in:
parent
3d698be2a7
commit
f69824041d
1 changed files with 4 additions and 2 deletions
|
|
@ -1773,7 +1773,7 @@ def downloadFile(url, path=None, fo=None):
|
|||
"""
|
||||
|
||||
if not fo:
|
||||
fo = open(path, "wb")
|
||||
fo = open(path, "w+b")
|
||||
|
||||
resp = request_with_retry().get(url, stream=True)
|
||||
try:
|
||||
|
|
@ -1829,13 +1829,15 @@ def _check_rpm_file(fo):
|
|||
"""Check that the open file appears to be an rpm"""
|
||||
# TODO: trap exception and raise something with more infomation
|
||||
ts = rpm.TransactionSet()
|
||||
# for basic validity we can ignore sigs as there needn't be public keys installed
|
||||
ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
|
||||
try:
|
||||
hdr = ts.hdrFromFdno(fo.fileno())
|
||||
except rpm.error as ex:
|
||||
raise GenericError("rpm's header can't be extracted: %s (rpm error: %s)" %
|
||||
(fo.name, ', '.join(ex.args)))
|
||||
try:
|
||||
rpm.TransactionSet().hdrCheck(hdr.unload())
|
||||
ts.hdrCheck(hdr.unload())
|
||||
except rpm.error as ex:
|
||||
raise GenericError("rpm's header can't be checked: %s (rpm error: %s)" %
|
||||
(fo.name, ', '.join(ex.args)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue