#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
enum Kind { … };
bool isRootChanged(intptr_t k) { … }
class ChrootChecker : public Checker<eval::Call, check::PreCall> { … };
}
bool ChrootChecker::evalCall(const CallEvent &Call, CheckerContext &C) const { … }
void ChrootChecker::evalChroot(const CallEvent &Call, CheckerContext &C) const { … }
void ChrootChecker::evalChdir(const CallEvent &Call, CheckerContext &C) const { … }
void ChrootChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void ento::registerChrootChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterChrootChecker(const CheckerManager &mgr) { … }