钢铁侠
11/16/2018, 6:39 AMvoid genShellHistoryForUser(const std::string& uid,
const std::string& gid,
const std::string& directory,
QueryData& results) {
auto dropper = DropPrivileges::get();
if (!dropper->dropTo(uid, gid)) {
VLOG(1) << "Cannot drop privileges to UID " << uid;
return;
}
for (const auto& hfile : kShellHistoryFiles) {
boost::filesystem::path history_file = directory;
history_file /= hfile;
genShellHistoryFromFile(uid, history_file, results);
}
}
I am seeing the osquery source code,But I have a question about the genShellHistoryForUser. what's the meaning of dropTo(uid, gid)?Is there any security problem if we don't drop Privileges?