procargs(): interactivity falsely detected (acc. to POSIX)

Steffen Nurpmeso <[email protected]> Sat, 28 Sep 2024 01:26:52 +0200
Newsgroups org.kernel.vger.dash
Message-ID <20240927232652.bpLrmgJb@steffen%sdaoden.eu>
Hello.

In an email communication with kre@ on NetBSD's tech-userlevel we
came over

  commit a373e69a196cd8d45f2806d805e548fa65a982ba
  Author:     kre <[email protected]>
  AuthorDate: 2017-07-24 12:35:37 +0000
  Commit:     kre <[email protected]>
  CommitDate: 2017-07-24 12:35:37 +0000

      PR standards/52406

      Absent other information, the shell should be interactive if reading
      from stdin, and stdin and stderr are ttys, not stdin and stdout.

and i had in mind that dash changed this already (i thought i saw
a patch flying by on the ML?), but looking at procargs() there is

        if (iflag == 2 && sflag == 1 && stdin_istty && isatty(1))
                iflag = 1;

where that would require

        if (iflag == 2 && sflag == 1 && stdin_istty && isatty(2))
                iflag = 1;

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)