? in a free-text position is stored as the name: hostname ? renames the box to "?" #1685

Closed
opened 2026-11-16 16:11:57 +00:00 by jaylouisw · 1 comment
Owner

The measurement

? is the key a technician presses when they do not know what goes in a position. Three commands take free text,
and all three stored the key as the text. Each was run on a fresh device, config mode, and the running-config was
diffed before and after:

typed was answered state change
hostname ? (nothing at all) hostname ? - the box was renamed to ?
dns zone ? DNS zone ? ready dns zone ? - a zone named ? was created
vlan 42 name ? VLAN 42 created (name: ?) vlan 42 ? - VLAN 42 created and named ?

Why this is a bug and not a design choice

Every typed position already refuses the key by quoting it, because a value that will not parse can be
corrected: % Invalid VLAN id "?": a VLAN id is a whole number from 1 to 4094, % Invalid router-id "?": not an IPv4 address, % Invalid pool name: ?, % "?" is not a bridge priority. The free-text positions could not refuse
it that way, because any string is a legal name - so the key became one, silently.

The silent one is the worst: hostname prints its receipt as a prompt, so hostname ? looks exactly like a
successful rename until you look at a surface that shows the name. That is the same defect #1497 fixed for a bare
hostname (it cleared the name to null and said nothing), one keypress further along.

What is not wrong, and must stay

  • a bare hostname is still % Incomplete command: hostname <name> (the name is unchanged) - a short line, not a
    keypress;
  • a question mark inside a longer name is still part of the name: hostname edge?1 stores and prints edge?1.
    Only the whole value is the key.

Found while sweeping the . ? positions of every view on main @ 6e3b5d6a; no open issue covered it.

## The measurement `?` is the key a technician presses when they do not know what goes in a position. Three commands take free text, and all three stored the key as the text. Each was run on a fresh device, config mode, and the running-config was diffed before and after: | typed | was answered | state change | |---|---|---| | `hostname ?` | *(nothing at all)* | `hostname ?` - the box was renamed to `?` | | `dns zone ?` | `DNS zone ? ready` | `dns zone ?` - a zone named `?` was created | | `vlan 42 name ?` | `VLAN 42 created (name: ?)` | `vlan 42 ?` - VLAN 42 created and named `?` | ## Why this is a bug and not a design choice Every **typed** position already refuses the key by quoting it, because a value that will not parse can be corrected: `% Invalid VLAN id "?": a VLAN id is a whole number from 1 to 4094`, `% Invalid router-id "?": not an IPv4 address`, `% Invalid pool name: ?`, `% "?" is not a bridge priority`. The free-text positions could not refuse it that way, because any string is a legal name - so the key became one, silently. The silent one is the worst: `hostname` prints its receipt as a prompt, so `hostname ?` looks exactly like a successful rename until you look at a surface that shows the name. That is the same defect #1497 fixed for a bare `hostname` (it cleared the name to null and said nothing), one keypress further along. ## What is *not* wrong, and must stay * a bare `hostname` is still `% Incomplete command: hostname <name> (the name is unchanged)` - a short line, not a keypress; * a question mark inside a longer name is still part of the name: `hostname edge?1` stores and prints `edge?1`. Only the whole value is the key. Found while sweeping the `.` `?` positions of every view on `main` @ `6e3b5d6a`; no open issue covered it.
Author
Owner

Fixed on fix/1116-1606 @ 6141938a, PR #1686 (mergeable, open).

One helper, _helpKeyRefusal(), at the three free-text sites: hostname, dns zone and vlan <id> name. Each refuses before anything is created, so a keypress leaves no VLAN, no zone and no name behind.

node test/help-key-is-not-a-value.test.js   23 passed, 0 failed   (17 of them failed before the change)
node scripts/run-tests.js                   283 suite(s) - 10108 assertions passed, 0 failed
node scripts/syntax-check.js                Syntax-checked 354 files: all OK

Pinned as unchanged: a bare hostname is still % Incomplete command (#1497), and hostname edge?1 still stores edge?1 - only the whole value is the key.

Fixed on `fix/1116-1606` @ `6141938a`, PR #1686 (mergeable, open). One helper, `_helpKeyRefusal()`, at the three free-text sites: `hostname`, `dns zone` and `vlan <id> name`. Each refuses before anything is created, so a keypress leaves no VLAN, no zone and no name behind. ``` node test/help-key-is-not-a-value.test.js 23 passed, 0 failed (17 of them failed before the change) node scripts/run-tests.js 283 suite(s) - 10108 assertions passed, 0 failed node scripts/syntax-check.js Syntax-checked 354 files: all OK ``` Pinned as unchanged: a bare `hostname` is still `% Incomplete command` (#1497), and `hostname edge?1` still stores `edge?1` - only the whole value is the key.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1685
No description provided.