summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Brinker <chris.brinker@gmail.com>2014-04-24 14:58:15 -0700
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2014-04-25 08:25:33 -0400
commit14c6cfde0761e910b6c3c1924d51cf915ba96e9d (patch)
treef9419055107ba9005b0c625a24cf40a30c44543b
parenta88ce57202d778d0a4d95ef45d3d9361471c4525 (diff)
downloadbcfg2-14c6cfde0761e910b6c3c1924d51cf915ba96e9d.tar.gz
bcfg2-14c6cfde0761e910b6c3c1924d51cf915ba96e9d.tar.bz2
bcfg2-14c6cfde0761e910b6c3c1924d51cf915ba96e9d.zip
Default to only (En|De)crypt vars that need it
For both Encrypting and Decrypting of Properties files, we should by default only attempt to execute on elements that have an "encrypted" attribute defined. The code will already attempt to encrypt every element if nothing in the current document matches this xpath, which catches the case of a user trying to fully encrypt a completely new properties file. Conflicts: src/lib/Bcfg2/Server/Encryption.py
-rwxr-xr-xsrc/sbin/bcfg2-crypt3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sbin/bcfg2-crypt b/src/sbin/bcfg2-crypt
index 5641732cd..2212c2360 100755
--- a/src/sbin/bcfg2-crypt
+++ b/src/sbin/bcfg2-crypt
@@ -200,7 +200,7 @@ class CfgDecryptor(Decryptor):
class PropertiesCryptoMixin(object):
""" Mixin to provide some common methods for Properties crypto """
- default_xpath = '//*'
+ default_xpath = '//*[@encrypted]'
def _get_elements(self, xdata):
""" Get the list of elements to encrypt or decrypt """
@@ -288,7 +288,6 @@ class PropertiesEncryptor(Encryptor, PropertiesCryptoMixin):
class PropertiesDecryptor(Decryptor, PropertiesCryptoMixin):
""" decryptor class for Properties files """
- default_xpath = '//*[@encrypted]'
def decrypt(self):
decrypted_any = False