python / python/release-tools

Bug: release tooling should quote remote command arguments

Offen
#397 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
61
Forks
48
Ø Merge
1 Std. 22 Min.
Gemergte PRs (30 T.)
4

Beschreibung

run_release.py builds remote shell command strings for release publication.
Several values are interpolated directly into those command strings, including
release credential environment values, the release tag, and remote staging paths
derived from release-manager state.

Those values are normally trusted release-process inputs, but quoting them
consistently makes the generated commands safer and more predictable when a
value contains whitespace or shell metacharacters.

Reproducer

Using mocked Paramiko clients:

  1. Set the python.org API credential value to contain shell metacharacters, such
    as user:key; echo unexpected.
  2. Make the fake Sigstore issuer return a token containing shell metacharacters,
    such as token; touch /tmp/unexpected.
  3. Run the python.org upload step and capture the command sent to
    exec_command().
  4. The captured command includes those values unquoted in AUTH_INFO=... and
    SIGSTORE_IDENTITY_TOKEN=... assignments.

Similar mocked tests can set the release-manager SSH username to a value with a
metacharacter and observe that derived staging paths are inserted into cleanup,
copy, unzip, move, group, and permission commands without quoting.

Expected behavior

Release-tool commands should quote environment values, release arguments, and
remote filesystem paths before sending command strings to the remote shell,
while preserving intentional glob expansion for staged artifact copies.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit run_release.py und untersuche die Erstellung der Befehle für den Upload zu python.org und die SSH-Pfade des release-manager. Verwende gemockte Paramiko-Clients, um die Ausgabe von exec_command() mit Metazeichen in Zugangsdaten, Tokens, Benutzernamen und Staging-Pfaden zu erfassen; als abgeschlossen gilt dies, wenn diese Werte sicher maskiert werden, während die beabsichtigte Glob-Erweiterung für Kopiervorgänge von bereitgestellten Artefakten intakt bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
release
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.