gunnar: server/perl-kolab/perl-kolab/bin kolabpasswd.in,1.2,1.3

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/bin
In directory doto:/tmp/cvs-serv4457/perl-kolab/bin

Modified Files:
	kolabpasswd.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: kolabpasswd.in
===================================================================
RCS file: /kolabrepository/server/perl-kolab/perl-kolab/bin/kolabpasswd.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- kolabpasswd.in	11 Mar 2010 12:23:12 -0000	1.2
+++ kolabpasswd.in	11 Mar 2010 16:19:47 -0000	1.3
@@ -45,9 +45,11 @@
 
 =cut
 
-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 Term::ReadKey;
 use IO::File;
@@ -122,6 +124,7 @@
 my %config = readConfig($kolabconfname);
 my $kolabconf = IO::File->new('@CONFIG_DIR@/kolab.conf','r')
                 || die "kolabpasswd: Fatal Error: could not open kolab config at $kolabconfname";
+binmode($kolabconf, ":encoding(UTF-8)");
 
 my $account = 'manager';
 my $account_dn = $config{'bind_dn'};
@@ -164,8 +167,9 @@
 # create temporary config file
 my $tmp = new File::Temp( TEMPLATE => 'tempXXXXX', DIR => '@CONFIG_DIR@', UNLINK => 0, SUFFIX => '.conf')
      || die "Error: could not create temporary file under @CONFIG_DIR@";
+binmode($tmp, ":encoding(UTF-8)");
 $tmpfilename = $tmp->filename;
-$bind_pw_hash = hashPassword2($new_password);
+$bind_pw_hash = hashPassword($new_password);
 
 # copy and replace old config to temporary file
 foreach ($kolabconf->getlines()) {





More information about the commits mailing list