Fix group/mode for /dev/pts inside LXC container

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
This commit is contained in:
Daniel P. Berrange 2011-02-22 14:06:09 +00:00
parent 009fce98be
commit 08fb2a9ce8

View File

@ -629,7 +629,8 @@ 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);