Bug 1543021 - libidn2: Guidance needed for avoiding STD3 rules
Summary: libidn2: Guidance needed for avoiding STD3 rules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libidn2
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-07 15:11 UTC by Florian Weimer
Modified: 2018-03-06 17:32 UTC (History)
2 users (show)

Fixed In Version: libidn2-2.0.4-3.fc27 libidn2-2.0.4-3.fc26 libidn2-2.0.4-3.el7 libidn2-2.0.4-3.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-27 17:20:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1452750 0 unspecified CLOSED glibc: switch to libidn2 2021-02-22 00:41:40 UTC

Internal Links: 1452750

Description Florian Weimer 2018-02-07 15:11:20 UTC
For glibc, I want to permit _ in names, but I would like to use the default flags otherwise.  I assumed that with libidn2 2.0.4, STD3 rules were disabled with flags 0, but this does not seem to be the case.

I run this program in a UTF-8 locale:

#include <err.h>
#include <idn2.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>

void
print_1 (const char *name, const char *label, int flags)
{
  char *result;
  int ret = idn2_lookup_ul (name, &result, flags);
  if (ret == IDN2_OK)
    {
      printf("  %s: [[%s]]\n", label, result);
      free (result);
    }
  else
    printf ("  %s: %s\n", label, idn2_strerror_name (ret));
}

void
process (const char *name)
{
  printf ("[[%s]]:\n", name);
  print_1 (name, "default", 0);
  print_1 (name, "USE_STD3_ASCII_RULES", IDN2_USE_STD3_ASCII_RULES);
  print_1 (name, "TRANSITIONAL", IDN2_TRANSITIONAL);
  print_1 (name, "NONTRANSITIONAL", IDN2_NONTRANSITIONAL);
}

int
main (void)
{
  if (setlocale (LC_ALL, "") == NULL)
    err (1, "setlocale");
  process ("nämchen.example");
  process ("nämchen_foo.example");
  process ("nämchen$foo.example");
  process ("nämchen`foo.example");
  process ("nämchen;foo.example");
  process ("buße.example");
  return 0;
}

And I get (with libidn2-2.0.4-1.fc27.x86_64):

[[nämchen.example]]:
  default: [[xn--nmchen-bua.example]]
  USE_STD3_ASCII_RULES: [[xn--nmchen-bua.example]]
  TRANSITIONAL: [[xn--nmchen-bua.example]]
  NONTRANSITIONAL: [[xn--nmchen-bua.example]]
[[nämchen_foo.example]]:
  default: IDN2_DISALLOWED
  USE_STD3_ASCII_RULES: IDN2_DISALLOWED
  TRANSITIONAL: [[xn--nmchen_foo-q5a.example]]
  NONTRANSITIONAL: IDN2_DISALLOWED
[[nämchen$foo.example]]:
  default: IDN2_DISALLOWED
  USE_STD3_ASCII_RULES: IDN2_DISALLOWED
  TRANSITIONAL: [[xn--nmchen$foo-q5a.example]]
  NONTRANSITIONAL: IDN2_DISALLOWED
[[nämchen`foo.example]]:
  default: IDN2_DISALLOWED
  USE_STD3_ASCII_RULES: IDN2_DISALLOWED
  TRANSITIONAL: [[xn--nmchen`foo-q5a.example]]
  NONTRANSITIONAL: IDN2_DISALLOWED
[[nämchen;foo.example]]:
  default: IDN2_DISALLOWED
  USE_STD3_ASCII_RULES: IDN2_DISALLOWED
  TRANSITIONAL: [[xn--nmchen;foo-q5a.example]]
  NONTRANSITIONAL: IDN2_DISALLOWED
[[buße.example]]:
  default: [[xn--bue-6ka.example]]
  USE_STD3_ASCII_RULES: [[xn--bue-6ka.example]]
  TRANSITIONAL: [[busse.example]]
  NONTRANSITIONAL: [[xn--bue-6ka.example]]

I don't want to use IDN2_TRANSITIONAL because it gives the wrong IDNA name for buße.example, so it seems to me that there aren't any good options at present.

Comment 1 Nikos Mavrogiannopoulos 2018-02-08 08:01:31 UTC
Moved to upstream:
https://gitlab.com/libidn/libidn2/issues/43

Comment 3 Fedora Update System 2018-02-18 14:52:45 UTC
libidn2-2.0.4-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-22e691f5d2

Comment 4 Fedora Update System 2018-02-18 14:53:14 UTC
libidn2-2.0.4-3.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-be760d6d28

Comment 5 Fedora Update System 2018-02-18 14:53:44 UTC
libidn2-2.0.4-3.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-823d88dfeb

Comment 6 Fedora Update System 2018-02-18 14:54:22 UTC
libidn2-2.0.4-3.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-8651f03a5a

Comment 7 Robert Scheck 2018-02-18 14:56:23 UTC
libidn2-2.0.4-2.fc28:

$ idn2 -N _x.com
_x.com
$ idn2 -N _ü.com
idn2: toAscii: string contains a disallowed character
$ idn2 -N ü.com
xn--tda.com
$


libidn2-2.0.4-3.fc28: 

$ idn2 -N _x.com
_x.com
$ idn2 -N _ü.com
xn--_-eha.com
$ idn2 -N ü.com
xn--tda.com
$

Comment 8 Fedora Update System 2018-02-18 17:57:03 UTC
libidn2-2.0.4-3.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-823d88dfeb

Comment 9 Fedora Update System 2018-02-18 18:14:05 UTC
libidn2-2.0.4-3.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-be760d6d28

Comment 10 Fedora Update System 2018-02-18 18:38:03 UTC
libidn2-2.0.4-3.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-22e691f5d2

Comment 11 Fedora Update System 2018-02-18 23:25:39 UTC
libidn2-2.0.4-3.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-8651f03a5a

Comment 12 Fedora Update System 2018-02-27 17:20:28 UTC
libidn2-2.0.4-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2018-03-06 17:27:35 UTC
libidn2-2.0.4-3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-03-06 17:31:11 UTC
libidn2-2.0.4-3.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2018-03-06 17:32:22 UTC
libidn2-2.0.4-3.el6 has been pushed to the Fedora EPEL 6 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.