Skip to content

R CMD build wiped my computer (from R-help)

1 message · Peter Dalgaard

#
Duncan Murdoch wrote:
I have been following this from the sideline, because I suck really bad
when it comes to Perl programming. However....

I'm seeing this stuff in the build script:

    ## Remove exclude files.
    open(EXCLUDE, "< $exclude");
    while(<EXCLUDE>) {
        rmtree(glob($_));
    }
    close(EXCLUDE);

Now this comes after

    find(\&find_exclude_files, "$pkgname");

which AFAICT prints a number of file names into EXCLUDE. Now if one of
those file names contain a wildcard, I conjecture that the glob() can
make weird things happen. I don't think we want to glob there, do we?

Another issue is that EXCLUDE seems unprotected against file names with
embedded newlines. Something like find's -print0 would be handy...