diff --git a/src/init.cpp b/src/init.cpp index 4caf574c..e76f176e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1036,7 +1036,7 @@ bool AppInit2() std::string strDataDir = GetDataDir().string(); #ifdef ENABLE_WALLET // Wallet file must be a plain filename without a directory - if (strWalletFile != boost::filesystem::basename(strWalletFile) + boost::filesystem::extension(strWalletFile)) + if (strWalletFile != boost::filesystem::path(strWalletFile).filename().string()) return InitError(strprintf(_("Wallet %s resides outside data directory %s"), strWalletFile, strDataDir)); #endif // Make sure only a single Agrarian process is using the data directory. diff --git a/src/rpc/protocol.cpp b/src/rpc/protocol.cpp index 6d6dbf41..754af1e3 100644 --- a/src/rpc/protocol.cpp +++ b/src/rpc/protocol.cpp @@ -74,7 +74,7 @@ static const std::string COOKIEAUTH_FILE = ".cookie"; boost::filesystem::path GetAuthCookieFile() { boost::filesystem::path path(GetArg("-rpccookiefile", COOKIEAUTH_FILE)); - if (!path.is_complete()) path = GetDataDir() / path; + if (!path.is_absolute()) path = GetDataDir() / path; return path; } diff --git a/src/util.cpp b/src/util.cpp index 2976e3dc..d5391dba 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -478,7 +478,7 @@ void ClearDatadirCache() boost::filesystem::path GetConfigFile() { boost::filesystem::path pathConfigFile(GetArg("-conf", "agrarian.conf")); - if (!pathConfigFile.is_complete()) + if (!pathConfigFile.is_absolute()) pathConfigFile = GetDataDir(false) / pathConfigFile; return pathConfigFile; @@ -487,7 +487,7 @@ boost::filesystem::path GetConfigFile() boost::filesystem::path GetMasternodeConfigFile() { boost::filesystem::path pathConfigFile(GetArg("-mnconf", "masternode.conf")); - if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir() / pathConfigFile; + if (!pathConfigFile.is_absolute()) pathConfigFile = GetDataDir() / pathConfigFile; return pathConfigFile; } @@ -523,7 +523,7 @@ void ReadConfigFile(map& mapSettingsRet, boost::filesystem::path GetPidFile() { boost::filesystem::path pathPidFile(GetArg("-pid", "agrariand.pid")); - if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile; + if (!pathPidFile.is_absolute()) pathPidFile = GetDataDir() / pathPidFile; return pathPidFile; } diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index fccf8821..0ae1e4f3 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -1077,7 +1077,7 @@ bool AttemptBackupWallet(const CWallet& wallet, const filesystem::path& pathSrc, return false; } #if BOOST_VERSION >= 105800 /* BOOST_LIB_VERSION 1_58 */ - filesystem::copy_file(pathSrc.c_str(), pathDest, filesystem::copy_option::overwrite_if_exists); + filesystem::copy_file(pathSrc.c_str(), pathDest, filesystem::copy_options::overwrite_existing); #else std::ifstream src(pathSrc.c_str(), std::ios::binary | std::ios::in); std::ofstream dst(pathDest.c_str(), std::ios::binary | std::ios::out | std::ios::trunc);