Bug 969392 - nfsref: Failed to set locale and langinfo
nfsref: Failed to set locale and langinfo
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: fedfs-utils (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Steve Dickson
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-31 07:02 EDT by Steve Dickson
Modified: 2013-06-29 14:26 EDT (History)
4 users (show)

See Also:
Fixed In Version: fedfs-utils-0.9.1-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-29 14:26:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve Dickson 2013-05-31 07:02:17 EDT
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 11:19:48 EDT
(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 13:00:32 EDT
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-11 20:55:00 EDT
fedfs-utils 0.9.1 was published today, which should address this issue.
Comment 4 Fedora Update System 2013-06-21 11:46:21 EDT
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 15:17:35 EDT
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 14:26:45 EDT
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.