steffen: server/kolab/kolab kolab_bootstrap,1.60,1.61

cvs at intevation.de cvs at intevation.de
Mon Sep 6 16:00:38 CEST 2004


Author: steffen

Update of /kolabrepository/server/kolab/kolab
In directory doto:/tmp/cvs-serv9064/kolab/kolab

Modified Files:
	kolab_bootstrap 
Log Message:
store hashed manager password in kolab.conf to avoid rehashing each time we run kolabconf

Index: kolab_bootstrap
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolab_bootstrap,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- kolab_bootstrap	5 Sep 2004 15:19:19 -0000	1.60
+++ kolab_bootstrap	6 Sep 2004 14:00:36 -0000	1.61
@@ -61,6 +61,14 @@
   }
 }
 
+# Hash a password
+sub hashPassword {
+  my $pw = shift;
+  my $hashcmd = $config{'prefix'}."/sbin/slappasswd -s '".$pw."'";
+  chomp($pw);
+  return $pw;
+}
+
 # Ask the user a question
 sub getUserInput {
   my $text = shift;
@@ -192,6 +200,7 @@
 my $is_master = $kolab_config{'is_master'} || "true";
 my $bind_dn = $kolab_config{'bind_dn'} || die "could not read bind_dn from $kolab_config";
 my $bind_pw = $kolab_config{'bind_pw'} || die "could not read bind_pw from $kolab_config";
+my $bind_pw_hash = $kolab_config{'bind_pw_hash'} || hashPassword( $bind_pw );
 my $ldap_uri = $kolab_config{'ldap_uri'} || die "could not read ldap_uri from $kolab_config";
 my $base_dn = $kolab_config{'base_dn'} || die "could not read base_dn from $kolab_config";
 my $php_dn = $kolab_config{'php_dn'} || die "could not read php_dn from $kolab_config";
@@ -261,6 +270,7 @@
       chomp $bind_pw;
       $bind_pw = getUserInput("Please choose a manager password", $bind_pw);
       print " bind_pw : $bind_pw\n";
+      $bind_pw_hash = hashPassword($bind_pw);
     }
     if ($php_dn =~ /\@\@\@/) {
       $php_dn =~ s/\@\@\@kolab_basedn\@\@\@/$base_dn/g;
@@ -270,13 +280,13 @@
       chomp $php_pw;
     }
 
-
     $fd = IO::File->new($kolab_config, "w+") || die "could not open $kolab_config";
     print $fd "fqdnhostname : $fqdn\n";
     print $fd "is_master : $is_master\n";
     print $fd "base_dn : $base_dn\n";
     print $fd "bind_dn : $bind_dn\n";
     print $fd "bind_pw : $bind_pw\n";
+    print $fd "bind_pw_hash : $bind_pw_hash\n";
     print $fd "ldap_uri : $ldap_uri\n";
     print $fd "ldap_master_uri : $ldap_uri\n";
     print $fd "php_dn : $php_dn\n";





More information about the commits mailing list