提交 63cc969a 编写于 作者: J Ján Tomko

security_dac: check if virSecurityDACGetIds returns negative

Use the customary check '< 0' instead of checking for non-zero.

No functional change.
上级 d0daa5ef
...@@ -547,7 +547,7 @@ virSecurityDACSetSecurityHostdevLabelHelper(const char *file, ...@@ -547,7 +547,7 @@ virSecurityDACSetSecurityHostdevLabelHelper(const char *file,
uid_t user; uid_t user;
gid_t group; gid_t group;
if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL)) if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL) < 0)
return -1; return -1;
return virSecurityDACSetOwnership(priv, NULL, file, user, group); return virSecurityDACSetOwnership(priv, NULL, file, user, group);
...@@ -1305,7 +1305,7 @@ virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr, ...@@ -1305,7 +1305,7 @@ virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr,
secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME); 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; return -1;
VIR_DEBUG("Setting child to drop privileges to %u:%u", VIR_DEBUG("Setting child to drop privileges to %u:%u",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册