提交 2b720018 编写于 作者: L Laszlo Ersek 提交者: Michael Roth

qga: unlink just created guest-file if fchmod() or fdopen() fails on it

We shouldn't allow guest filesystem pollution on error paths.
Suggested-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 8fe6bbca
......@@ -355,6 +355,9 @@ safe_open_or_create(const char *path, const char *mode, Error **err)
}
close(fd);
if (oflag & O_CREAT) {
unlink(path);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册