Skip to content

Commit

Permalink
Do additional flag incompatibility check
Browse files Browse the repository at this point in the history
Summary:
User could have requested install and uninstall of osqueryd service together. However it does not make sense and actually osquery would only install the service.
This additional check, will exit osquery in case when install and uninstall are requested together.

Reviewed By: jessek

Differential Revision: D14622634

fbshipit-source-id: b88dc519bd1ef38653eb1660712bbf2e75bad36f
  • Loading branch information
George Guliashvili authored and facebook-github-bot committed Mar 26, 2019
1 parent 3f07c87 commit 85eb77a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions osquery/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ int startOsquery(int argc, char* argv[], std::function<void()> shutdown) {
osquery::Initializer runner(argc, argv, osquery::ToolType::SHELL_DAEMON);

// Options for installing or uninstalling the osqueryd as a service
if (FLAGS_install && FLAGS_uninstall) {
LOG(ERROR) << "osqueryd service install and uninstall can not be "
"requested together";
return 1;
}

if (FLAGS_install) {
auto binPath = fs::system_complete(fs::path(argv[0]));
if (!installService(binPath.string())) {
Expand Down

0 comments on commit 85eb77a

Please sign in to comment.