[cmake-developers] [CPack] CPackDeb and fakeroot

Eric Noulard eric.noulard at gmail.com
Tue Aug 25 19:07:36 EDT 2015


2015-08-26 0:56 GMT+02:00 Raffi Enficiaud <raffi.enficiaud at mines-paris.org>:

[...]
>
>
>>     I see several workarounds/hacks:
>>     - executing with fakeroot in cpack first and in case of failure
>>     falling back to run tar without fakeroot
>>     - detect if the current user is root already
>>
>>
>> Detecting if user is already root doesn't seems to be such a big hack
>> it should even be robust as well and should be a 2 line modfication
>> in CPackDeb.cmake protecting it even detecting FAKEROOT alltogether.
>>
>>
> Right, but I am more concerned about the proper way of doing it and not
> the difficulty. From all this discussion, using fakeroot directly does not
> look to me as the right solution for having "root" in the tar, in the first
> place. So if we are also able to get rid of the fakeroot machinery in
> cpack, maybe it would be a better solution.


I agree, then the question is should every deb package built by CPack being
owned by root?

Currently people making deb with CPack without having fakeroot installed
get their
package with current user owning. i.e. fakeroot is not ALWAYS used.

Now if you find a way to set root ownership in archive created by CPackDeb
then every deb package
will have those right.

My opinion (from the various bug report related to deb ownership) is that
is OK since creating a deb including
whatever non-root user in it is a mistake.

So the "proper" way to go may  be to use libarchive directly in CPackDeb to
create tar in order to better control ownership of the created bits.

This is definitely more work, but this looks the proper way to me.

-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150826/7d818780/attachment.html>


More information about the cmake-developers mailing list