[libvirt] [PATCH] LXC: Fix virLXCControllerSetupDevPTS() wrt user namespaces

Ján Tomko jtomko at redhat.com
Thu Aug 14 12:55:20 UTC 2014


On 08/14/2014 02:45 PM, Richard Weinberger wrote:
> Am 14.08.2014 14:35, schrieb Ján Tomko:
>> On 07/28/2014 10:59 PM, Richard Weinberger wrote:
>>> The gid value passed to devpts has to be translated by hand as
>>> virLXCControllerSetupDevPTS() is called before setting up the user
>>> and group mappings.
>>> Otherwise devpts will use an unmapped gid and openpty()
>>> will fail within containers.
>>> Linux commit commit 23adbe12
>>
>> s/commit commit/kernel commit/
>>
>>> ("fs,userns: Change inode_capable to capable_wrt_inode_uidgid")
>>> uncovered that issue.
>>>
>>> Signed-off-by: Richard Weinberger <richard at nod.at>
>>> ---
>>>  src/lxc/lxc_controller.c | 25 +++++++++++++++++++++++--
>>>  1 file changed, 23 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
>>> index 2d220eb..82ecf12 100644
>>> --- a/src/lxc/lxc_controller.c
>>> +++ b/src/lxc/lxc_controller.c
>>> @@ -1164,6 +1164,19 @@ static int virLXCControllerMain(virLXCControllerPtr ctrl)
>>>      return rc;
>>>  }
>>>  
>>> +static uint32_t
>>
>> I've changed this to 'unsigned int' to match the type used by virDomainIdMapEntry.
> 
> Why is uint32_t wrong? :)
> 

Not really wrong, uint32_t should have the same range as unsigned int on
Linux. I just wanted them to be consistent.

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140814/12a7881d/attachment-0001.sig>


More information about the libvir-list mailing list