jmpsec / osctrl

Fast and efficient osquery management
https://osctrl.net
MIT License
371 stars 50 forks source link

dbFlag & apiFlag incorrectly set on osctrl-cli env quick-add #469

Closed peterbogdan closed 1 month ago

peterbogdan commented 1 month ago

Hello

Looks like the dbFlag and apiFlag are incorrectly set when calling osctrl-cli env quick-add here

Looking at the code this action queries the DB but looks like apiFlag is set to true and dbFlag should be set instead.

Could not figure out where in the code this is happening to create a PR. I can see that the quick-add wrapper is set here but I do not see any reference to this flags so not sure where they are inherited from.

Durring some testing I presume some other commands (like osctrl-cli settings show) have this problem also because they result in a panic error: panic: runtime error: invalid memory address or nil pointer dereference

javuto commented 1 month ago

Implemented in #476