snapd 2.53.2 does not allow upper case hostnames

Bug #1952740 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Critical
Ian Johnson

Bug Description

With snapd 2.53.2 we had the first major/stable release of the ability to set the hostname from a snap config setting, which was landed in https://github.com/snapcore/snapd/pull/9094

However that PR effectively introduced a regression wherein if a hostname had been configured directly either by D-Bus or otherwise not using `snap set system hostname=...` and that hostname does not match the restrictive regular expression that snapd matches the hostname against, then all system config settings are no longer usable because snapd complains that the previously set hostname does not fit the pattern. See:

- Run configure hook of "core" snap (run hook "configure": cannot set hostname "C663432546-00514": name not valid)

The fix here is two-fold, one we should expand the regular expression we check against in snapd, and two we should have logic to know whether a setting of a "virtual"/"external" system configuration originated outside of snapd or not, and if it came from outside of snapd to just let it be rather than try and re-validate it again.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

An initial relaxation of the regular expression is here: https://github.com/snapcore/snapd/pull/11123

However if you are affected by this bug, please indicate to us in this bug report an example of the sort of hostname you are using so we can be sure to allow it in the regular expression we are using.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Critical
status: Confirmed → In Progress
Changed in snapd:
assignee: nobody → Ian Johnson (anonymouse67)
Revision history for this message
Tim Howard (everactivetim) wrote (last edit ):

Ours are of the form XX00000000 where the zeros can be any digit 0-9 and XX can be any letter A-Z.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

The fix for this will be available in 2.53.4 which is being phased out to stable now.

Changed in snapd:
status: In Progress → Fix Committed
milestone: none → 2.53
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.