Closed Bug 675349 Opened 14 years ago Closed 11 years ago

Config: restrict acceptable section head characters

Categories

(Cloud Services :: Server: Core, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: telliott, Assigned: rmiller)

References

Details

(Whiteboard: [qa-])

If a section head in a config file contains something other than [A-Za-z0-9_] it's probably an error. Since '.' has a special meaning internally, we should probably start throwing ValueErrors if weird characters are in the section heads.
Assignee: nobody → rmiller
Blocks: 676423
(In reply to Toby Elliott [:telliott] from comment #0) > If a section head in a config file contains something other than > [A-Za-z0-9_] it's probably an error. Since '.' has a special meaning > internally, we should probably start throwing ValueErrors if weird > characters are in the section heads. This is a little tricky w/ the host-specific configuration stuff we support, b/c we have section headers in production that look similar to this: [host:sync15.services.mozilla.com] These are handled correctly by the config parsing and the merging, but they do make it impossible to generate a list of the sections from a Config object, and they make it possible to get meaningless results from `get_section`, e.g. `config.get_section('host:sync15.services')` WOULD return results given the above header, even though such a section doesn't actually exist.
This bug was more for "let's define a set of characters". Adding colon to the set works fine. Adding random unicode is likely to cause more pain than value. Good point on period, too.
Whiteboard: [qa-]
Konfig has a whole host of rules associated with this, which probably makes this bug irrelevant at this point.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.