Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Steffen Nurpmeso
Robert Elz wrote in <23591.1724975...@jacaranda.noi.kre.to>: |Date:Fri, 30 Aug 2024 00:39:40 +0200 |From:Steffen Nurpmeso |Message-ID: <20240829223940.CDUfy6-w@steffen%sdaoden.eu> | || On Linux it seems not even to cause TTOU if you set || attributes which are e

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Robert Elz
Date:Fri, 30 Aug 2024 00:39:40 +0200 From:Steffen Nurpmeso Message-ID: <20240829223940.CDUfy6-w@steffen%sdaoden.eu> | On Linux it seems not even to cause TTOU if you set | attributes which are effectively identical to what is already | active Yes, my wording wa

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Steffen Nurpmeso
Martin D Kealey wrote in : |On Fri, 30 Aug 2024 at 04:17, Robert Elz wrote: |> SIGTTOU is also sent, unconditionally, by any attempt to change any of |> the terminal's attributes, and the process (group) (by default) stops. |> (I don't recall off hand whether simply fetching the attributes is

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Steffen Nurpmeso
Chet Ramey wrote in : |On 8/28/24 4:12 PM, Steffen Nurpmeso wrote: |> Chet Ramey wrote in |> <3ca901aa-5c5e-4be3-9a71-157d7101f...@case.edu>: |>|On 8/27/24 7:46 PM, Steffen Nurpmeso wrote: |>|> I got a bug report for my mailer which stated |>|> |>|> $ ( echo blah | Mail root ) & |>|>

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Steffen Nurpmeso
Robert Elz wrote in <25564.1724955...@jacaranda.noi.kre.to>: |Date:Thu, 29 Aug 2024 10:40:25 -0400 |From:Chet Ramey |Message-ID: | || It's not a big problem. You're in the background if your process group is || not equal to the terminal's process group. | |Th

Re: Question on $@ vs $@$@

2024-08-29 Thread Steffen Nurpmeso
Dear Robert, i am totally distracted regarding this topic. I will carefully read it and the standard again. (We also have likely the last midsommer week here, and i am out whenever i can.) Thanks for taking the time to look that deeply into this issue. Robert Elz wrote in <12813.1724902...@jacara

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Martin D Kealey
On Fri, 30 Aug 2024 at 04:17, Robert Elz wrote: > SIGTTOU is also sent, unconditionally, by any attempt to change any of > the terminal's attributes, and the process (group) (by default) stops. > (I don't recall off hand whether simply fetching the attributes is > enough to generate SIGTTOU.) J

Re: Question on $@ vs $@$@

2024-08-29 Thread Chet Ramey
On 8/28/24 11:41 PM, Robert Elz wrote: The reason all this is messy, is that it is (more or less) the way it was implemented in the original Bourne shell. That tells you that the implementation must be simple - the rules might seem complex to explain, but the implementation is sure to be simpl

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Robert Elz
Date:Thu, 29 Aug 2024 10:40:25 -0400 From:Chet Ramey Message-ID: | It's not a big problem. You're in the background if your process group is | not equal to the terminal's process group. That's more or less sufficient to determine if the process is in a backgroun

Re: [PATCH 1/2] printf: fix heap buffer overflow in printf_builtin

2024-08-29 Thread Andreas Schwab
On Aug 29 2024, Andrey Kovalev wrote: > - for (fmt = format; *fmt; fmt++) > + for (fmt = format; fmt - format < strlen(format); fmt++) How is that different (apart from turing a linear runtime into quadratic runtime)? -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint =

[PATCH 2/2] printf: fix heap buffer overflow in bexpand

2024-08-29 Thread Andrey Kovalev
In the loop, when iterating through the array, there was no check whether an element of the array goes beyond its limits. And with certain input data, there is an outflow from the array. --- builtins/printf.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtins/printf.de

[PATCH 1/2] printf: fix heap buffer overflow in printf_builtin

2024-08-29 Thread Andrey Kovalev
In the loop, when iterating through the array, there was no check whether an element of the array goes beyond its limits. And with certain input data, there is an outflow from the array. --- builtins/printf.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtins/prin

[PATCH 2/2] printf: fix heap buffer overflow in bexpand

2024-08-29 Thread Andrey Kovalev
In the loop, when iterating through the array, there was no check whether an element of the array goes beyond its limits. And with certain input data, there is an outflow from the array. --- builtins/printf.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtins/printf.de

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Chet Ramey
On 8/28/24 4:12 PM, Steffen Nurpmeso wrote: Chet Ramey wrote in <3ca901aa-5c5e-4be3-9a71-157d7101f...@case.edu>: |On 8/27/24 7:46 PM, Steffen Nurpmeso wrote: |> Hello. |> |> I got a bug report for my mailer which stated |> |> $ ( echo blah | Mail root ) & |>[1] 2754649 |

Re: bash passes changed termios to backgrounded process(es) groups?

2024-08-29 Thread Steffen Nurpmeso
Martin D Kealey wrote in : |On Thu, 29 Aug 2024 at 06:12, Steffen Nurpmeso wrote: |> Chet Ramey wrote in |> <3ca901aa-5c5e-4be3-9a71-157d7101f...@case.edu>: |>|On 8/27/24 7:46 PM, Steffen Nurpmeso wrote: |>|> ..and it seems that if bash starts a normal process then ICRNL is |>|> set, but i