summaryrefslogtreecommitdiffstats
path: root/ipapython/certmonger.py
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2014-10-14 06:54:00 -0400
committerMartin Kosek <mkosek@redhat.com>2014-10-16 09:49:46 +0200
commit3f9d1a71f1087ab1b203e8ce51eeb14194f7f0a2 (patch)
tree47eda33b7079abf313f4ab0dfa5726fa6eb1e2df /ipapython/certmonger.py
parent47731f45845a4cc27da65b98a6ba82388824f363 (diff)
downloadfreeipa-3f9d1a71f1087ab1b203e8ce51eeb14194f7f0a2.tar.gz
freeipa-3f9d1a71f1087ab1b203e8ce51eeb14194f7f0a2.tar.xz
freeipa-3f9d1a71f1087ab1b203e8ce51eeb14194f7f0a2.zip
Fix typo causing certmonger is provided with wrong path to ipa-submit.
Using strip() instead split() caused that only first character of path was specified. Also using shlex for more robust parsing. https://fedorahosted.org/freeipa/ticket/4624 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython/certmonger.py')
-rw-r--r--ipapython/certmonger.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py
index ca8b37392..dc6cff966 100644
--- a/ipapython/certmonger.py
+++ b/ipapython/certmonger.py
@@ -26,6 +26,7 @@ import os
import sys
import time
import dbus
+import shlex
from ipapython import ipautil
from ipapython import dogtag
from ipapython.ipa_log_manager import *
@@ -371,7 +372,7 @@ def add_principal_to_cas(principal):
ca = _find_IPA_ca()
if ca:
ext_helper = ca.prop_if.Get(DBUS_CM_CA_IF, 'external-helper')
- if ext_helper and ext_helper.find('-k') == -1:
+ if ext_helper and '-k' not in shlex.split(ext_helper):
ext_helper = '%s -k %s' % (ext_helper.strip(), principal)
ca.prop_if.Set(DBUS_CM_CA_IF, 'external-helper', ext_helper)
@@ -383,8 +384,8 @@ def remove_principal_from_cas():
ca = _find_IPA_ca()
if ca:
ext_helper = ca.prop_if.Get(DBUS_CM_CA_IF, 'external-helper')
- if ext_helper and ext_helper.find('-k'):
- ext_helper = ext_helper.strip()[0]
+ if ext_helper and '-k' in shlex.split(ext_helper):
+ ext_helper = shlex.split(ext_helper)[0]
ca.prop_if.Set(DBUS_CM_CA_IF, 'external-helper', ext_helper)