> @@ -111,21 +111,31 @@
virSecuritySELinuxContextListAppend(virSecuritySELinuxContextListPtr list,
> const char *tcon,
> bool optional)
> {
> - virSecuritySELinuxContextItemPtr item;
> + int ret = -1;
> + char *tmp = NULL;
> + virSecuritySELinuxContextItemPtr item = NULL;
>
> if (VIR_ALLOC(item) < 0)
> return -1;
>
> - item->path = path;
> + if (VIR_STRDUP(tmp, path) < 0)
> + goto cleanup;
> +
> + item->path = tmp;
> item->tcon = tcon;
Unfortunately, while this was enough in the DAC driver, it is not enough
here. @tcon may be dynamically allocated just for this call:
virSecuritySELinuxRestoreFileLabel ->
virSecuritySELinuxSetFilecon ->
virSecuritySELinuxSetFileconHelper ->
virSecuritySELinuxTransactionAppend ->
virSecuritySELinuxContextListAppend
However, I guess fixing that is trivial. ACK if you do so and safe for
the freeze.
Adjusted both patches according to your suggestions and pushed, thanks.
Erik
Michal
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list