[Rd] umask problem (PR#7086)

Kurt Hornik Kurt.Hornik at wu-wien.ac.at
Wed Jul 14 21:29:32 CEST 2004


>>>>> clock  writes:

> Hello
> R-1.9.0
> when the user that compiles R has umask 027 and root has umask 022, then
> R is installed incorrectly:
> clock at beton:~$ R
> /usr/bin/R: line 156: /usr/lib/R/bin/R.bin: Permission denied
> /usr/bin/R: line 156: exec: /usr/lib/R/bin/R.bin: cannot execute: Success
> clock at beton:~$ ls -la /usr/lib/R/bin/R.bin
> -rwxr-x---    1 root     root      2032542 Jul 13 20:04 /usr/lib/R/bin/R.bin
>        ^^^

Thanks.

This is due to using copy-if-change to avoid unnecessary copying for (at
least) the main executable and the shared libraries under Unix.

Now, copy-if-change of course uses "cp" for doing its work, whereas in
the GNU build environment we would typically use $INSTALL and its
variants for doing so (and the latter would always set the mode to 755
or 644 [for data]).

The simplest fix to me seems to enhance copy-if-change to

* Take an argument, say '-m', for specifying the mode, with 755 as the
  default;

* Chmod $mode after the cp.

I guess there is a similar issue with things "installed" by
move-if-change.

-k



More information about the R-devel mailing list