mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 21:45:21 +00:00
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: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
parent
b695aeebd5
commit
8e1336fea9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user