mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
extensions: shell: Check for socket path ownership (#3109)
This commit is contained in:
parent
3ecf1d28b8
commit
0ac90e75fa
@ -273,7 +273,10 @@ void initShellSocket(const std::string& homedir) {
|
||||
(fs::path(homedir) / "shell.em").make_preferred().string();
|
||||
}
|
||||
|
||||
if (extensionPathActive(FLAGS_extensions_socket, false)) {
|
||||
if (extensionPathActive(FLAGS_extensions_socket, false) ||
|
||||
!socketExists(FLAGS_extensions_socket, true)) {
|
||||
// If there is an existing shell using this socket, or the socket cannot
|
||||
// be used (another user using the same path?)
|
||||
FLAGS_extensions_socket += std::to_string((uint16_t)rand());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user