Re: [PATCH] virSecuritySELinuxTransactionCommit: Return -1 if no transaction is set

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

 



On 11/13/2018 05:32 PM, Marc Hartmayer wrote:
> Return -1 and report an error message if no transaction is set and
> virSecuritySELinuxTransactionCommit is called.
> 
> The function description of virSecuritySELinuxTransactionCommit says:
> 
>   "Also it is considered as error if there's no transaction set and this
>    function is called."
> 
> Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
> ---
> 
> Please apply this patch after the patch
> "virSecuritySELinuxTransactionCommit: Don't mask error" from Michal.
> 
> ---
>  src/security/security_selinux.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
> index c09404f6f833..780d650c69ea 100644
> --- a/src/security/security_selinux.c
> +++ b/src/security/security_selinux.c
> @@ -1094,8 +1094,11 @@ virSecuritySELinuxTransactionCommit(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
>      int ret = -1;
>  
>      list = virThreadLocalGet(&contextList);
> -    if (!list)
> -        return 0;
> +    if (!list) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +                       _("No transaction is set"));
> +        return -1;
> +    }
>  
>      if (virThreadLocalSet(&contextList, NULL) < 0) {
>          virReportSystemError(errno, "%s",
> 

He he.

ACKed and pushed both. Thanks for the review.

Michal

--
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