#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
-#include <boost/regex.hpp>
+#include <boost/system/error_code.hpp>
#include <unistd.h>
#include <sys/types.h>
#include <common/request.h>
#include <common/utils/user_util.h>
+#include <regex>
#include <string>
#include <iostream>
namespace bf = boost::filesystem;
+namespace bs = boost::system;
namespace ci = common_installer;
namespace {
for (bf::directory_iterator iter(recovery_dir);
iter != bf::directory_iterator();
++iter) {
- if (bf::is_directory(iter->path()))
+ bs::error_code error;
+ if (bf::is_directory(iter->path(), error))
continue;
std::string file = iter->path().filename().string();
- boost::regex recovery_regex(kRecoveryFilePattern);
- boost::smatch match;
- if (boost::regex_match(file, match, recovery_regex)) {
+ std::regex recovery_regex(kRecoveryFilePattern);
+ std::smatch match;
+ if (std::regex_search(file, match, recovery_regex)) {
LOG(INFO) << "Found recovery file: " << file;
std::string type(match[1]);
if (!RequestRecoveryService(uid, type.c_str(), iter->path().c_str()))
uid_t uid = getuid();
DoRecoveryProcess(uid);
if (ci::IsAdminUser(uid))
- DoRecoveryProcess(tzplatform_getuid(TZ_SYS_GLOBALAPP_USER));
+ DoRecoveryProcess(kGlobalUserUid);
return 0;
}