From cfbc2028ef31f4e4b2a70775f2c330f57108396a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 14 Nov 2016 20:13:18 +0200 Subject: MAINT-6920 More information in About Second Life floater --- indra/llvfs/llvfs.cpp | 11 +++++++++++ indra/llvfs/llvfs.h | 1 + 2 files changed, 12 insertions(+) (limited to 'indra/llvfs') diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index 1cc0e819db..db0eac7031 100644 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -2114,6 +2114,17 @@ void LLVFS::dumpFiles() LL_INFOS() << "Extracted " << files_extracted << " files out of " << mFileBlocks.size() << LL_ENDL; } +time_t LLVFS::creationTime() +{ + llstat data_file_stat; + int errors = LLFile::stat(mDataFilename, &data_file_stat); + if (0 == errors) + { + return data_file_stat.st_ctime; + } + return 0; +} + //============================================================================ // protected //============================================================================ diff --git a/indra/llvfs/llvfs.h b/indra/llvfs/llvfs.h index 39f31a221b..dca5ff4ad5 100644 --- a/indra/llvfs/llvfs.h +++ b/indra/llvfs/llvfs.h @@ -127,6 +127,7 @@ public: void dumpStatistics(); void listFiles(); void dumpFiles(); + time_t creationTime(); protected: void removeFileBlock(LLVFSFileBlock *fileblock); -- cgit v1.2.3 From d4d56f004a528ea0cada526132dd77bd410a8fe7 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 19 Apr 2017 21:19:04 +0300 Subject: MAINT-7074 Fixed ability to escape from skin directory with --- indra/llvfs/lldir.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/llvfs') diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 86a15f2ef2..924e1166ee 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -720,6 +720,15 @@ std::vector LLDir::findSkinnedFilenames(const std::string& subdir, << ((constraint == CURRENT_SKIN)? "CURRENT_SKIN" : "ALL_SKINS") << LL_ENDL; + // Build results vector. + std::vector results; + // Disallow filenames that may escape subdir + if (filename.find("..") != std::string::npos) + { + LL_WARNS("LLDir") << "Ignoring potentially relative filename '" << filename << "'" << LL_ENDL; + return results; + } + // Cache the default language directory for each subdir we've encountered. // A cache entry whose value is the empty string means "not localized, // don't bother checking again." @@ -784,8 +793,6 @@ std::vector LLDir::findSkinnedFilenames(const std::string& subdir, } } - // Build results vector. - std::vector results; // The process we use depends on 'constraint'. if (constraint != CURRENT_SKIN) // meaning ALL_SKINS { -- cgit v1.2.3 From bb8609fa9408f206142b5c67983c7d0fd1876b19 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 25 May 2017 18:09:52 +0300 Subject: MAINT-5100 Fixed viewer not finding sky files at login --- indra/llvfs/lldiriterator.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llvfs') diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 76296ff877..3eb64e69d9 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -51,7 +51,11 @@ private: LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) : mIsValid(false) { +#ifdef LL_WINDOWS // or BOOST_WINDOWS_API + fs::path dir_path(utf8str_to_utf16str(dirname)); +#else fs::path dir_path(dirname); +#endif bool is_dir = false; -- cgit v1.2.3 From 83e7b7a9399ac3f4979d9bb11ea98b9dac77c986 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 18 Aug 2017 20:23:06 +0300 Subject: MAINT-7691 Fixed cache not clearing correctly and incapability to find dump files in case of unicode path --- indra/llvfs/lldir.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/llvfs') diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 924e1166ee..b845de71fa 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -104,8 +104,13 @@ LLDir::~LLDir() std::vector LLDir::getFilesInDir(const std::string &dirname) { //Returns a vector of fullpath filenames. - - boost::filesystem::path p (dirname); + +#ifdef LL_WINDOWS // or BOOST_WINDOWS_API + boost::filesystem::path p(utf8str_to_utf16str(dirname)); +#else + boost::filesystem::path p(dirname); +#endif + std::vector v; if (exists(p)) @@ -193,7 +198,12 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { - boost::filesystem::path dir_path(dir_name); +#ifdef LL_WINDOWS // or BOOST_WINDOWS_API + boost::filesystem::path dir_path(utf8str_to_utf16str(dir_name)); +#else + boost::filesystem::path dir_path(dir_name); +#endif + if (boost::filesystem::exists (dir_path)) { if (!boost::filesystem::is_empty (dir_path)) -- cgit v1.2.3