Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005219OCamlOCaml generalpublic2011-02-04 06:162013-10-08 15:23
Reporterselinger 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version3.12.0 
Target Version4.01.1+devFixed in Version 
Summary0005219: use $(INSTALL) instead of 'cp' in Makefiles
DescriptionThe "make install" target does not set proper file permissions on the installed files. Moreover, there is no easy way to fix the permissions once they are messed up.

Details:

Suppose some user uses umask 0007, and root uses umask 0022. It is normal to compile the program as an ordinary user, and to install it later as root. Therefore, during compilation, files are generated with umask 0007. Since "make install" uses a simple "cp" to copy most files, this umask 0007 is preserved during installation, and root's umask 0022 is not used. The installed files (owned by root) are therefore not readable by non-root users.

Moreover, once installed, an attempt to correct this problem by re-compiling with a different umask will fail. Suppose the user changes her umask to 0022, and re-compiles from a fresh copy of the sources. Now "make install", run as root, will still use "cp", and since the target file already exists, the permissions of the target file, and not the source file, will be used!! Therefore the files will still not be readable.

Moreover, since there is no "make uninstall" target, there is no simple way to find all the installed files and correct their permissions manually.

Solution: the make system should use $(INSTALL) instead of 'cp', 'cp -f', etc.
By default this should be set to INSTALL=install, which will set permissions correctly. It could also be set to a shell script, or to 'cp -f', if an 'install' program is not available at the target system.

Patch attached.
Tagspatch
Attached Filespatch file icon ocaml-3.12.0-install.patch [^] (26,397 bytes) 2011-02-04 06:16 [Show Content]

- Relationships
related to 0001919acknowledged 2 installation issues: permissions and emacs files 

-  Notes
(0005901)
doligez (administrator)
2011-05-17 16:37

Will also need to update configure to autodetect a compatible version of install...
(0006053)
gerd (reporter)
2011-07-21 23:44

Note that there are several versions of install (still). Because of this one should at least have the option to set the path of the install binary in the configure script.

In GODI we added a godi_install program to handle this issue, which always provides a BSD-compatible install. Maybe this is also a way to get here around this difficulty, just add a comparable program to the ocaml distribution.

- Issue History
Date Modified Username Field Change
2011-02-04 06:16 selinger New Issue
2011-02-04 06:16 selinger File Added: ocaml-3.12.0-install.patch
2011-05-17 16:37 doligez Note Added: 0005901
2011-05-17 16:37 doligez Status new => acknowledged
2011-07-21 23:44 gerd Note Added: 0006053
2012-01-27 15:54 doligez Relationship added related to 0001919
2012-07-10 17:04 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-19 15:01 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-08-12 16:20 doligez Target Version 4.01.0+dev => 4.02.0+dev
2013-08-12 16:26 doligez Target Version 4.02.0+dev => 4.01.1+dev
2013-10-08 15:23 doligez Tag Attached: patch


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker