[ESS-bugs] Permission denied bug in 13.09

Rodney Sparapani rsparapa at mcw.edu
Thu Oct 24 00:12:22 CEST 2013


This is a weird one.  I was testing a program called
/tools/tests/runf1d.R which contains:
require(inline)
require(RcppEigen)

runif1d <- cxxfunction(signature(arg1="numeric",
                                     arg2="numeric"),
                           includes='
#include "/bnp/tools/RcppDPM/src/rcppdpm.cpp"',
                           body='
return wrap(runif1d(as<double>(arg1), as<double>(arg2)));',
                           plugin="RcppEigen")

set.seed(44)

runif(1, -1, 1)

set.seed(44)

runif1d(-1, 1)

And I accidentally ran it as root.  When I realized my mistake,
I changed the file permissions to myself and attempted to run
it again as myself.  And I get an error about a different file...

+ . + Error in file(file, ifelse(append, "a", "w")) (from #91) :
   cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
   cannot open file '/tmp/runif1d.R at 1': Permission denied

And sure enough, root owns that file...
# l /tmp/runif1d.R at 1
-rw-r--r-- 1 root root 422 Oct 23 16:56 /tmp/runif1d.R at 1

IMHO this is a bug, but we should be able to work around this.
For example, could we use R's tempdir() rather than the
hard coded /tmp?  I don't have more time to investigate now.
But hopefully this is enough for someone to get going.

-- 
Rodney Sparapani, PhD
Manager of Statistical & Computational Operations
Center for Patient Care and Outcomes Research (PCOR)
Medical College of Wisconsin (MCW), Milwaukee, USA
http://www.linkedin.com/in/rodneysparapani



More information about the ESS-bugs mailing list