Bug 969392 - nfsref: Failed to set locale and langinfo
Summary: nfsref: Failed to set locale and langinfo
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: fedfs-utils
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-31 11:02 UTC by Steve Dickson
Modified: 2013-06-29 18:26 UTC (History)
4 users (show)

Fixed In Version: fedfs-utils-0.9.1-1.fc19
Clone Of:
Environment:
Last Closed: 2013-06-29 18:26:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Steve Dickson 2013-05-31 11:02:17 UTC
Description of problem:
The nfsref *always* fails with "Failed to set locale and langinfo"

Version-Release number of selected component (if applicable):
fedfs-utils-server-0.9.0-2.fc19

Steps to Reproduce:
1. type nfsref


Additional info:
The failure is be caused by the following checks:

    /* Ensure UTF-8 strings can be handled transparently */
    if (setlocale(LC_CTYPE, "") == NULL ||
        strcmp(nl_langinfo(CODESET), "UTF-8") != 0) {
        fprintf(stderr, "Failed to set locale and langinfo\n");
        goto out;
    }

In f19 
  setlocale(LC_CTYPE, "") == 'en_US
and 
  nl_langinfo(CODESET) == ISO-8859-1
 
Note, removing those checks does allow the junction to be created.

Comment 1 Chuck Lever 2013-05-31 15:19:48 UTC
(In reply to Steve Dickson from comment #0)
> Description of problem:
> The nfsref *always* fails with "Failed to set locale and langinfo"
> 
> Version-Release number of selected component (if applicable):
> fedfs-utils-server-0.9.0-2.fc19
> 
> Steps to Reproduce:
> 1. type nfsref
> 
> 
> Additional info:
> The failure is be caused by the following checks:
> 
>     /* Ensure UTF-8 strings can be handled transparently */
>     if (setlocale(LC_CTYPE, "") == NULL ||
>         strcmp(nl_langinfo(CODESET), "UTF-8") != 0) {
>         fprintf(stderr, "Failed to set locale and langinfo\n");
>         goto out;
>     }
> 
> In f19 
>   setlocale(LC_CTYPE, "") == 'en_US
> and 
>   nl_langinfo(CODESET) == ISO-8859-1

On my EL6.4 and Fedora 18 systems, `env` tells me "LANG=en_US.UTF-8".  Changing that setting in your shell will probably also make nfsref work.

I think we want to replace the failing logic with just this:

  setlocale(LC_ALL, "");

and we'll have to hit pretty much all of the command line tools in fedfs-utils.

Can you identify an i18n expert at RH who can help us determine what is the correct method for ensuring UTF-8 string processing will work independent of locale setting?

Comment 2 Chuck Lever 2013-05-31 17:00:32 UTC
Definitely broken, I'm doing some research for a long-term fix.  Possible workaround is setting your LANG variable, as above.  Look for fedfs-utils-0.9.1 in the next few days.

Comment 3 Chuck Lever 2013-06-12 00:55:00 UTC
fedfs-utils 0.9.1 was published today, which should address this issue.

Comment 4 Fedora Update System 2013-06-21 15:46:21 UTC
fedfs-utils-0.9.1-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/fedfs-utils-0.9.1-1.fc19

Comment 5 Fedora Update System 2013-06-21 19:17:35 UTC
Package fedfs-utils-0.9.1-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing fedfs-utils-0.9.1-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11459/fedfs-utils-0.9.1-1.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-06-29 18:26:45 UTC
fedfs-utils-0.9.1-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.