oliver-zehentleitner / maity
runners and placements (bug): the runner's remote clone listing uses GNU-only find -printf and walks .git without a limit
tsk-1xv8fjfzbh93 Open
From the clean-up audit tsk-hgnbapyw7hnh, Area 9 (Runners and placements), read at 80647565. Every line number is at that SHA; check it against current main first. This is audit finding 21, filed on its own because its main part is probably a bug. Paths are under cli/src/maity/.
What is wrong
- GNU-only listing over ssh (likely bug). The remote branch of
AsUser.treerunsfind -printf(runner/asuser.py:167).-printfis GNU-only, against the module's own rule atrunner/asuser.py:116-118("only tools BSD, macOS and GNU share"). On a BSD or macOS ssh host, every start would probably fail asnot_a_plain_clone. Not reproduced on such a host. - No limit while walking.
clonecheck.py:121-142(bounded_tree) stops afterTREE_MAX+1entries. Under the runner,AsUseris passed as the Files object (runner/supervisor.py:901,runner/operate.py:225).AsUser.tree(runner/asuser.py:149-172) walks everything, and only then does clonecheck count. A clone with a huge.gitis walked in full on every start before it is refused. - Duplication.
clonecheck.py:148-159(Local.exists/read) duplicates AsUser's direct branch (runner/asuser.py:134-138,188-192).
Proposal
- Give
AsUser.treethe same limit:bounded_treewhen direct; over ssh, a listing that uses only POSIXfindoptions (for example onefindper entry type with-type d,-type f,-type l, and no-printf), cut off afterTREE_MAX+1entries. - Let clonecheck's
LOCALbe the runner'sAsUser(direct), so the two direct branches become one. - Tests: a fake remote whose
findrefuses-printfstill lists the clone; a.gitwith more thanTREE_MAXentries is refused without a full walk.
Order
- tsk-ydxv7x37fg08 (done) changed what clonecheck accepts under
.git; this card does not touch those rules. tsk-090wm1dqx6y3 (docs: git under maity) describes the clonecheck refusals; no conflict, but the docs should not name a GNU requirement for ssh hosts. - The runner supervisor clean-up card adds
AsUser.remove_file()in the same module; rebase rather than conflict.
Covered elsewhere
- None. Searched: printf, bounded_tree, asuser, macOS, not_a_plain_clone.
Effort S-M (counted as M). Risk medium (portability: the remote listing must give the same result on GNU, BSD and macOS).