mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
security_dac: check if virSecurityDACGetIds returns negative
Use the customary check '< 0' instead of checking for non-zero. No functional change.
This commit is contained in:
parent
d0daa5efad
commit
63cc969a84
@ -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);
|
||||
@ -1305,7 +1305,7 @@ virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr,
|
||||
|
||||
secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME);
|
||||
|
||||
if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL))
|
||||
if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
VIR_DEBUG("Setting child to drop privileges to %u:%u",
|
||||
|
Loading…
x
Reference in New Issue
Block a user