Estimated hours taken: 0.5
Fix a security problem with the use of `chmod +w'.
{scripts,runtime}/Mmake:
Use `chmod u+w' rather than `chmod +w' on the installed files,
since `chmod +w' has the wrong effect with some versions of chmod.
When configure creates automatically-generated files, we do a
`chmod -w' on them to make sure that you don't accidentally edit
the automatically-generated file rather than the source `.in' file.
However, if the installed copies are write-only, then it causes
problems when installing a new copy on top of an old one.
Hence we turn write permission back on again on the installed copies.
The `chmod +w' command has the right effect on Solaris, OSF/1, and
SunOS, where it takes into account the umask. However, on IRIX and
ULTRIX, `chmod +w' does not take the umask into account, and so
makes the files world-writable, which is a security problem.
Hence, we now use `chmod u+w' instead.
Estimated hours taken: 0.1
scripts/Mmake:
In the rule for `mmake install', make sure we remove the installed
copy of `Mmake.vars' before copying over the new one, since it is
create without write permissions.
Mmake:
Change the `uninstall' rule so that rather than using `rm -f',
it uses plain `rm' but then ignores the exit status. If we
encounter permission errors when doing a `mmake uninstall', the
user should know about them.
if configure can't find `mkfifo', configure will look for `mknod',
and set MKFIFO to `mkfifo_using_mknod', which is a new script
that basically just invokes `mknod $1 p'. Also, add a new
option --no-demangle; if this option is used, or if the system doesn't
have either `mknod' or `mkfifo', then demangling is disabled.
These changes are all because some systems (e.g. SunOS 4.1.3)
don't have `mkfifo'.
scripts/Mmake:
Split up the rule for installing the scripts so that
the NU-Prolog and SICStus Prolog related scripts are
only installed if configure detected NU-Prolog or
SICStus Prolog respectively.
mercury/scripts/Mmake:
`mkdir -p' doesn't work on munta if the directory already exists.
(Need to make the same change in all the other Mmake files too.)