Bug 969392

Summary: nfsref: Failed to set locale and langinfo
Product: [Fedora] Fedora Reporter: Steve Dickson <steved>
Component: fedfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: chuck.lever, ikent, jlayton, steved
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 18:26:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.