Skip to content

nshlib: apply privilege prompt markers only after real login - #3727

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Abhishekmishra2808:nshlib/fix-privilege-prompt-ci
Aug 15, 2026
Merged

nshlib: apply privilege prompt markers only after real login#3727
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Abhishekmishra2808:nshlib/fix-privilege-prompt-ci

Conversation

@Abhishekmishra2808

@Abhishekmishra2808 Abhishekmishra2808 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Emergency CI / NTFC is failing after testing/ostest: multiuser coverage for supplementary groups and setresuid #3714 with TimeoutError: device boot timeout on sim/citest and qemu-rv/citest.
  • nsh_consolemain() always starts the session with NSH_LOGIN_LOCAL, even when CONFIG_NSH_CONSOLE_LOGIN is disabled. PR 3714 treated any non-NONE session as a login and rewrote nsh> to nsh# whenever CONFIG_SCHED_USER_IDENTITY was enabled.
  • NTFC detects boot by looking for CONFIG_NSH_PROMPT_STRING (nsh>), so those citest configs (USER_IDENTITY on, console login off) never come up.
  • Apply #/$ markers only after a successful console or telnet login (or su). No-login boot keeps nsh>.

Impact

  • CONFIG_SCHED_USER_IDENTITY boards without NSH login keep the configured prompt at boot (CI/NTFC compatible).
  • Login-enabled sessions and su still get nsh# / nsh$.
  • No change when CONFIG_SCHED_USER_IDENTITY is disabled.

Testing

Build host: Linux WSL2, sim:nsh with CONFIG_SCHED_USER_IDENTITY=y and console login disabled (same prompt path as sim/citest / qemu-rv/citest).

No-login boot keeps CONFIG_NSH_PROMPT_STRING (nsh>), so NTFC boot detection can succeed. After su, root becomes nsh#:

NuttShell (NSH) NuttX-13.0.0
nsh> id
uid=0(root) gid=0(root)
nsh> su
nsh# id
uid=0(root) gid=0(root)
nsh# whoami
root
nsh# 

nsh_consolemain always passes NSH_LOGIN_LOCAL, so treating any
non-NONE session as a login rewrote nsh> to nsh# whenever
SCHED_USER_IDENTITY was enabled.  NTFC boot detection then timed
out on sim/citest and qemu-rv/citest.

Keep CONFIG_NSH_PROMPT_STRING until a successful console or telnet
login (or su).

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
@raiden00pl

Copy link
Copy Markdown
Member

@xiaoxiang781216 @jerpelea @acassis this should unblock broken NTFC, but CI doesn't start for some reason

@Abhishekmishra2808

Copy link
Copy Markdown
Contributor Author

@raiden00pl CI is running, but it does not show on this page. (https://github.com/apache/nuttx-apps/actions/runs/31820937588)

@raiden00pl

Copy link
Copy Markdown
Member

@Abhishekmishra2808 It seems that CI is starting multiple jobs for a single PR, something is broken in the CI logic

image

@xiaoxiang781216
xiaoxiang781216 merged commit 2ca518b into apache:master Aug 15, 2026
54 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants