summaryrefslogtreecommitdiffstats
path: root/ipapython/ipautil.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-11-30 17:00:54 -0500
committerSimo Sorce <ssorce@redhat.com>2010-12-17 16:50:14 -0500
commit623abc6bdff15a77fc14eac9dc1af975e9d98b2f (patch)
tree817425f0de3d1e283a90c5f6a9d2a595da74d23f /ipapython/ipautil.py
parent67d1c0711283e840a68597e119daabbf3d090872 (diff)
downloadfreeipa-623abc6bdff15a77fc14eac9dc1af975e9d98b2f.tar.gz
freeipa-623abc6bdff15a77fc14eac9dc1af975e9d98b2f.tar.xz
freeipa-623abc6bdff15a77fc14eac9dc1af975e9d98b2f.zip
Properly quote passwords sent to pkisilent so special characters work.
Also check for url-encoded passwords before logging them. ticket 324
Diffstat (limited to 'ipapython/ipautil.py')
-rw-r--r--ipapython/ipautil.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 9a3e8a6a9..236de51f4 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -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)