description ? and ip nat pool ? still store the help key: a port described "?" and a NAT pool called "?" #1691

Closed
opened 2026-11-16 16:38:43 +00:00 by jaylouisw · 0 comments
Owner

The measurement

? is the key an operator presses to ask what goes here. #1685 refused it in the three free-text
positions the sweep found — hostname, dns zone, vlan <id> name. Two more store it as the text.

Interface description. The console's own interface-mode help advertises description <text>, and
the position takes the key:

Catalyst2960(config)# interface Fa0/1
Catalyst2960(config-if)# description ?
Description set: ?

Catalyst2960# show running-config
interface Fa0/1
  description ?

Catalyst2960# show interfaces Fa0/1
Fa0/1 (ethernet, 100M), MAC 0200.0000.0000
  status: down (no cable), protocol: down, desc: ?

The receipt reads exactly like the one description lab gives, and whatever description the port had
is gone.

NAT pool name.

ISR4331(config)# ip nat pool ? 1.1.1.1 1.1.1.2 netmask 255.255.255.0
NAT pool "?" 1.1.1.1 - 1.1.1.2 netmask 255.255.255.0

ISR4331# show running-config
ip nat pool ? 1.1.1.1 1.1.1.2 netmask 255.255.255.0

ISR4331# show ip nat statistics
Address pools: 1 (? 1.1.1.1-1.1.1.2)

A pool nobody asked for, which ip nat inside source list <spec> pool ? overload will then accept,
and whose only clean exit is quoting the key back at no ip nat pool ?.

Why the typed positions were safe and these are not

Every typed position refuses the key by quoting it (% Invalid VLAN id "?", % Invalid AS number "?"):
a value that will not parse is a value that can be corrected. A description and a pool name are free
text, so any string is legal — including the one string that means "I was asking a question". #1685's
fix is a helper (_helpKeyRefusal) applied at three positions; these two are the same defect at
positions that sweep missed, and the sweep has now been done over every config head that takes a text
value: description, ip nat pool, access-list <n>, dns zone/dns add, vlan <id> name,
hostname. The rest either validate their argument or already refuse the key.

The fix that follows

description ? and ip nat pool ? are refused by name, before anything is written, quoting the syntax
and saying nothing changed — the same message shape as #1685. A question mark inside a longer value
(description edge?1, pool name pool?1) stays part of the value, because only the whole value is the
key. Test additions belong in test/help-key-is-not-a-value.test.js, which already pins the #1685 set.

Found while sweeping this, filed separately, not fixed here

The no forms read the tokens they need and ignore the rest, so a ? at the end of a no line does
not ask — it acts:

no hostname ?        -> Hostname cleared (device is now Catalyst 2960-d1)
no vlan 42 name ?    -> VLAN 42 removed
no description ?     -> Description removed: lab

A keypress deletes a VLAN there. Different mechanism, different fix, so it gets its own issue.

## The measurement `?` is the key an operator presses to ask what goes here. #1685 refused it in the three free-text positions the sweep found — `hostname`, `dns zone`, `vlan <id> name`. Two more store it as the text. **Interface description.** The console's own interface-mode help advertises `description <text>`, and the position takes the key: ``` Catalyst2960(config)# interface Fa0/1 Catalyst2960(config-if)# description ? Description set: ? Catalyst2960# show running-config interface Fa0/1 description ? Catalyst2960# show interfaces Fa0/1 Fa0/1 (ethernet, 100M), MAC 0200.0000.0000 status: down (no cable), protocol: down, desc: ? ``` The receipt reads exactly like the one `description lab` gives, and whatever description the port had is gone. **NAT pool name.** ``` ISR4331(config)# ip nat pool ? 1.1.1.1 1.1.1.2 netmask 255.255.255.0 NAT pool "?" 1.1.1.1 - 1.1.1.2 netmask 255.255.255.0 ISR4331# show running-config ip nat pool ? 1.1.1.1 1.1.1.2 netmask 255.255.255.0 ISR4331# show ip nat statistics Address pools: 1 (? 1.1.1.1-1.1.1.2) ``` A pool nobody asked for, which `ip nat inside source list <spec> pool ? overload` will then accept, and whose only clean exit is quoting the key back at `no ip nat pool ?`. ## Why the typed positions were safe and these are not Every typed position refuses the key by quoting it (`% Invalid VLAN id "?"`, `% Invalid AS number "?"`): a value that will not parse is a value that can be corrected. A description and a pool name are free text, so any string is legal — including the one string that means "I was asking a question". #1685's fix is a helper (`_helpKeyRefusal`) applied at three positions; these two are the same defect at positions that sweep missed, and the sweep has now been done over every config head that takes a text value: `description`, `ip nat pool`, `access-list <n>`, `dns zone`/`dns add`, `vlan <id> name`, `hostname`. The rest either validate their argument or already refuse the key. ## The fix that follows `description ?` and `ip nat pool ?` are refused by name, before anything is written, quoting the syntax and saying nothing changed — the same message shape as #1685. A question mark inside a longer value (`description edge?1`, pool name `pool?1`) stays part of the value, because only the whole value is the key. Test additions belong in `test/help-key-is-not-a-value.test.js`, which already pins the #1685 set. ## Found while sweeping this, filed separately, not fixed here The `no` forms read the tokens they need and ignore the rest, so a `?` at the end of a `no` line does not ask — it acts: ``` no hostname ? -> Hostname cleared (device is now Catalyst 2960-d1) no vlan 42 name ? -> VLAN 42 removed no description ? -> Description removed: lab ``` A keypress deletes a VLAN there. Different mechanism, different fix, so it gets its own issue.
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#1691
No description provided.