Zugangsdaten: .netrc ersetzt - Kennwoerter mit Sonderzeichen kamen

verstuemmelt an

Der Download schlug trotz richtiger Zugangsdaten fehl. Ursache gefunden:
die Uebergabe lief ueber eine temporaere .netrc, deren Format die Felder
durch Leerzeichen trennt. Ein Kennwort mit Leerzeichen, #, " oder
aehnlichem kam dadurch still verstuemmelt an - curl schickte etwas
anderes als hinterlegt, der Server antwortete 401, und die Meldung
lautete "Anmeldung abgelehnt", obwohl die Daten stimmten.

Gegen einen eigens gestarteten Testserver nachgemessen, Kennwort
'Pa ss#wo"rt$1':
    ohne Anmeldung            HTTP 401
    neu, curl --config -      HTTP 200
    alt, .netrc               HTTP 401

Alle dreizehn Aufrufstellen sind auf curl_auth umgestellt, das die
Angaben ueber "curl --config -" von der Standardeingabe liest und in
Anfuehrungszeichen setzt. Beliebige Zeichen sind damit moeglich, und die
Zugangsdaten stehen weiterhin nicht in der Prozessliste - geprueft.

Ausserdem sagt der Download jetzt, WORAN es liegt: vor dem Holen wird
der Status abgefragt und 401/403 (Anmeldung), 404 (Datei gibt es nicht)
und 000 (nicht erreichbar) getrennt gemeldet. Doppelte Kandidaten
werden nicht mehr zweimal probiert.

Dazu zwei Aergernisse aus der Bedienung beseitigt:
  * Der Assistent meldete nach "nur eintragen" die Abweichung als
    Problem, obwohl der Benutzer genau das gewollt hatte. Jetzt steht
    dort schlicht, dass Edition und Version gespeichert sind und kein
    Image geholt wurde.
  * Der Dialog hinter CMK_IMAGE/EDITION/VERSION war lang und erklaerte
    mehr, als er half. Er nennt jetzt in zwei Zeilen die Lage und stellt
    die Handlung voran.

Randnotiz zur Fehlersuche: die URL selbst war nie das Problem. Der
Server liefert fuer check-mk-enterprise-docker-2.4.0p9.tar.gz ein 401,
also "vorhanden, nur geschuetzt" - und fuer check-mk-pro-... ein 404,
denn "pro" heisst die Edition erst ab 2.5.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-20 18:11:19 +02:00
co-authored by Claude Opus 5
parent e7eb1c3be9
commit c1371da7aa
3 changed files with 119 additions and 100 deletions
+11 -4
View File
@@ -763,8 +763,15 @@ Options:
./scripts/cmk-manage.sh image test --only download
```
The credentials are passed to `curl` through a temporary `.netrc` and therefore
do **not** appear in the process list. If `curl` is missing, the registry check
The credentials are passed to `curl` via `curl --config -` on standard input
and therefore do **not** appear in the process list.
> **Passwords with special characters:** this used to go through a temporary
> `.netrc` file. Its format separates fields by whitespace, so a password
> containing spaces, `#` or quotes arrived silently mangled and the login
> failed for no apparent reason. Measured against a test server: with a
> password containing a space, `#`, `"` and `$`, the new route returns HTTP
> 200 and the old one HTTP 401. If `curl` is missing, the registry check
falls back to `podman login` / `docker login` – into a throwaway file as well,
so the system's stored login is left untouched.
@@ -872,8 +879,8 @@ sudo ./scripts/cmk-manage.sh image download \
--user <user> --password <password>
```
The credentials are handed to `curl` through a temporary `.netrc` file and
therefore do **not** appear in the process list.
The credentials are handed to `curl` via `curl --config -` and therefore do
not appear in the process list.
**c) Loading a file you already downloaded**