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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
> ---
>  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.

> +virLXCControllerLookupUsernsMap(virDomainIdMapEntryPtr map, int num,
> +                                uint32_t src)
> +{
> +    int i;

This should be size_t to pass 'make syntax-check'.

> +
> +    for (i = 0; i < num; i++) {
> +        if (src > map[i].start && src < map[i].start + map[i].count)
> +            return map[i].target + (src - map[i].start);
> +    }
> +
> +    return src;
> +}
>  
>  static int
>  virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,

ACK; pushed now.

Jan


Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]