提交 f05fb6c5 编写于 作者: M Michal Privoznik

util: Don't overflow on errno in virFileAccessibleAs

If we need to virFork() to check assess() under different
UID+GID we need to translate returned status via WEXITSTATUS().
Otherwise, we may return values greater than 255 which is
obviously wrong.
上级 96b41f63
......@@ -724,8 +724,13 @@ virFileAccessibleAs(const char *path, int mode,
return -1;
}
if (!WIFEXITED(status)) {
errno = EINTR;
return -1;
}
if (status) {
errno = status;
errno = WEXITSTATUS(status);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册