X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fbin%2Fgosa-encrypt-passwords;h=7d5c69d1ba7712a11752fce1e3dc078745bbf47c;hb=c2e8f07cad56859137daa1d5351affcda02df86d;hp=05568bdb81b41babee787ad7f8e7cc294eb62292;hpb=e39dc9361cceb93717f69d5db736eaf594dde9db;p=gosa.git diff --git a/gosa-core/bin/gosa-encrypt-passwords b/gosa-core/bin/gosa-encrypt-passwords index 05568bdb8..7d5c69d1b 100755 --- a/gosa-core/bin/gosa-encrypt-passwords +++ b/gosa-core/bin/gosa-encrypt-passwords @@ -64,14 +64,24 @@ $conf = new DOMDocument(); $conf->load("/etc/gosa/gosa.conf") or die ("Cannot read /etc/gosa/gosa.conf - aborted\n"); $conf->encoding = 'UTF-8'; $referrals= $conf->getElementsByTagName("referral"); -echo "* encrypting existent passwords with master key\n"; foreach($referrals as $referral){ $user = $referral->attributes->getNamedItem("adminDn"); - echo "* encrypting password for: ".$user->nodeValue."\n"; + echo "* encrypting GOsa password for: ".$user->nodeValue."\n"; $pw= $referral->attributes->getNamedItem("adminPassword"); $pw->nodeValue= cred_encrypt($pw->nodeValue, $master_key); } +# Encrypt the snapshot passwords +$locations= $conf->getElementsByTagName("location"); +foreach($locations as $location){ + $name = $location->attributes->getNamedItem("name"); + $node = $location->attributes->getNamedItem("snapshotAdminPassword"); + if($node->nodeValue){ + echo "* encrypting snapshot pasword for location: ".$name->nodeValue."\n"; + $node->nodeValue = cred_encrypt($node->nodeValue, $master_key);; + } +} + # Move original gosa.conf out of the way and make it unreadable for the web user echo "* creating backup in /etc/gosa/gosa.conf.orig\n"; rename("/etc/gosa/gosa.conf", "/etc/gosa/gosa.conf.orig");