From: Christian Brauner Date: Tue, 7 Apr 2020 19:28:32 +0000 (+0200) Subject: lxc_user_nic: continue when we failed to find a group X-Git-Tag: lxc-5.0.0~463^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83ddca524fb7808755b55d482c0f48aadda8e271;p=thirdparty%2Flxc.git lxc_user_nic: continue when we failed to find a group Closes #3361. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cmd/lxc_user_nic.c b/src/lxc/cmd/lxc_user_nic.c index 64fbca3e7..edb2d8f03 100644 --- a/src/lxc/cmd/lxc_user_nic.c +++ b/src/lxc/cmd/lxc_user_nic.c @@ -200,13 +200,10 @@ static char **get_groupnames(void) } buf = new_buf; } - if (!grentp) { - if (ret == 0) - usernic_error("%s", "Could not find matched group record\n"); - CMD_SYSERROR("Failed to get group name: %u\n", group_ids[i]); - return NULL; - } + /* If a group is not found, just ignore it. */ + if (!grentp) + continue; groupnames[i] = strdup(grent.gr_name); if (!groupnames[i]) {