From f86a488231dc9a629d44a9f6aa6bfc9aa0eb57b4 Mon Sep 17 00:00:00 2001 From: Squire Date: Fri, 17 Jun 2011 11:05:31 -0700 Subject: CHOP-662 - initial fix to problems with regex characters in Group names causing the LLDirIterator to crash the viewer when opening chat logs --- indra/llvfs/CMakeLists.txt | 1 + indra/llvfs/lldiriterator.cpp | 21 ++++++++--- indra/llvfs/tests/lldiriterator_test.cpp | 62 ++++++++++++++++++++++++++++++++ indra/newview/lllogchat.cpp | 2 +- 4 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 indra/llvfs/tests/lldiriterator_test.cpp (limited to 'indra') diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt index b6d1ce61e5..f89da4d6c5 100644 --- a/indra/llvfs/CMakeLists.txt +++ b/indra/llvfs/CMakeLists.txt @@ -80,6 +80,7 @@ if (LL_TESTS) # UNIT TESTS SET(llvfs_TEST_SOURCE_FILES # none so far + lldiriterator.cpp ) LL_ADD_PROJECT_UNIT_TESTS(llvfs "${llvfs_TEST_SOURCE_FILES}") diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 041436ed92..3b132862ad 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -121,6 +121,14 @@ bool LLDirIterator::Impl::next(std::string &fname) return found; } +/* +converts the incoming glob into a regex. This involves +converting incoming glob expressions to regex equivilents and +at the same time, escaping any regex meaningful characters which +do not have glob meaning, i.e. + .()+|^$ +in the input +*/ std::string glob_to_regex(const std::string& glob) { std::string regex; @@ -135,9 +143,6 @@ std::string glob_to_regex(const std::string& glob) switch (c) { - case '.': - regex+="\\."; - break; case '*': if (glob.begin() == i) { @@ -170,7 +175,15 @@ std::string glob_to_regex(const std::string& glob) case '!': regex+= square_brace_open ? '^' : c; break; - default: + case '.': // This collection have different regex meaning + case '^': // And so need escaping + case '(': + case ')': + case '+': + case '|': + case '$': + regex+='\\'; + default: regex+=c; break; } diff --git a/indra/llvfs/tests/lldiriterator_test.cpp b/indra/llvfs/tests/lldiriterator_test.cpp new file mode 100644 index 0000000000..7c2cd49e41 --- /dev/null +++ b/indra/llvfs/tests/lldiriterator_test.cpp @@ -0,0 +1,62 @@ +/** + * @file lldiriterator_test.cpp + * @date 2011-06 + * @brief LLDirIterator test cases. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only., + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" +#include "lltut.h" +#include "../lldiriterator.h" + + +namespace tut +{ + + struct LLDirIteratorFixture + { + LLDirIteratorFixture() + { + } + }; + typedef test_group LLDirIteratorTest_factory; + typedef LLDirIteratorTest_factory::object LLDirIteratorTest_t; + LLDirIteratorTest_factory tf("LLDirIterator"); + + /* + CHOP-662 was originally introduced to deal with crashes deleting files from + a directory (VWR-25500). However, this introduced a crash looking for + old chat logs as the glob_to_regex function in lldiriterator wasn't escaping lots of regexp characters + */ + void test_chop_662(void) + { + LLDirIterator iter(".","+bad-group-name]+??-??.*"); + } + + template<> template<> + void LLDirIteratorTest_t::test<1>() + { + test_chop_662(); + } + +} \ No newline at end of file diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index efc4e23838..ebb5912ace 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -230,7 +230,7 @@ std::string LLLogChat::makeLogFileName(std::string filename) std::string LLLogChat::cleanFileName(std::string filename) { - std::string invalidChars = "\"\'\\/?*:.<>|"; + std::string invalidChars = "\"\'\\/?*:.<>|[]{}~"; // Cannot match glob or illegal filename chars std::string::size_type position = filename.find_first_of(invalidChars); while (position != filename.npos) { -- cgit v1.2.3 From 29f1b466e66fd5a98926ac7318287c22f74e32bf Mon Sep 17 00:00:00 2001 From: Squire Date: Fri, 17 Jun 2011 14:13:01 -0700 Subject: COP-662 Added newline at end of file for Linux build --- indra/llvfs/tests/lldiriterator_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llvfs/tests/lldiriterator_test.cpp b/indra/llvfs/tests/lldiriterator_test.cpp index 7c2cd49e41..0e7017f59f 100644 --- a/indra/llvfs/tests/lldiriterator_test.cpp +++ b/indra/llvfs/tests/lldiriterator_test.cpp @@ -59,4 +59,4 @@ namespace tut test_chop_662(); } -} \ No newline at end of file +} -- cgit v1.2.3 From 3a25753bcf46cc8d36bcf3d3bf21d9d0d94dbd34 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Fri, 17 Jun 2011 16:16:01 -0700 Subject: STORM-1368 Code more defensively around notecard upload. --- indra/newview/llpreviewnotecard.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 9f3ee6ac5d..4974dde282 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -401,15 +401,14 @@ struct LLSaveNotecardInfo bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) { - if(!gAssetStorage) + LLViewerTextEditor* editor = getChild("Notecard Editor"); + + if(!editor) { - llwarns << "Not connected to an asset storage system." << llendl; + llwarns << "Cannot get handle to the notecard editor." << llendl; return false; } - - LLViewerTextEditor* editor = getChild("Notecard Editor"); - if(!editor->isPristine()) { // We need to update the asset information @@ -436,8 +435,15 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) // save it out to database if (item) { - std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory"); - std::string task_url = gAgent.getRegion()->getCapability("UpdateNotecardTaskInventory"); + const LLViewerRegion* region = gAgent.getRegion(); + if (!region) + { + llwarns << "Not connected to a region, cannot save notecard." << llendl; + return false; + } + std::string agent_url = region->getCapability("UpdateNotecardAgentInventory"); + std::string task_url = region->getCapability("UpdateNotecardTaskInventory"); + if (mObjectUUID.isNull() && !agent_url.empty()) { // Saving into agent inventory @@ -472,6 +478,11 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) (void*)info, FALSE); } + else // !gAssetStorage + { + llwarns << "Not connected to an asset storage system." << llendl; + return false; + } } } return true; -- cgit v1.2.3 From c0971cd0a196dfcf9bd1be9fc2c77c817438c24a Mon Sep 17 00:00:00 2001 From: Squire Date: Fri, 17 Jun 2011 16:46:31 -0700 Subject: CHOP-662 Added booost library to unittest for lldiriterator.cpp --- indra/llvfs/CMakeLists.txt | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt index f89da4d6c5..2c581cf8d6 100644 --- a/indra/llvfs/CMakeLists.txt +++ b/indra/llvfs/CMakeLists.txt @@ -62,11 +62,15 @@ list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES}) add_library (llvfs ${llvfs_SOURCE_FILES}) -target_link_libraries(llvfs +set(vfs_BOOST_LIBRARIES ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ) +target_link_libraries(llvfs + ${vfs_BOOST_LIBRARIES} + ) + if (DARWIN) include(CMakeFindFrameworks) find_library(CARBON_LIBRARY Carbon) @@ -76,16 +80,21 @@ endif (DARWIN) # Add tests if (LL_TESTS) - include(LLAddBuildTest) - # UNIT TESTS - SET(llvfs_TEST_SOURCE_FILES - # none so far - lldiriterator.cpp - ) - LL_ADD_PROJECT_UNIT_TESTS(llvfs "${llvfs_TEST_SOURCE_FILES}") - - # INTEGRATION TESTS - set(test_libs llmath llcommon llvfs ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) - # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. - LL_ADD_INTEGRATION_TEST(lldir "" "${test_libs}") + include(LLAddBuildTest) + # UNIT TESTS + SET(llvfs_TEST_SOURCE_FILES + lldiriterator.cpp + ) + + set_source_files_properties(lldiriterator.cpp + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${vfs_BOOST_LIBRARIES}" + ) + LL_ADD_PROJECT_UNIT_TESTS(llvfs "${llvfs_TEST_SOURCE_FILES}") + + # INTEGRATION TESTS + set(test_libs llmath llcommon llvfs ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) + + # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. + LL_ADD_INTEGRATION_TEST(lldir "" "${test_libs}") endif (LL_TESTS) -- cgit v1.2.3 From ede3b577d8cebd5065514bb485e2cbd93dd5b05a Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 20 Jun 2011 06:11:03 -0400 Subject: increment viewer version to 2.7.5 --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index cfafbf0470..92cd9bd46a 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -29,7 +29,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 7; -const S32 LL_VERSION_PATCH = 4; +const S32 LL_VERSION_PATCH = 5; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3 From 306759835d8aed3a041a59dafaa20a8c708e2dd4 Mon Sep 17 00:00:00 2001 From: Squire Date: Mon, 20 Jun 2011 11:07:17 -0700 Subject: Added more tests to cover the common examples in the crash logs --- indra/llvfs/tests/lldiriterator_test.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llvfs/tests/lldiriterator_test.cpp b/indra/llvfs/tests/lldiriterator_test.cpp index 0e7017f59f..aacc5a616a 100644 --- a/indra/llvfs/tests/lldiriterator_test.cpp +++ b/indra/llvfs/tests/lldiriterator_test.cpp @@ -50,7 +50,10 @@ namespace tut */ void test_chop_662(void) { + // Check a selection of bad group names from the crash reports LLDirIterator iter(".","+bad-group-name]+??-??.*"); + LLDirIterator iter(".","))--@---bad-group-name2((??-??.*\.txt"); + LLDirIterator iter(".","__^v--x)Cuide d sua vida(x--v^__??-??.*"); } template<> template<> -- cgit v1.2.3 From 47c49b5bc564675b4e4b5c21f3c5ea0005980ae6 Mon Sep 17 00:00:00 2001 From: eli_linden Date: Mon, 20 Jun 2011 11:22:02 -0700 Subject: sync with viewer-development --- .../skins/default/xui/en/floater_model_preview.xml | 16 ++++++++++++++++ .../skins/default/xui/en/floater_model_wizard.xml | 4 +++- indra/newview/skins/default/xui/en/floater_tools.xml | 11 ++++------- indra/newview/skins/default/xui/en/notifications.xml | 4 +++- 4 files changed, 26 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index dce55dae12..f58595b3c5 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -4,9 +4,11 @@ name="Model Preview" title="Upload Model" width="620"> Idle + Dae parsing issue - see log for details. Loading... Generating Meshes... Error: Vertex number is more than 65534, aborted! + Error: element is invalid High Medium Low @@ -83,6 +85,20 @@ + + + I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more] [STATUS] diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml index 47b2e5fd79..8603682e3a 100644 --- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml @@ -1019,9 +1019,11 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se Idle + Dae parsing issue - see log for details. Loading... Generating Meshes... - Error: Vertex number is more than 65534, aborted! + Error: Vertex number is more than 65534, aborted! + Error: element is invalid High Medium Low diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 40bf7bfed7..7441b2cd9c 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2098,11 +2098,7 @@ even though the user gets a free copy. label="Cylinder" name="Cylinder" value="Cylinder" /> - - + - [LABEL] failed to upload: [MESSAGE] [IDENTIFIER] [INVALIDITY_IDENTIFIER] + [LABEL] failed to upload: [MESSAGE] [IDENTIFIER] + +See the log file for details. Date: Mon, 20 Jun 2011 12:17:25 -0700 Subject: CHOP-662 Coupl of fixes to extended unit-test --- indra/llvfs/tests/lldiriterator_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llvfs/tests/lldiriterator_test.cpp b/indra/llvfs/tests/lldiriterator_test.cpp index aacc5a616a..505d86faa7 100644 --- a/indra/llvfs/tests/lldiriterator_test.cpp +++ b/indra/llvfs/tests/lldiriterator_test.cpp @@ -52,8 +52,8 @@ namespace tut { // Check a selection of bad group names from the crash reports LLDirIterator iter(".","+bad-group-name]+??-??.*"); - LLDirIterator iter(".","))--@---bad-group-name2((??-??.*\.txt"); - LLDirIterator iter(".","__^v--x)Cuide d sua vida(x--v^__??-??.*"); + LLDirIterator iter1(".","))--@---bad-group-name2((??-??.*\\.txt"); + LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__??-??.*"); } template<> template<> -- cgit v1.2.3 From 6977c09a88f5591c135df2f8f37eaa544402e69a Mon Sep 17 00:00:00 2001 From: eli_linden Date: Tue, 21 Jun 2011 11:58:54 -0700 Subject: FIX VWR-25071 --- .../newview/skins/default/xui/ja/floater_tools.xml | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml index b29f744a68..f7d77d351e 100644 --- a/indra/newview/skins/default/xui/ja/floater_tools.xml +++ b/indra/newview/skins/default/xui/ja/floater_tools.xml @@ -74,8 +74,8 @@ 両側を延ばす - - + + @@ -137,7 +137,7 @@ 料金: [COST] / [PHYSICS] - + 譲渡 @@ -379,22 +379,22 @@ オブジェクトの特徴を編集: - - - - - - - - + + + + + + + + - + - + - + - + 実像の種類: @@ -496,18 +496,18 @@ - -- cgit v1.2.3 From 44308a50c2389b3d021d5f6bfa125b06f1b643d1 Mon Sep 17 00:00:00 2001 From: eli_linden Date: Fri, 24 Jun 2011 11:09:26 -0700 Subject: sync with viewer-development --- indra/newview/skins/default/xui/en/panel_cof_wearables.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml index bbeb592e96..9e70706603 100644 --- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml +++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml @@ -52,7 +52,7 @@ multi_select="true" name="list_attachments" top="0" - width="311"> + width="311"/> Date: Mon, 27 Jun 2011 11:51:06 -0400 Subject: storm-1444: Disable mesh loading --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 76fecdf05e..594285b92b 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5576,7 +5576,7 @@ Type Boolean Value - 1 + 0 MeshImportUseSLM -- cgit v1.2.3