Work around pkisilent bugs.

Check directory manager password and certificate subject base for
invalid characters.
(https://bugzilla.redhat.com/show_bug.cgi?id=658641)

Shell-escape pkisilent command-line arguments.
(https://bugzilla.redhat.com/show_bug.cgi?id=741180)

ticket 1636
This commit is contained in:
Jan Cholasta
2011-09-26 08:27:01 +02:00
committed by Rob Crittenden
parent 3fb40170cb
commit 209bcb0b98
4 changed files with 58 additions and 25 deletions

View File

@@ -196,6 +196,9 @@ def write_tmp_file(txt):
return fd
def shell_quote(string):
return "'" + string.replace("'", "'\\''") + "'"
def run(args, stdin=None, raiseonerr=True,
nolog=(), env=None, capture_output=True):
"""
@@ -248,7 +251,8 @@ def run(args, stdin=None, raiseonerr=True,
continue
quoted = urllib2.quote(value)
for nolog_value in (value, quoted):
shquoted = shell_quote(value)
for nolog_value in (shquoted, value, quoted):
if capture_output:
stdout = stdout.replace(nolog_value, 'XXXXXXXX')
stderr = stderr.replace(nolog_value, 'XXXXXXXX')