[R-SIG-Mac] New message from OS (Mountain Lion) with system command
Simon Urbanek
simon.urbanek at r-project.org
Sun Sep 2 15:39:07 CEST 2012
On Sep 2, 2012, at 4:32 AM, peter dalgaard wrote:
>
> On Sep 1, 2012, at 19:30 , Dennis Fisher wrote:
>
>> Colleagues,
>>
>> I recently upgraded my OS to Mountain Lion. Previously, when ran R from a terminal and I issued the command:
>> PSOUTPUT <- system("ps", intern=TRUE)
>> the output returned without a problem.
>>
>> Since upgrading to Mountain Lion (R 2.15.1), the same command returns the message:
>> dyld: DYLD_ environment variables being ignored because main executable (/bin/ps) is setuid or setgid
>> Issuing the "ps" command directly from the terminal or from Rgui does not create the same behavior.
>>
>> I tracked the problem down to the following. Running R in a terminal:
>> > grep("DYLD", system("set", intern=T), value=T)
>> [1] "DYLD_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib/x86_64"
>> Executing the same command from Rgui:
>> > grep("DYLD", system("set", intern=T), value=T)
>> character(0)
>> And, in a terminal:
>> set | grep DYLD
>> returns nothing.
>>
>> It appears that R64, but not Rgui, sets DYLD_LIBRARY_PATH. Can anyone offer an explanation? I discovered that:
>> Sys.unsetenv("DYLD_LIBRARY_PATH")
>> prevents the problem. Do I incur any hidden risks by executing that command?
>>
>
> Well, something could be using the path.... If it's not there in R.app, I have a hunch that nothing actually _is_ using it, but you need a better expert than me to be sure (Simon?).
>
DYLD_LIBRARY_PATH is only set in the R startup script to make R relocatable - i.e. when you don't use the framework it is set so R can find libR etc. The GUI doesn't need it because it is using the framework. Framework installations (like the CRAN binary) don't need it, either, but we're not stripping it from the R script as to not mess with it unnecessarily (we could, though, but it would change the behavior slightly - not for "normal" R use, but as it is you can put extra libraries that you want only R to use in $R_HOME/lib and they will be preferred to system ones).
> Anyways, a bit of Googling indicates that this has been an annoyance for others as well (e.g., affecting sudo for MySQL users), and that it is fixed in the 10.8.1 upgrade of Mountain Lion, so perhaps just wait it out?
>
> (I sincerely hope that only the warning is new and that setuid programs always have ignored the dynamic library path. Otherwise it would be a security hole the size of a truck...)
>
Yes, in fact setuid binaries have even more safeguards:
$ DYLD_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib ./lr
dyld: Library not loaded: libR.dylib
Referenced from: /Users/urbanek/./lr
Reason: unsafe use of relative rpath libR.dylib in /Users/urbanek/./lr with restricted binary
so I guess Apple was just trying to make it more explicit.
Cheers,
Simon
> -pd
>
>> Dennis
>>
>> Dennis Fisher MD
>> P < (The "P Less Than" Company)
>> Phone: 1-866-PLessThan (1-866-753-7784)
>> Fax: 1-866-PLessThan (1-866-753-7784)
>> www.PLessThan.com
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
More information about the R-SIG-Mac
mailing list