viraccessdriverpolkit: Add missing vtpm case

When adding vtpm virSecret usage type (in v5.6.0-rc1~61) we
forgot to update polkit access check. This limited user's ability
to match secrets in their rules. Add missing case into switch in
virAccessDriverPolkitCheckSecret().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2024-02-09 09:03:29 +01:00
parent 94365a4871
commit 63a416f3a1

View File

@ -390,6 +390,19 @@ virAccessDriverPolkitCheckSecret(virAccessManager *manager,
virAccessPermSecretTypeToString(perm), virAccessPermSecretTypeToString(perm),
attrs); attrs);
} break; } break;
case VIR_SECRET_USAGE_TYPE_VTPM: {
const char *attrs[] = {
"connect_driver", driverName,
"secret_uuid", uuidstr,
"secret_usage_name", secret->usage_id,
NULL,
};
return virAccessDriverPolkitCheck(manager,
"secret",
virAccessPermSecretTypeToString(perm),
attrs);
} break;
} }
} }