From: John Ferlan Date: Tue, 12 Feb 2019 13:36:40 +0000 (-0500) Subject: util: Check for duplicated id in virStorageSourceParseRBDColonString X-Git-Tag: v5.1.0-rc1~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b20e957d0a3e475e208102f0c617b7ebf564a920;p=thirdparty%2Flibvirt.git util: Check for duplicated id in virStorageSourceParseRBDColonString If we find multiple "id=" strings during processing, then we need to force an error since we cannot have multiple 's defined for a single source volume. Signed-off-by: John Ferlan Reviewed-by: Ján Tomko --- diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 5a8e5667f5..8d85d9dac4 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2840,6 +2840,11 @@ virStorageSourceParseRBDColonString(const char *rbdstr, if (STRPREFIX(p, "id=")) { /* formulate authdef for src->auth */ + if (src->auth) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("duplicate 'id' found in '%s'"), src->path); + return -1; + } if (VIR_ALLOC(authdef) < 0) return -1;