From: hickert Date: Mon, 29 Jun 2009 13:59:35 +0000 (+0000) Subject: Updated encryption script to encrypt snapshot passwords too. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=788775cc1a02f0423517f85f674195761977594f;p=gosa.git Updated encryption script to encrypt snapshot passwords too. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13822 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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");