Commit 26dafb5
committed
Cygwin: pty: TCIFLUSH also clears readahead buffer in the master
Previously, TCIFLUSH flushed the pipe to_slave which transfers
input from master to slave. However, this was not sufficiant.
The master side holds input data before accept_input() in the
read-ahead buffer. So, if input data before 'enter' key can be
leaked into slave input after TCIFLUSH.
With this patch, TCIFLUSH requests master to flush read-ahead
buffer via master control pipe. To realize this, add cmd filed
to pipe_request structure so that the flush request can be
distinguished from existing pipe handle request.
Addresses: https://cygwin.com/pipermail/cygwin/2025-July/258442.html
Fixes: 41946df (" (fhandler_tty_slave::tcflush): Implement input queue flushing by calling read with NULL buffer.")
Reported-by: Christoph Reiter <[email protected]>
Signed-off-by: Takashi Yano <[email protected]>
(cherry picked from commit 2aa41b516055ea9383508342706288deb3baf1f6)1 parent ae6683e commit 26dafb5
File tree
3 files changed
+30
-5
lines changed- winsup/cygwin
- fhandler
- local_includes
- release
3 files changed
+30
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
871 | 878 | | |
872 | 879 | | |
873 | 880 | | |
874 | | - | |
| 881 | + | |
875 | 882 | | |
876 | 883 | | |
877 | 884 | | |
| |||
1139 | 1146 | | |
1140 | 1147 | | |
1141 | 1148 | | |
1142 | | - | |
| 1149 | + | |
1143 | 1150 | | |
1144 | 1151 | | |
1145 | 1152 | | |
| |||
1597 | 1604 | | |
1598 | 1605 | | |
1599 | 1606 | | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1600 | 1615 | | |
1601 | 1616 | | |
1602 | 1617 | | |
| |||
2020 | 2035 | | |
2021 | 2036 | | |
2022 | 2037 | | |
2023 | | - | |
| 2038 | + | |
2024 | 2039 | | |
2025 | 2040 | | |
2026 | 2041 | | |
| |||
2521 | 2536 | | |
2522 | 2537 | | |
2523 | 2538 | | |
2524 | | - | |
| 2539 | + | |
2525 | 2540 | | |
2526 | 2541 | | |
2527 | 2542 | | |
2528 | 2543 | | |
2529 | 2544 | | |
2530 | 2545 | | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
2531 | 2551 | | |
2532 | 2552 | | |
2533 | 2553 | | |
| |||
3780 | 3800 | | |
3781 | 3801 | | |
3782 | 3802 | | |
| 3803 | + | |
3783 | 3804 | | |
3784 | 3805 | | |
3785 | 3806 | | |
| |||
3821 | 3842 | | |
3822 | 3843 | | |
3823 | 3844 | | |
3824 | | - | |
| 3845 | + | |
3825 | 3846 | | |
3826 | 3847 | | |
3827 | 3848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2539 | 2539 | | |
2540 | 2540 | | |
2541 | 2541 | | |
| 2542 | + | |
2542 | 2543 | | |
2543 | 2544 | | |
2544 | 2545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments