MantisBT - CMake
View Issue Details
0003602CMakeCMakepublic2006-08-11 09:542016-06-10 14:30
Montel Laurent 
Brad King 
normalfeaturealways
closedmoved 
 
 
0003602: Add possibility to change file owner into install macro
Hi,
It's possible with install macro to change attribute of files, but it's not possible to change owner/group of file.
For example I want to install a binary which is owned into sound group.
It's not possible for the moment.
Could you add this feature please ?
Thanks
Regards.
No tags attached.
related to 0002691closed Brad King New install specification framework or command 
related to 0014714closed Domen Vrankar CPack doesn't allow to create RPM with other user/group than root/root 
Issue History
2007-10-26 13:37Oswald BuddenhagenNote Added: 0009574
2007-10-29 09:30Brad KingNote Added: 0009589
2012-08-13 10:36Brad KingStatusassigned => backlog
2012-08-13 10:36Brad KingNote Added: 0030500
2015-01-15 14:51Brad KingRelationship addedrelated to 0002691
2015-01-15 14:56Brad KingRelationship addedrelated to 0014714
2015-01-15 15:03Brad KingNote Added: 0037705
2016-06-10 14:27Kitware RobotNote Added: 0041316
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0004749)
Brad King   
2006-08-25 10:06   
I've added a reference to this bug from bug#2691 which is a central bug to collect progress on install features.
(0004750)
Brad King   
2006-08-25 10:09   
I agree this feature needs to be addressed, but it may not be straightforward.

Setting permission bits during installation is easy because it always works. Changing the owner and group is not so easy because:

1.) What if the owner or group specified does not exist on the system.
2.) What if setting owner/group is not allowed because the install directory is in a user home directory and the user is not root?

Currently it is possible to do this using the INSTALL(SCRIPT) or INSTALL(CODE) commands. You can add your own call to EXECUTE_PROCESS at install time to run chown and chgrp.
(0009574)
Oswald Buddenhagen   
2007-10-26 13:37   
the conditions in your case 2) are bogus, at least on any modern unix system. anyway ...

in case of failure one would simply error out like when the file cannot be installed in the first place.

as an additional option, one could add "soft fail", i.e. continue
despite failure. however, in this case the chown must be attempted first and any requested setuid/setgid be only chmoded when the chown succeeds.

dealing with case 1) by auto-creating users/groups is a perfect way to get into distribution compatibility hell. :)
but done right, it might be an actual selling point.
(0009589)
Brad King   
2007-10-29 09:30   
Case 2 is as follows:

~/ $ touch foo.txt
~/ $ chown other foo.txt
chown: changing ownership of `foo.txt': Operation not permitted

Now that I'm thinking about this again I'll add case 3:

3.) What if installing into a DESTDIR that exists on a mount point and the user names should be translated to uids with $(DESTDIR)/etc/passwd instead of /etc/passwd? How should this be specified?

Still, a solution to this problem would be useful.
(0030500)
Brad King   
2012-08-13 10:36   
Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0037705)
Brad King   
2015-01-15 15:03   
Relevant mailing list thread:

 Specifying a file owner
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/51354 [^]
(0041316)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.