summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server/deployment/pkiparser.py
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2013-10-04 12:41:43 -0700
committerNathan Kinder <nkinder@redhat.com>2013-10-07 09:56:29 -0700
commit443159f77e87a70bc85ab85f5ad58b9169def88a (patch)
tree3c868e505b9ee2efbcba2fc0ae3c5adcbe440d81 /base/server/python/pki/server/deployment/pkiparser.py
parent1b3f3bd95dfc3ed71014460d01600eda5d934977 (diff)
downloadpki-443159f77e87a70bc85ab85f5ad58b9169def88a.tar.gz
pki-443159f77e87a70bc85ab85f5ad58b9169def88a.tar.xz
pki-443159f77e87a70bc85ab85f5ad58b9169def88a.zip
Ticket 755 - Detect unescaped percent characters in deployment files
The deployment config files used by pkispawn support interpolation as supplied by ConfigParser. Interpolation uses the '%' character, which means values that need to contain a '%' character need to be properly escaped. This patch detects errors with unescaped '%' characters and reports a useful message bac kto the user who is running pkispawn. This patch also adds notes to the pkispawn and pki_default.cfg man pages to explain that escaping of '%' characters is required.
Diffstat (limited to 'base/server/python/pki/server/deployment/pkiparser.py')
-rw-r--r--base/server/python/pki/server/deployment/pkiparser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py
index 523d79e78..8a75b8fe3 100644
--- a/base/server/python/pki/server/deployment/pkiparser.py
+++ b/base/server/python/pki/server/deployment/pkiparser.py
@@ -1120,6 +1120,12 @@ class PKIConfigParser:
config.pki_log.error(log.PKIHELPER_DICTIONARY_MASTER_MISSING_KEY_1,
err, extra=config.PKI_INDENTATION_LEVEL_2)
raise
+ except ConfigParser.InterpolationSyntaxError as err:
+ config.pki_log.error(log.PKIHELPER_DICTIONARY_INTERPOLATION_1,
+ extra=config.PKI_INDENTATION_LEVEL_2)
+ config.pki_log.error(log.PKIHELPER_DICTIONARY_INTERPOLATION_2, err,
+ extra=config.PKI_INDENTATION_LEVEL_2)
+ sys.exit(1)
return