I've read in the GSettings documentation that:
Key names are restricted to lowercase characters, numbers and '-'. Furthermore, the names must begin with a lowercase character, must not end with a '-', and must not contain consecutive dashes
But there are no notes on path names, other that not including consecutive slashes (/
). My use case is generating subdirectories (from a relocatable schema) for device based settings and I'm wondering if I should be sanitising the strings of any characters.
There are notes on path names, and they are complete:
(from the documentation).
The code which validates them is the following:
(from gsettings.c).
So the documentation is complete — it mentions everything the code checks.
Depending on how your devices are identified, you probably do want to do some escaping or sanitisation to remove slashes just in case you would have ended up with consecutive slashes. Other than that, you only need to sanitise things to make them human readable and easy to debug, if you want.