-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Bug report
What operating system and version are you using?
+----------+-------+----------+
| version | build | platform |
+----------+-------+----------+
| 6.1.7601 | 7601 | windows |
+----------+-------+----------+
What version of osquery are you using?
+---------+
| version |
+---------+
| 4.9.0 |
+---------+
What steps did you take to reproduce the issue?
ran osquery with two extensions using --extensions_require=extension1,extension2 --timeout=10
What did you expect to see?
Osquery wait a maximum of 10 seconds for all extensions to be loaded
What did you see instead?
Osquery failed to load all extensions with:
E An error occurred during extension manager startup: Required extension not found or not loaded: extension2
after less then 3 seconds.
It looks like in startExtensionManager in "osquery\osquery\extensions\extensions.cpp", after the first extension in the extensions_require list is loaded, all following extensions will be reported as failed to load after the first loop in applyExtensionDelay. This is because the waited bool is set to true after the first extension is checked, regardless of if it hit the FLAGS_extensions_timeout.
Also, rather than the FLAGS_extensions_timeout being the amount of time that all extensions are given to load, which seems to be what the waited bool is checking for, the applyExtensionDelay method resets the delay which is compared against the FLAGS_extensions_timeout for each extension. This could cause startExtensionManager to wait longer that the given timeout for all extensions to load.