coverity: #1427191

parent b21da190
...@@ -2657,6 +2657,7 @@ int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf, ...@@ -2657,6 +2657,7 @@ int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf,
return -1; return -1;
} }
if (fd >= 0) {
buflen = sizeof("deny\n") - 1; buflen = sizeof("deny\n") - 1;
errno = 0; errno = 0;
ret = lxc_write_nointr(fd, "deny\n", buflen); ret = lxc_write_nointr(fd, "deny\n", buflen);
...@@ -2667,6 +2668,7 @@ int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf, ...@@ -2667,6 +2668,7 @@ int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf,
} }
close(fd); close(fd);
} }
}
ret = snprintf(path, MAXPATHLEN, "/proc/%d/%cid_map", pid, ret = snprintf(path, MAXPATHLEN, "/proc/%d/%cid_map", pid,
idtype == ID_TYPE_UID ? 'u' : 'g'); idtype == ID_TYPE_UID ? 'u' : 'g');
......
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