Bug#550462: libautodie-perl: does not die on errors from chmod()

Jonathan Yu jonathan.i.yu at gmail.com
Sat Oct 10 15:23:11 UTC 2009


On Sat, Oct 10, 2009 at 5:01 AM, Damyan Ivanov <dmn at debian.org> wrote:
> Package: libautodie-perl
> Version: 2.06.01-2
> Severity: important
>
> Try this:
>
> $ cat <<EOF > test.pl
> #!/usr/bin/perl
> use autodie qw(:all);
>
> chmod 0755, "/non-existent/file" or warn $!;
>
> print "I'm alive!\n";
> EOF
>
> $ perl test.pl
> No such file or directory at test.pl line 4.
> I'm alive
>
> Expected result: script should die.
I suspect this isn't really a bug, but is by design. What happens if
you do the chmod without checking the return value?

The point of autodie is to make checking/warning as you do
unnecessary; if you do check it yourself, the calling context is
different (scalar context vs void context), which can make all the
difference.

What happens if you do the same thing, but drop the "or warn $!" part?
Does it die then? If not, then we should forward the bug upstream.
>
> Thanks,
>    dam
>
> -- System Information:
> Debian Release: squeeze/sid
>  APT prefers unstable
>  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
> Architecture: i386 (i686)
>
> Kernel: Linux 2.6.30-2-686 (SMP w/1 CPU core)
> Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages libautodie-perl depends on:
> ii  libsub-identify-perl          0.04-1     Retrieve names of code references
> ii  perl                          5.10.1-5   Larry Wall's Practical Extraction
>
> Versions of packages libautodie-perl recommends:
> ii  libipc-system-simple-perl     1.18-1     Perl module to run commands simply
>
> libautodie-perl suggests no packages.
>
> -- no debconf information
>
>
>
> _______________________________________________
> pkg-perl-maintainers mailing list
> pkg-perl-maintainers at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-perl-maintainers
>





More information about the pkg-perl-maintainers mailing list