Skip to content

Commit

Permalink
Do not split keyring paths on whitespace
Browse files Browse the repository at this point in the history
Spaces in filenames are valid although unlikely on Unix systems.
  • Loading branch information
pabs3 authored and rickysarraf committed May 30, 2020
1 parent b806385 commit 5a2d8e2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apt_offline_core/AptOfflineCoreLib.py
Expand Up @@ -612,19 +612,16 @@ def __init__(self, gpgv=None, keyring=None, Simulate=False):
self.opts.append("--ignore-time-conflict")
for eachPath in self.defaultPaths:
if os.path.isfile(eachPath):
eachKeyring = "--keyring %s" % (eachPath)
self.opts.extend(eachKeyring.split())
self.opts.extend(["--keyring", eachPath])
elif os.path.isdir(eachPath):
for eachGPG in os.listdir(eachPath):
eachGPG = os.path.join(eachPath, eachGPG)
log.verbose("Adding %s to the apt-offline keyring\n" % (eachGPG) )
eachKeyring = "--keyring %s" % (eachGPG)
self.opts.extend(eachKeyring.split())
self.opts.extend(["--keyring", eachGPG])
if len(self.opts) == 1:
log.err("No valid keyring paths found in: %s\n" % (", ".join(self.defaultPaths)))
else:
finalKeyring = "--keyring %s --ignore-time-conflict" % (keyring)
self.opts.extend(finalKeyring.split())
self.opts.extend(["--keyring", keyring, "--ignore-time-conflict"])

def VerifySig(self, signature_file, signed_file):

Expand Down

0 comments on commit 5a2d8e2

Please sign in to comment.