api/ui: datastore: allow to set simple comment
for now forbid all control characters[0] in the comment value, the section config writer cannot cope with newlines in the value, it writes them out literally, allowing "injection" or breaking the whole config. In the webinterface use also a textfield, not a textarea. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -14,13 +14,15 @@ lazy_static! {
|
||||
}
|
||||
|
||||
const DIR_NAME_SCHEMA: Schema = StringSchema::new("Directory name").schema();
|
||||
const COMMENT_SCHEMA: Schema = StringSchema::new("Datastore comment").schema();
|
||||
const DATASTORE_ID_SCHEMA: Schema = StringSchema::new("DataStore ID schema.")
|
||||
.min_length(3)
|
||||
.schema();
|
||||
const DATASTORE_PROPERTIES: ObjectSchema = ObjectSchema::new(
|
||||
"DataStore properties",
|
||||
&[
|
||||
("path", false, &DIR_NAME_SCHEMA)
|
||||
("comment", true, &COMMENT_SCHEMA),
|
||||
("path", false, &DIR_NAME_SCHEMA),
|
||||
]
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user