Bug 360734 - creation of a bogus share directory with root ownership in the source location
Summary: creation of a bogus share directory with root ownership in the source location
Status: RESOLVED WORKSFORME
Alias: None
Product: extra-cmake-modules
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
: 360614 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-19 14:06 UTC by Maurizio Paolini
Modified: 2017-11-05 20:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.