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
1 changed files with 1 additions and 5 deletions
|
@ -103,6 +103,7 @@ protected:
|
|||
|
||||
struct Connection
|
||||
{
|
||||
AutoCloseFD fd;
|
||||
FdSink to;
|
||||
FdSource from;
|
||||
unsigned int daemonVersion;
|
||||
|
@ -140,11 +141,6 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
struct Connection : RemoteStore::Connection
|
||||
{
|
||||
AutoCloseFD fd;
|
||||
};
|
||||
|
||||
ref<RemoteStore::Connection> openConnection() override;
|
||||
std::experimental::optional<std::string> path;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue