Properly quote passwords sent to pkisilent so special characters work.

Also check for url-encoded passwords before logging them.

ticket 324
This commit is contained in:
Rob Crittenden
2010-11-30 17:00:54 -05:00
committed by Simo Sorce
parent 67d1c07112
commit 623abc6bdf
2 changed files with 12 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ import random
import os, sys, traceback, readline
import stat
import shutil
import urllib2
from ipapython import ipavalidate
from types import *
@@ -129,6 +130,10 @@ def run(args, stdin=None, raiseonerr=True, nolog=(), env=None):
args = args.replace(value, 'XXXXXXXX')
stdout = stdout.replace(value, 'XXXXXXXX')
stderr = stderr.replace(value, 'XXXXXXXX')
quoted = urllib2.quote(value)
args = args.replace(quoted, 'XXXXXXXX')
stdout = stdout.replace(quoted, 'XXXXXXXX')
stderr = stderr.replace(quoted, 'XXXXXXXX')
logging.info('args=%s' % args)
logging.info('stdout=%s' % stdout)
logging.info('stderr=%s' % stderr)