martin: server/kolabd/kolabd kolabpasswd,1.4,1.5

cvs at intevation.de cvs at intevation.de
Thu Dec 23 10:10:27 CET 2004


Author: martin

Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv15416

Modified Files:
	kolabpasswd 
Log Message:
Martin K.: better use SHA for storing the manager password in LDAP


Index: kolabpasswd
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolabpasswd,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kolabpasswd	22 Dec 2004 13:50:03 -0000	1.4
+++ kolabpasswd	23 Dec 2004 09:10:25 -0000	1.5
@@ -87,6 +87,8 @@
 ReadMode 'normal';
 ($new_password eq $new_password2) || die "Sorry, passwords do not match.\n";
 
+my $bind_pw_hash;
+
 # create temporary config file
 my $tmp = new File::Temp( TEMPLATE => 'tempXXXXX', DIR => $kolab_prefix.'/etc/kolab', UNLINK => 0, SUFFIX => '.conf')
      || die "Error: could not create temporary file under ".$kolab_prefix."/etc/kolab";
@@ -99,7 +101,7 @@
 	    print $tmp $1.$new_password."\n";
 	} else {
 	    if (/^(bind_pw_hash\s:\s).*$/) {
-		my $bind_pw_hash = hashPassword($new_password);
+		$bind_pw_hash = hashPassword($new_password);
 		print $tmp $1.$bind_pw_hash."\n"; 
 	    } else {
 		print $tmp $_;
@@ -127,7 +129,7 @@
    || die "Error: could not connect LDAP Server";
 $ldap->bind( $config{'bind_dn'}, password => $config{'bind_pw'} )
    || die "Error: Failed to bind as manager to LDAP Server";
-$ldap->modify($account_dn, replace => {'userPassword' => $new_password } )
+$ldap->modify($account_dn, replace => {'userPassword' => $bind_pw_hash } )
    || die "Error: could not update LDAP with new manager password";
 $ldap->unbind;
 undef $ldap;





More information about the commits mailing list