[Devel] [PATCH 3/6] run modified tar if upstream

Glauber Costa glommer at parallels.com
Mon Mar 11 12:40:24 PDT 2013


On 03/11/2013 10:57 PM, Kir Kolyshkin wrote:
> On 03/11/2013 04:01 AM, Glauber Costa wrote:
>> If we are running upstream with user namespaces, we need to run a
>> modified
>> version of tar to extract the files. To avoid compatibility problems,
>> we will
>> resort to LD_PRELOAD if a recent tar is not available (if ever).
> 
> This description is a bit misleading. After reading it I expected
> modified tar to be called.
> 
> I guess it's better to explain the chmod hack here instead, and make a
> note that
> if/when tar will support the required functionality we will switch to
> using it.
> 
> As a side note, can you point me to the relevant tar change? I glanced
> through
> tar git and was not able to find it.

As I said in the changelog: (if ever). I am still working to merge it
there and should send the code to them tomorrow. What is going to happen
then, is a mistery.

> 
>>
>> Signed-off-by: Glauber Costa <glommer at parallels.com>
>> ---
>>   scripts/vps-create.in   | 18 ++++++++++++
>>   src/lib/Makefile.am     |  3 ++
>>   src/lib/chown_preload.c | 73
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>   src/lib/create.c        | 17 ++++++++----
> 
> You also need to modify vzctl.spec to add libvzchown.so (next to
> libvzctl.so)
>
ok.


>> +{
>> +    if [ "xUID_OFFSET" == "x" ]; then return; fi
>> +    if [ "xGID_OFFSET" == "x" ]; then return; fi
> 
> I'd write
>
All right.


> [ -z "$UID_OFFSET" -o -z "$GID_OFFSET" ] && return
> 
>> +
>> +    # The goal is to get this merged into tar so we no longer
>> +    # need to do this preload. Whenever it happens, we will include
>> +    # a version check here as well
> 
> I'd say
> 
> # TODO use tar with appropriate option when it becomes available
>

I can do that, but we'll have to support this for quite a while until
that becomes ubiquitous...

>>   endif
>>     if HAVE_VZ_KERNEL
>> diff --git a/src/lib/chown_preload.c b/src/lib/chown_preload.c
>> new file mode 100644
>> index 0000000..0bc5d0d
>> --- /dev/null
>> +++ b/src/lib/chown_preload.c
> 
> Please add the usual copyright/gpl header.
> 
ok.





More information about the Devel mailing list