提交 8e1336fe 编写于 作者: C Chen Hanxiao 提交者: Daniel P. Berrange

Skip debug message in lxcContainerSetID if no map is set.

The lxcContainerSetID() method prints a misleading log
message about setting the uid/gid when no ID map is
present in the XML config. Skip the debug message in
this case.
Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
上级 b695aeeb
......@@ -420,9 +420,11 @@ static int lxcContainerSetID(virDomainDefPtr def)
* for this container. And user namespace is only enabled
* when nuidmap&ngidmap is not zero */
VIR_DEBUG("Set UID/GID to 0/0");
if (def->idmap.nuidmap &&
virSetUIDGID(0, 0, NULL, 0) < 0) {
if (!def->idmap.nuidmap)
return 0;
VIR_DEBUG("Setting UID/GID to 0/0");
if (virSetUIDGID(0, 0, NULL, 0) < 0) {
virReportSystemError(errno, "%s",
_("setuid or setgid failed"));
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册