提交 c6172260 编写于 作者: J Jiri Denemark

security: Cleanup DAC driver

Fixes several style issues and removes "DEF" (what is it supposed to
mean anyway?) from debug messages.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 fc03eb53
......@@ -856,14 +856,13 @@ virSecurityDACSetChardevLabel(virSecurityManagerPtr mgr,
break;
case VIR_DOMAIN_CHR_TYPE_PIPE:
if ((virAsprintf(&in, "%s.in", dev_source->data.file.path) < 0) ||
(virAsprintf(&out, "%s.out", dev_source->data.file.path) < 0))
if (virAsprintf(&in, "%s.in", dev_source->data.file.path) < 0 ||
virAsprintf(&out, "%s.out", dev_source->data.file.path) < 0)
goto done;
if (virFileExists(in) && virFileExists(out)) {
if ((virSecurityDACSetOwnership(priv, NULL, in, user, group) < 0) ||
(virSecurityDACSetOwnership(priv, NULL, out, user, group) < 0)) {
if (virSecurityDACSetOwnership(priv, NULL, in, user, group) < 0 ||
virSecurityDACSetOwnership(priv, NULL, out, user, group) < 0)
goto done;
}
} else if (virSecurityDACSetOwnership(priv, NULL,
dev_source->data.file.path,
user, group) < 0) {
......@@ -927,14 +926,13 @@ virSecurityDACRestoreChardevLabel(virSecurityManagerPtr mgr,
break;
case VIR_DOMAIN_CHR_TYPE_PIPE:
if ((virAsprintf(&out, "%s.out", dev_source->data.file.path) < 0) ||
(virAsprintf(&in, "%s.in", dev_source->data.file.path) < 0))
if (virAsprintf(&out, "%s.out", dev_source->data.file.path) < 0 ||
virAsprintf(&in, "%s.in", dev_source->data.file.path) < 0)
goto done;
if (virFileExists(in) && virFileExists(out)) {
if ((virSecurityDACRestoreSecurityFileLabel(priv, out) < 0) ||
(virSecurityDACRestoreSecurityFileLabel(priv, in) < 0)) {
if (virSecurityDACRestoreSecurityFileLabel(priv, out) < 0 ||
virSecurityDACRestoreSecurityFileLabel(priv, in) < 0)
goto done;
}
} else if (virSecurityDACRestoreSecurityFileLabel(priv, dev_source->data.file.path) < 0) {
goto done;
}
......@@ -1213,7 +1211,7 @@ virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr,
if (virSecurityDACGetIds(secdef, priv, &user, &group, &groups, &ngroups) < 0)
return -1;
VIR_DEBUG("Dropping privileges of DEF to %u:%u, %d supplemental groups",
VIR_DEBUG("Dropping privileges to %u:%u, %d supplemental groups",
(unsigned int) user, (unsigned int) group, ngroups);
if (virSetUIDGID(user, group, groups, ngroups) < 0)
......@@ -1238,7 +1236,7 @@ virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr,
if (virSecurityDACGetIds(secdef, priv, &user, &group, NULL, NULL))
return -1;
VIR_DEBUG("Setting child to drop privileges of DEF to %u:%u",
VIR_DEBUG("Setting child to drop privileges to %u:%u",
(unsigned int) user, (unsigned int) group);
virCommandSetUID(cmd, user);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册