coverity: #1427191

parent b21da190
...@@ -2657,15 +2657,17 @@ int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf, ...@@ -2657,15 +2657,17 @@ int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf,
return -1; return -1;
} }
buflen = sizeof("deny\n") - 1; if (fd >= 0) {
errno = 0; buflen = sizeof("deny\n") - 1;
ret = lxc_write_nointr(fd, "deny\n", buflen); errno = 0;
if (ret != buflen) { ret = lxc_write_nointr(fd, "deny\n", buflen);
SYSERROR("Failed to write \"deny\" to \"/proc/%d/setgroups\"", pid); if (ret != buflen) {
SYSERROR("Failed to write \"deny\" to \"/proc/%d/setgroups\"", pid);
close(fd);
return -1;
}
close(fd); close(fd);
return -1;
} }
close(fd);
} }
ret = snprintf(path, MAXPATHLEN, "/proc/%d/%cid_map", pid, ret = snprintf(path, MAXPATHLEN, "/proc/%d/%cid_map", pid,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment