Get rid of UDSRemoteStore::Connection
Since its superclass RemoteStore::Connection contains 'to' and 'from' fields that refer to the file descriptor maintained in the subclass, it was possible for the flush() call in Connection::~Connection() to write to a closed file descriptor (or worse, a file descriptor now referencing another file). So make sure that the file descriptor survives 'to' and 'from'.
This commit is contained in:
parent
9617a04354
commit
ba51100d64
|
@ -103,6 +103,7 @@ protected:
|
||||||
|
|
||||||
struct Connection
|
struct Connection
|
||||||
{
|
{
|
||||||
|
AutoCloseFD fd;
|
||||||
FdSink to;
|
FdSink to;
|
||||||
FdSource from;
|
FdSource from;
|
||||||
unsigned int daemonVersion;
|
unsigned int daemonVersion;
|
||||||
|
@ -140,11 +141,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct Connection : RemoteStore::Connection
|
|
||||||
{
|
|
||||||
AutoCloseFD fd;
|
|
||||||
};
|
|
||||||
|
|
||||||
ref<RemoteStore::Connection> openConnection() override;
|
ref<RemoteStore::Connection> openConnection() override;
|
||||||
std::experimental::optional<std::string> path;
|
std::experimental::optional<std::string> path;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue