Test the managed agent's direct-mode launch without privileges
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the dispatch and spawn paths in nvx-rs/src/guest/managed_agent/seam.rs and nvx-rs/src/guest/sys/spawn.rs, then review the existing cases in git show 8142d4e54~1:scripts/test_nvx_tools.py. The issue calls for a fork-safe identity-call seam, a setpriv shim, a real spawn path, and a pseudo-terminal helper in nvx-rs/tests/guest_tools.rs. Done means the listed working-directory, identity, PWD, and sandbox STOP cases run without root privileges.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #561, part of #358.
#561 deletes scripts/test_managed_agent.py and the C-backed managed-agent classes of scripts/test_nvx_tools.py, and ports their cases to nvx-rs. The remaining cases need the real direct-mode launch, which no unprivileged test can run today:
TestSystem::spawninnvx-rs/src/guest/managed_agent/seam.rsreturnsENOSYS, so the dispatch tests stop before a workload starts.- The child's
setgroups,setegid,seteuid, andchdircalls innvx-rs/src/guest/sys/spawn.rsrun afterforkand bypass theSystemseam, so a non-root test fails atsetgroupsbefore it reaches the directory check.
The C harnesses stubbed those calls at link time and ran a setpriv shim. These cases remain to port, from ManagedAgentWorkingDirectoryTests and ManagedAgentStopTests (git show 8142d4e54~1:scripts/test_nvx_tools.py):
- Working-directory refusals. A missing directory (
ENOENT), a regular file (ENOTDIR), and a directory that the workload cannot search (EACCES) each printnvx-managed-agent: cannot enter working directory DIR: STRERRORon the workload's stderr, then answerAPP_ERROR(errno, "cwd-failed"), and run nothing. This is the guest side ofFEATURE_EXEC_CWD. - Identity failure. A
setgroupsfailure answersAPP_ERROR(125, "launch-failed")and runs nothing. - Checked directory. A symbolic link retargeted, or a directory renamed, between the check and the exec still starts the workload in the directory that was checked.
- End-to-end
PWD. The default working directory is/; a requested directory sets both the physical directory andPWD; a symbolic link keeps its name inPWD, whilelink/.gives the physical path; an exact environment controlsPWD; a layered environment keeps the agent'sPWD. - Sandbox stop. In sandbox mode,
STOPanswersSTOPPED, and the agent process then exits 0.
What is needed:
- A fork-safe, test-only way to make the identity calls in
spawn.rssucceed or fail without privileges, as the C harness's link-time stubs did. - A
setprivshim throughPaths.setprivthat can change the file system between the directory check and the exec. - A scripted or real spawn path in the dispatch test harness.
- A pseudo-terminal helper in
nvx-rs/tests/guest_tools.rsthat drives a real agent through RESET and STOP, then reaps it.
Running these tests as root in CI would avoid (1) for the success paths, but unprivileged developers would then skip them.
- Lingua principale
- Python
- Stelle
- 408
- Fork
- 28
- Merge medio
- 15h 20m
- PR unite (30g)
- 301
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/nvx
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 36/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/nvx
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ansys/pyansys-common-mcp#213 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
freedomofpress/dangerzone#1594 ·
I maintainer di solito rispondono entro 3 giorni
-
priority:P1 status:in-review type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
randomparity/kdive#3317 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mesonbuild/meson#16281 ·
I maintainer di solito rispondono entro 1 giorno