[CRIU] [PATCH 2/2] tty: Set fsuid/fsgid when opening master peer
Andrei Vagin
avagin at gmail.com
Fri Aug 5 14:00:58 PDT 2016
On Fri, Aug 5, 2016 at 1:53 PM, Cyrill Gorcunov <gorcunov at gmail.com> wrote:
> On Fri, Aug 05, 2016 at 01:32:13PM -0700, Andrew Vagin wrote:
> ...
>> > + old_fsuid = setfsuid(ce->fsuid);
>> > + old_fsgid = setfsgid(ce->fsgid);
>>
>> Actually a slave end can have other uid, gid then a process where it is
>> opened.
>>
>> You need to save uid and gid for it on dump and restore them back with
>> help of chown().
>
> This won't be a traditional configuration but still quite possible.
> So yes. Thanks for feedback. Pavel, drop the patches. I'll create
> new ones when I get spare time for.
It is the "traditional" configuration ;). Look at tty owners on my laptop:
[avagin at laptop linux-task-diag]$ ls -l /dev/pts/
total 0
crw--w----. 1 avagin tty 136, 0 Aug 2 09:45 0
crw--w----. 1 avagin tty 136, 1 Aug 1 19:12 1
crw--w----. 1 avagin tty 136, 10 Aug 5 10:40 10
crw--w----. 1 avagin tty 136, 11 Aug 5 13:50 11
crw--w----. 1 avagin tty 136, 12 Aug 5 12:41 12
crw--w----. 1 avagin tty 136, 13 Aug 5 11:46 13
crw--w----. 1 avagin tty 136, 14 Aug 5 11:39 14
crw--w----. 1 avagin tty 136, 15 Aug 5 13:58 15
crw--w----. 1 avagin tty 136, 16 Aug 5 12:46 16
crw--w----. 1 avagin tty 136, 17 Aug 5 12:48 17
crw--w----. 1 avagin tty 136, 18 Aug 5 13:57 18
crw--w----. 1 avagin tty 136, 19 Aug 5 12:54 19
crw--w----. 1 qemu tty 136, 2 Aug 4 18:36 2
crw--w----. 1 avagin tty 136, 3 Aug 2 10:18 3
crw--w----. 1 avagin tty 136, 4 Aug 4 16:14 4
crw--w----. 1 avagin tty 136, 5 Aug 4 16:35 5
crw--w----. 1 avagin tty 136, 6 Aug 5 11:17 6
crw--w----. 1 avagin tty 136, 7 Aug 5 00:03 7
crw--w----. 1 avagin tty 136, 8 Aug 4 16:04 8
crw--w----. 1 avagin tty 136, 9 Aug 5 11:46 9
c---------. 1 root root 5, 2 Jul 22 15:29 ptmx
The all have the tty group.
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list