On 4/9/21 9:27 AM, Markus Armbruster wrote:
Connor Kuehl <[email protected]> writes:
block/rbd.c hints that:

  * Configuration values containing :, @, or = can be escaped with a
  * leading "\".

Right now, much of the parsing code will allow anyone to escape
_anything_ so long as it's preceded by '\'.

Is this the intended behavior? Or should the parser be updated to
allow escaping only certain sequences.

I can't answer this question, but perhaps I can get us a bit closer to
an answer.

The commend you quoted in part is about "rbd:" pseudo-filenames.

By "parsing code", you probably mean qemu_rbd_parse_filename().  It uses
qemu_rbd_next_tok() to split off one part after the other, stopping at a
special delimiter character, and qemu_rbd_unescape() to unescape most,
but not all parts.

Both treat '\' followed by a character other than '\0' specially.
qemu_rbd_next_tok() doesn't stop at an escaped delimiter character.
qemu_rbd_unescape() unescapes escaped characters.

I believe the comment you quoted is basically trying to say "to use a
character that would normally be a delimiter, escape it with '\'".  It
doesn't say these are the only characters you may escape.

I agree with your interpretation here.

Not unescaping some parts feels iffy to me.

I wonder if my reading of it placed too much emphasis on the "Configuration values" part of it, which I understand to be the optional key,value pairs that come after the image name.

Thank you,

Connor


Reply via email to