From Kurt.Hornik at wu-wien.ac.at  Wed Jul 14 21:29:32 2004
From: Kurt.Hornik at wu-wien.ac.at (Kurt Hornik)
Date: Thu Jul 15 10:07:36 2004
Subject: [Rd] umask problem (PR#7086)
In-Reply-To: <20040714061914.7B116108B9@slim.kubism.ku.dk>
References: <20040714061914.7B116108B9@slim.kubism.ku.dk>
Message-ID: <16629.35228.827261.216203@mithrandir.hornik.net>

>>>>> 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@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@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


[Rd] umask problem (PR#7086)
Kurt Hornik