gunnar: server/perl-kolab/perl-kolab/sbin kolab_bootstrap.in, 1.3, 1.4

cvs at kolab.org cvs at kolab.org
Thu Mar 11 17:19:50 CET 2010


Author: gunnar

Update of /kolabrepository/server/perl-kolab/perl-kolab/sbin
In directory doto:/tmp/cvs-serv4457/perl-kolab/sbin

Modified Files:
	kolab_bootstrap.in 
Log Message:
The last variant also failed. This is now an approach suggested by Sascha and it even seems to work.

kolab/issue919 (kolab server has problems with some characters in passwords (rt#5558)) 

Index: kolab_bootstrap.in
===================================================================
RCS file: /kolabrepository/server/perl-kolab/perl-kolab/sbin/kolab_bootstrap.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- kolab_bootstrap.in	4 Mar 2010 23:37:27 -0000	1.3
+++ kolab_bootstrap.in	11 Mar 2010 16:19:48 -0000	1.4
@@ -48,9 +48,11 @@
 use strict;
 use vars qw($opt_b $opt_f);
 
-use locale;
-use utf8;
-use open 'utf8';
+use Encode;
+use I18N::Langinfo qw(langinfo YESSTR CODESET);
+my $local_codeset = langinfo(CODESET());
+
+binmode(STDIN, ":encoding($local_codeset)");
 
 use URI;
 use Socket;
@@ -327,7 +329,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'} || hashPassword2( $bind_pw );
+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";
@@ -407,7 +409,7 @@
       chomp $bind_pw;
       $bind_pw = getUserInput("Please choose a manager password", $bind_pw);
       print " bind_pw : $bind_pw\n";
-      $bind_pw_hash = hashPassword2($bind_pw);
+      $bind_pw_hash = hashPassword($bind_pw);
     }
 
     # Generate passwords
@@ -425,6 +427,7 @@
     }
 
     my $fd = IO::File->new($kolab_config, "w+") || die "could not open $kolab_config";
+    binmode($fd, ":encoding(UTF-8)");
     print $fd "fqdnhostname : $fqdn\n";
     print $fd "is_master : $is_master\n";
     print $fd "base_dn : $base_dn\n";
@@ -618,7 +621,7 @@
       # create php read-only user
       $ldapobject = newOrExistingLDAPEntry( $ldap, "cn=nobody,cn=internal,$base_dn" );
       $ldapobject->replace('cn' => 'nobody', 'sn' => 'n/a n/a', 'uid' => 'nobody',
-                           'userPassword' => hashPassword2($php_pw),
+                           'userPassword' => hashPassword($php_pw),
                            'objectclass' => ['top','inetorgperson','kolabinetorgperson']);
       $ldapobject->dn("cn=nobody,cn=internal,$base_dn");
       $mesg = $ldapobject->update($ldap);
@@ -628,7 +631,7 @@
       # create calendar user
       $ldapobject = newOrExistingLDAPEntry( $ldap, "cn=$calendar_id@" . $domain . ",cn=internal,$base_dn" );
       $ldapobject->replace('cn' => $calendar_id . '@' . $domain, 'sn' => 'n/a n/a', 'uid' => $calendar_id . '@' . $domain,
-                           'userPassword' => hashPassword2($calendar_pw),
+                           'userPassword' => hashPassword($calendar_pw),
                            'objectclass' => ['top','inetorgperson','kolabinetorgperson']);
       $ldapobject->dn("cn=$calendar_id@" . $domain . ",cn=internal,$base_dn");
       $mesg = $ldapobject->update($ldap);
@@ -755,7 +758,7 @@
 
   $bind_dn = "cn=manager,cn=internal,$base_dn";
   $bind_pw = getUserInput("Manager password");
-  $bind_pw_hash = hashPassword2($bind_pw);
+  $bind_pw_hash = hashPassword($bind_pw);
 
   my $confname = "$Kolab::config{'sasl_smtpconffile'}";
   copy("@CONFIG_DIR@/templates/smtpd.conf.template", $confname) || die "could not write to $confname";
@@ -826,6 +829,7 @@
   (print "Error reading calendar password" && goto SLAVESTART) unless( $calendar_pw );
 
   my $fd = IO::File->new($kolab_config, "w+") || die "could not open $kolab_config";
+  binmode($fd, ":encoding(UTF-8)");
   print $fd "fqdnhostname : $fqdn\n";
   print $fd "is_master : $is_master\n";
   print $fd "base_dn : $base_dn\n";
@@ -924,6 +928,7 @@
   kolab_system("$Kolab::config{'sbindir'}/kolabconf -n");
 
   $fd = IO::File->new($kolab_config, "w+") || die "could not open $kolab_config";
+  binmode($fd, ":encoding(UTF-8)");
   print $fd "fqdnhostname : $fqdn\n";
   print $fd "is_master : $is_master\n";
   print $fd "base_dn : $base_dn\n";





More information about the commits mailing list