tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

/proc/curproc/exe and Perl's $^X variable



It turns out that perl readlink(2)s /proc/curproc/exe.
Both /usr/pkg/bin/perl and /usr/pkg/bin/perl5.18.2 are links to the same 
inode, so it's probably random which one will turn up in /proc/curproc/exe.

If I ln /usr/pkg/bin/perl /usr/pkg/libexec/perl, running
        /usr/pkg/bin/perl -e 'print "$^X\n";'
will output
        usr/pkg/libexec/perl
as will both
        /usr/pkg/bin/perl5.18.2 -e 'print "$^X\n";'
and
        /usr/pkg/libexec/perl -e 'print "$^X\n";'
.

So in order for the bug to happen, you need
1. A perl package using Module::Build
2. A "binary" in the package
3. A certain drectory order (or other random input)


Home | Main Index | Thread Index | Old Index