Re: [PATCH v3 11/12] LXC: controller: change the owner of /dev/pts and ptmx to the root of container

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

 



Hi!

----- Ursprüngliche Mail -----
> This two files are created for container,
> the owner should be the root user of container.
> 
> Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
> ---
>  src/lxc/lxc_controller.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
> index b2ace20..7d27135 100644
> --- a/src/lxc/lxc_controller.c
> +++ b/src/lxc/lxc_controller.c
> @@ -1506,8 +1506,15 @@
> virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
>      char *opts = NULL;
>      char *devpts = NULL;
>      char *path = NULL;
> +    uid_t uid = (uid_t)-1;
> +    gid_t gid = (gid_t)-1;
>      int ret = -1;
>  
> +    if (ctrl->def->idmap.uidmap) {
> +        uid = ctrl->def->idmap.uidmap[0].target;
> +        gid = ctrl->def->idmap.gidmap[0].target;
> +    }
> +

You're using this pattern a few times.
Maybe it's worth a helper function.

Thanks,
//richard

--
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]