Re: [PATCH 2/2] security: SELinux: fix the transaction model's list append

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > @@ -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@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux