[bug-notifications] [mutt 0002973]: mutt compiled with libidn does not work with the defaul locale

Mantis Bug Tracker noreply at opencsw.org
Tue Jun 2 21:16:23 CEST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://opencsw.org/mantis/view.php?id=2973 
====================================================================== 
Reported By:                bfr-murphy
Assigned To:                phil
====================================================================== 
Project:                    mutt
Issue ID:                   2973
Category:                   regular use
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             2008-12-17 21:13 CET
Last Modified:              2009-06-02 21:16 CEST
====================================================================== 
Summary:                    mutt compiled with libidn does not work with the
defaul locale
Description: 
When compiled with libidn mutt does not work with the "C" or "POSIX"
locales.  The error 'Bad IDN "{hostname of IMAP server}".' is printed in
the message line at the bottom of the terminal window and no connection is
made to the IMAP server.

This is a problem because the Sun default locale is "C".

Unsetting the mutt variable use_idn or changing the value of the mutt
variables charset, assumed_charset, attach_charset, config_charset, and
send_charset does not fix the problem.

Possible solutions:

1) Do not compile mutt with libidn.

2) Provide a wrapper script that checks the LANG shell environment
variable and changes the LC_ALL shell environment variable to another value
if LANG is "C" or "POSIX".  There would need to be a way for the user to
specify a locale other than "C" or "POSIX" for the wrapper to use.


====================================================================== 

---------------------------------------------------------------------- 
 (0006244) skayser (administrator) - 2009-06-02 17:58
 http://opencsw.org/mantis/view.php?id=2973#c6244 
---------------------------------------------------------------------- 
I have just had the same problem with one of my co-workers, but with a
locale != C/POSIX. Underlying issue was not with mutt, but that he had the
"evil" LD_LIBRARY_PATH set and thus mutt runtime-linked against a non-csw
libiconv.

$ echo $LD_LIBRARY_PATH
/usr/sfw/lib:/opt/sfw/lib:/usr/lib:/usr/openwin/lib:/usr/local/kde/qt/lib:/usr/dt/lib:/usr/local/kde/lib:/usr/local/lib

$ ldd /opt/csw/bin/mutt
...
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2

Getting rid of $LD_LIBRARY_PATH solved the issue. bfr-murphy, if this is
still an issue for you, can you please check whether you have
$LD_LIBRARY_PATH set? Providing the output of "set" and "ldd
/opt/csw/bin/mutt" might also help. 

---------------------------------------------------------------------- 
 (0006245) bfr-murphy (reporter) - 2009-06-02 18:36
 http://opencsw.org/mantis/view.php?id=2973#c6245 
---------------------------------------------------------------------- 
I do not have $LD_LIBRARY_PATH set.

I have uploaded the output of 'ldd /opt/csw/bin/mutt'.  The
/opt/csw/bin/mutt binary is using the copy of libiconv in the /opt/csw/lib
directory.

 

---------------------------------------------------------------------- 
 (0006247) phil (manager) - 2009-06-02 20:22
 http://opencsw.org/mantis/view.php?id=2973#c6247 
---------------------------------------------------------------------- 
Could this actually be considered a bug in our libidn package?


Hmm.. sun has SUNWidn.. but it does not appear to have a libidn.so.
arg.

Still seems like the real issue is that libidn does not degrade
gracefully.
If it cant find whatever magical translation files it needs, methinks it
should default to just returning whatever string it received as-is ? 

---------------------------------------------------------------------- 
 (0006248) skayser (administrator) - 2009-06-02 20:58
 http://opencsw.org/mantis/view.php?id=2973#c6248 
---------------------------------------------------------------------- 
>From looking at the mutt 1.5.19 sources the part where it bails out seems
to be mutt_socket.c:470

~/tmp/mutt-1.5.19$ ack -B2 '"Bad IDN \\".*\.'
mutt_socket.c
468-  if (idna_to_ascii_lz (conn->account.host, &host_idna, 1) !=
IDNA_SUCCESS)
469-  {
470:    mutt_error (_("Bad IDN \"%s\"."), conn->account.host);
...

And using the following snippet i can re-create the problem.

$ cat idna-test.c 
#include <stdio.h>
#include <errno.h>
#include <locale.h>
#include <idna.h>

void main(void)
{
    char *output;
    int rc;

    setlocale(LC_ALL,"");

    rc =  idna_to_ascii_lz("foo", &output, 1);
    if (rc == IDNA_SUCCESS) {
        printf("Converted: %s\n", output);
    } else {
        printf("Conversion failed: %s\n", idna_strerror(rc));
    };
}

$ /opt/studio/SOS11/SUNWspro/bin/cc -o idna-test -I/opt/csw/include 
-L/opt/csw/lib -R /opt/csw/lib idna-test.c -lidn

$ LC_CTYPE=en_US.UTF-8 ./idna-test
Converted: foo
$ LC_CTYPE=C ./idna-test
Conversion failed: System iconv failed

Note the "System iconv failed". I didn't go further yet (nor am i near
understanding the exact libidn workings), but there is a more recent
libiconv version available upstream (1.13 vs. our 1.12). Phil, would you
mind packaging that up for testing purposes? 

---------------------------------------------------------------------- 
 (0006249) phil (manager) - 2009-06-02 21:16
 http://opencsw.org/mantis/view.php?id=2973#c6249 
---------------------------------------------------------------------- 
odd.. i thought someone else had already updated it.
if you'd like to take over iconv please feel free. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-12-17 21:13 bfr-murphy     New Issue                                    
2009-02-27 02:42 philadmin      Status                   new => assigned     
2009-02-27 02:42 philadmin      Assigned To               => phil            
2009-06-02 17:58 skayser        Note Added: 0006244                          
2009-06-02 18:33 bfr-murphy     File Added: mutt-ldd.txt                     
2009-06-02 18:34 bfr-murphy     Note Added: 0006245                          
2009-06-02 18:36 bfr-murphy     Note Edited: 0006245                         
2009-06-02 20:22 phil           Note Added: 0006247                          
2009-06-02 20:58 skayser        Note Added: 0006248                          
2009-06-02 21:16 phil           Note Added: 0006249                          
======================================================================




More information about the bug-notifications mailing list