Re: [PATCH 1/3] security_dac: check if virSecurityDACGetIds returns negative

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

 




On 11/20/2015 05:00 AM, Ján Tomko wrote:
> Use the customary check '< 0' instead of checking for non-zero.
> 
> No functional change.
> ---
>  src/security/security_dac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/security/security_dac.c b/src/security/security_dac.c
> index dfdeffd..8b9c473 100644
> --- a/src/security/security_dac.c
> +++ b/src/security/security_dac.c
> @@ -547,7 +547,7 @@ virSecurityDACSetSecurityHostdevLabelHelper(const char *file,
>      uid_t user;
>      gid_t group;
>  
> -    if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL))
> +    if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL) < 0)
>          return -1;
>  
>      return virSecurityDACSetOwnership(priv, NULL, file, user, group);
> 

Similar issue in virSecurityDACSetChildProcessLabel

ACK with both adjusted.

John

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