Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows/certificates: Fix bug in environment variable expansion #5697

Merged
merged 4 commits into from
Aug 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Explicitly handle when getUserHomeDir returns empty
  • Loading branch information
offlinemark committed Aug 8, 2019
commit b2199ddc403c1342de039a27ad566c3a63ea789f
5 changes: 5 additions & 0 deletions osquery/tables/system/windows/certificates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ void findUserPersonalCertsOnDisk(const std::string& username,

std::string homeDir;
auto homeDirUnexpanded = getUserHomeDir(sid);
if (homeDirUnexpanded.empty()) {
VLOG(1) << "Could not find home dir for account " << username;
return;
}

// System accounts have environment variables in their paths
auto ret = expandEnvironmentVariables(homeDirUnexpanded, homeDir);
if (!ret.ok() || homeDir.empty()) {
Expand Down