[libvirt] [PATCH] Fix group/mode for /dev/pts inside LXC container

Daniel P. Berrange berrange at redhat.com
Tue Feb 22 14:07:25 UTC 2011


Normal practice for /dev/pts is to have it mode=620,gid=5
but LXC was leaving mode=000,gid=0 preventing unprivilegd
users in the guest use of PTYs

* src/lxc/lxc_controller.c: Fix /dev/pts setup
---
 src/lxc/lxc_controller.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index b742a33..d047f60 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -629,7 +629,7 @@ lxcControllerRun(virDomainDefPtr def,
         }
 
         VIR_DEBUG("Mouting 'devpts' on %s", devpts);
-        if (mount("devpts", devpts, "devpts", 0, "newinstance,ptmxmode=0666") < 0) {
+        if (mount("devpts", devpts, "devpts", 0, "newinstance,ptmxmode=0666,mode=0620,gid=5") < 0) {
             virReportSystemError(errno,
                                  _("Failed to mount devpts on %s"),
                                  devpts);
-- 
1.7.4




More information about the libvir-list mailing list