Mohamed Ayman commented: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1355#note_154770


# :scroll: **The History of Parameter 'forever' is ignored with login function 
Issue** #1828 :scroll:

* **July 2011:The Issue created by Trac Migrate** 
* **April 2014 (The First Attempt):** Dr. Gedare @gedare  first proposed fixing 
this by changing the loop condition from `while (result && 
shell_env->forever);` to `while (result || shell_env->forever);`.
  * [Issue link](https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/1828)
* **January 2025 (MR** #371 **- Closed):** Kinsey Moore @opticron  revisited 
Dr. Gedare's original idea and opened MR #371 using the same `||` operator 
change. However, the MR was closed because the community realized that this 
approach was dangerous; and required much more testing before it could be 
merged.
  * [MR#371 
link](https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/371)
* **July 2025 (MR** #619 **- Merged):** Chris Johns @chris  provided a deep 
dive into why simply altering the boolean condition breaks the shell. He proved 
that Termios will block and stay blocked in the reader with the shell's current 
termios settings. He noted that without fundamentally rewriting the shell 
reader, developers have to rely on workarounds (like his `wake_console()` 
function that alters the telnet pty `c_cc[VMIN]` and `VTIME` settings) to 
handle dropped websocket/telnet sessions. He concluded that the simple `||` 
change fundamentally breaks shell functionality.
  * [MR#619 
link](https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/619)
* **July 2026 (MR #1355 - The Current Fix):** Mohamed Ayman @mohamedayman23  
opened MR #1355 with a targeted logic fix. Instead of hacking the boolean 
operators and accidentally breaking EOF handling or Termios blocking, we 
tracked the specific failure state directly. By introducing a new 
`login_failed` variable, the loop now knows _why_ `result` is false. The 
updated condition, `while (shell_env->forever && (result || login_failed))`, 
isolates the failed login edge-case. This allows the shell to correctly prompt 
for a new login when `forever` is true, while cleanly preserving the shell's 
behavior for actual EOFs, explicit `exit` commands, and environment setup 
failures.
  * [MR#1355 
link](https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1355)

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1355#note_154770
You're receiving this email because of your account on gitlab.rtems.org. 
Unsubscribe from this thread: 
https://gitlab.rtems.org/-/sent_notifications/4-b4craqw75g3epa4w7542y3tuo-1d/unsubscribe
 | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | 
Help: https://gitlab.rtems.org/help


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to