git-ctty
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Wed, 7 Feb 2024 18:25:17 +0000 (18:25 +0000)
committerRaspbian forward porter <root@raspbian.org>
Wed, 7 Feb 2024 18:25:17 +0000 (18:25 +0000)
commitba8f2d03ba61f400a8541d1de30596189e3fe82c
treeb509e9492f1cc3f139c61d11d72e5b1e4f354e98
parent91b5abf4dcdf9a0baea63c60896af6827d66918f
git-ctty

commit 346b6eab3c14ead0b716d53e2235464b822f48f2
Author: Sergey Bugaev <bugaevc@gmail.com>
Date:   Sat Apr 15 22:08:56 2023 +0300

    hurd: Run init_pids () before init_dtable ()

    Much as the comment says, things on _hurd_subinit assume that _hurd_pid
    is already initialized by the time _hurd_subinit is run, so
    _hurd_proc_subinit has to run before it. Specifically, init_dtable ()
    calls _hurd_port2fd (), which uses _hurd_pid and _hurd_pgrp to set up
    ctty handling. With _hurd_subinit running before _hurd_proc_subinit,
    ctty setup was broken:

      13<--33(pid1255)->term_getctty () = 0    4<--39(pid1255)
    task16(pid1255)->mach_port_deallocate (pn{ 10}) = 0
      13<--33(pid1255)->term_open_ctty (0 0) = 0x40000016 (Invalid argument)

    Fix this by running the _hurd_proc_subinit hook in the correct place --
    just after _hurd_portarray is set up (so the proc server port is
    available in its usual place) and just before running _hurd_subinit.

    Fixes 1ccbb9258eed0f667edf459a28ba23a805549b36
    ("hurd: Notify the proc server later during initialization").

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-ctty.diff
hurd/hurdinit.c