Bug 360734

Summary: creation of a bogus share directory with root ownership in the source location
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Maurizio Paolini <maurizio.paolini>
Component: generalAssignee: Alex Merry <alex.merry>
Status: RESOLVED WORKSFORME    
Severity: normal CC: ecm-bugs-null
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Maurizio Paolini 2016-03-19 14:06:22 UTC
At the "make install" stage of (e.g.) kig package a small directory structure starting with
"share" is created in the sources root.  This has the ownership of the issuer of "make install"
(typically "root") inside a directory structure that typically is owned by a normal user.

Reproducible: Always

Steps to Reproduce:
1. git clone git@git.kde.org:kig
2. cd kig
3. cmake . [options]
4. make
5. make install

Actual Results:  
$ pwd
/home/matem/paolini/Git/kdeedu/kig
$ ls -ld .
drwxr-xr-x 21 paolini matem 4096 19 mar 14.25 .
$ ls -ld share                   # this directory shouldn't even be there!
drwxr-xr-x 4 root root 4096 19 mar 15.00 share



Expected Results:  
There should be anything owned by root in the users home directory!

in
function(_ecm_update_iconcache installdir theme)
I find these two commands:

        file(WRITE \"${installdir}/${theme}/temp.txt\" \"update\")
        file(REMOVE \"${installdir}/${theme}/temp.txt\")

They are apparently missing a ${CMAKE_INSTALL_PREFIX}/ prefix... I am not sure what is the purpose of temp.txt, perhaps it is some kind of lock file... however it shouldn't use the source tree.  It might even be impossible for "root" to write here, e.g. in case of an NFS-mounted home, where "root" is typically mapped into the "nfsnobody" user on the NFS server.

The bug report https://bugs.kde.org/show_bug.cgi?id=360614 is where the problem was first spotted.
Comment 1 Maurizio Paolini 2016-03-19 14:07:58 UTC
*** Bug 360614 has been marked as a duplicate of this bug. ***
Comment 2 Maurizio Paolini 2016-03-21 22:02:54 UTC
Stephen Kelly patched modules/ECMInstallIcons.cmake in extra-cmake-modules to solve the problem, see https://git.reviewboard.kde.org/r/127445/
Comment 3 Christophe Marin 2017-11-05 17:19:21 UTC
Should be fine now.
Comment 4 Maurizio Paolini 2017-11-05 20:44:01 UTC
Thank you, that was an annoying issue for me...
Comment 5 Christophe Marin 2017-11-05 20:51:27 UTC
well, "now" = 2016/03 :)

It's just that the bug report was never closed.