[lxc-devel] [PATCH] Support MS_SHARED /

Serge Hallyn serge.hallyn at canonical.com
Mon Jan 7 17:47:31 UTC 2013


Quoting Alexander Vladimirov (alexander.idkfa.vladimirov at gmail.com):
> 2013/1/8 Serge Hallyn <serge.hallyn at canonical.com>:
> > Quoting Alexander Vladimirov (alexander.idkfa.vladimirov at gmail.com):
> >> Just like on the host:
> >> [idkfa at s10 ~]$ ls -la /dev/{null,tty,urandom,zero,full}
> >> crw-rw-rw- 1 root root 1, 7 янв  6 13:30 /dev/full
> >> crw-rw-rw- 1 root root 1, 3 янв  6 13:30 /dev/null
> >> crw-rw-rw- 1 root tty  5, 0 янв  8 00:03 /dev/tty
> >> crw-rw-rw- 1 root root 1, 9 янв  6 13:30 /dev/urandom
> >> crw-rw-rw- 1 root root 1, 5 янв  6 13:30 /dev/zero
> >>
> >> For example
> >
> > You say "for example", implying there is another.  I don't see it though.
> > What else is different?
> 
> I'm sure I have encountered error messages about /dev/null permissions
> at some point, but I can't reproduce it atm

Hm, but it's definately set to o+rw in the code, so that should not
be the case unless selinux is getting in the way.

> >> /dev/tty not being group-writable leads to the following
> >> error when I login through ssh:
> >>  sshd[79]: error: open /dev/tty failed - could not set controlling
> >> tty: Permission denied
> >
> > Interesting.  Mine definately is owned by group tty, and it's not
> > userspace changing it after boot, since even

Note that even if it isn't owned by group tty, it's getting S_IRWXO
so access shouldn't be a problem.

> >    lxc-start -n r2 -- /bin/sleep 100
> > with lxc.autodev = 1 gets /dev/tty owned by group tty.  I don't
> > understand why though as I don't see any place in src/lxc/conf.c where I
> > chown it.
> 
> That is why I called permissions "strange", quick look at the source
> made no insights on what's happening.
> 
> > Do you have the same result (just to help me figure out what's going on,
> > not to suggest you should have to do this) if you add
> >
> > lxc.devttydir = lxc
> 
> Doing this just moves /dev/console into subdir, but /dev/console has
> correct group and permissions regardless of this option.
> For /dev/tty and other nodes in question that option does not change anything.

d'oh, right, console and ttyN get moved but not /dev/tty...

-serge




More information about the lxc-devel mailing list