forwarded 625713 
http://ikiwiki.info/bugs/yaml_setup_file_does_not_support_UTF-8_if_XS_is_installed/
thanks

Hi,

Jonas Smedegaard wrote (05 May 2011 17:19:57 GMT) :
> Yes. But if - for whatever reason - libyaml-libyaml-perl is
> installed as well, Ikiwiki stops working.

Confirmed. I reported this on
http://ikiwiki.info/bugs/yaml_setup_file_does_not_support_UTF-8_if_XS_is_installed/
two weeks ago.

> If this is a bug in YAML::XS rather than Ikiwiki, then perhaps the
> appropriate approach is to reassign and raise severity, as it then
> is breaking unrelated packages?

This might be https://rt.cpan.org/Public/Bug/Display.html?id=54683.

This bug probably should be reported against libyaml-libyaml-perl with
higher severity, but reassigning would mean there is no way to
workaround this bug from ikiwiki POV, which sounds wrong.


By the way, I've tracked down the bug a bit deeper.

1. If the content of the setup file is slurped using
   Path::Class::File's slurp method, YAML::XS does not feel bad and
   the configuration is properly loaded -> see attached test-works.pl.

2. If the content of the setup file is slurped and untainted the same
   way IkiWiki::Setup::load does, YAML::XS pretends to be passed
   invalid UTF-8 data as reported -> see attached test-buggy.pl.

Both tests were run on the minimal attached ikiwiki.setup.

Bye,
--
  intrigeri <[email protected]>
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc
  | So what?

#!/usr/bin/perl

use warnings;
use strict;
use 5.10.0;

use open qw{:utf8 :std};

use Path::Class qw{file};
use YAML::Any;

my $file = file($ENV{HOME}, 'tmp', 'ikiwiki', 'vs_yaml', 'ikiwiki.setup');
my $content = $file->slurp;
my $conf = Load("$content");
say $conf->{po_slave_languages}->[3];
#!/usr/bin/perl

use warnings;
use strict;
use 5.10.0;

use open qw{:utf8 :std};

use Path::Class qw{file};
use YAML::Any;

my $file = file($ENV{HOME}, 'tmp', 'ikiwiki', 'vs_yaml', 'ikiwiki.setup');
my $content;

open (IN, "$file") || die("cannot read");
{
    local $/=undef;
    $content=<IN> || die("bla: $!");
}
close IN;

my ($untainted)=$content=~/(.*)/s;
my $conf = Load("$untainted");

say $conf->{po_slave_languages}->[3];
# -*- mode: yaml; -*-
# po plugin
# master language (non-PO files)
po_master_language: en|English
# slave languages (translated via PO files) format: ll|Langname
po_slave_languages:
  - ca|Catalan
  - de|Deutsch
  - es|Español
  - fr|Français

Reply via email to