[PATCH] xfree86: Keep a non-seat0 X server from touching VTs (#71258)

David Herrmann dh.herrmann at gmail.com
Sun Nov 10 23:52:29 PST 2013


Hi

On Thu, Nov 7, 2013 at 5:53 PM, Laércio de Sousa <lbsousajr at gmail.com> wrote:
> This is my first atempt to block VT access to non-seat0 X servers.
>
> If -seat option is passed with a value different from seat0,
> X server won't call xf86OpenConsole().
>
> This is needed to avoid any race condition between seat0 and
> non-seat0 X servers. If a non-seat0 X server opens a given VT
> before a seat0 one which expects to open the same VT, one can
> get an inactive systemd-logind graphical session for seat0.
>
> This patch was first tested in a multiseat setup with multiple
> video cards and works quite well.
>
> I suppose it can also make things like DontVTSwitch and -sharevts
> meaningless for non-seat0 seats, so it may fix bug #69477, too.
>
> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71258
>        https://bugs.freedesktop.org/show_bug.cgi?id=69477 (maybe)
>
> See also: http://lists.x.org/archives/xorg-devel/2013-October/038391.html
>           https://bugzilla.redhat.com/show_bug.cgi?id=1018196
> ---
>  hw/xfree86/common/xf86Init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
> index 91ec4c8..a678f4d 100644
> --- a/hw/xfree86/common/xf86Init.c
> +++ b/hw/xfree86/common/xf86Init.c
> @@ -545,7 +545,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
>                  want_hw_access = TRUE;
>
>              if (!(flags & HW_SKIP_CONSOLE))
> -                xorgHWOpenConsole = TRUE;
> +                xorgHWOpenConsole = !ServerIsNotSeat0();

Did you test that? I don' know whether there are any implications if
we don't open the VT. The idea sounds good, though. I'd like to see
that applied upstream. However, maybe someone can comment why
"sharedvt" was introduced in the first place?

Thanks
David

>          }
>
>          if (xorgHWOpenConsole)
> --
> 1.8.1.4
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list