John Ferlan e0eb8a8a69 secret: Add check/validation for correct usage when LookupByUUID
https://bugzilla.redhat.com/show_bug.cgi?id=1656255

If virSecretGetSecretString is using by secretLookupByUUID,
then it's possible the found sec->usageType doesn't match the
desired @secretUsageType. If this occurs for the encrypted
volume creation processing and a subsequent pool refresh is
executed, then the secret used to create the volume will not
be found by the storageBackendLoadDefaultSecrets which expects
to find secrets by VIR_SECRET_USAGE_TYPE_VOLUME.

Add a check to virSecretGetSecretString to avoid the possibility
along with an error indicating the incorrect matched types.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
2018-12-13 10:22:25 -05:00
..
2017-11-20 13:22:48 +01:00
2018-10-01 14:27:42 -04:00
2017-04-11 13:23:01 +02:00
2018-04-10 15:16:23 +02:00
2018-12-03 14:31:41 +01:00
2017-07-26 15:33:45 +02:00
2017-04-27 14:13:19 +02:00
2018-12-05 10:39:54 +01:00