From 52b64bcfd7292cb2013ec959d646ba0a01d58a79 Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Mon, 31 Oct 2022 14:17:05 -0700 Subject: [PATCH 1/9] Fix SL-18511 TOS and MFA login failure handlers must cooperate to answer both reasons at the same time --- indra/newview/lllogininstance.cpp | 86 +++++++++++++++++++------------ indra/newview/lllogininstance.h | 1 + 2 files changed, 53 insertions(+), 34 deletions(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 82ecfbd4dc..dd8c9b2dde 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -451,26 +451,8 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) LLSD args(llsd::map( "MESSAGE", LLTrans::getString(response["message_id"]) )); LLSD payload; - LLNotificationsUtil::add("PromptMFAToken", args, payload, [=](LLSD const & notif, LLSD const & response) { - bool continue_clicked = response["continue"].asBoolean(); - std::string token = response["token"].asString(); - LL_DEBUGS("LLLogin") << "PromptMFAToken: response: " << response << " continue_clicked" << continue_clicked << LL_ENDL; - - // strip out whitespace - SL-17034/BUG-231938 - token = boost::regex_replace(token, boost::regex("\\s"), ""); - - if (continue_clicked && !token.empty()) - { - LL_INFOS("LLLogin") << "PromptMFAToken: token submitted" << LL_ENDL; - - // Set the request data to true and retry login. - mRequestData["params"]["token"] = token; - reconnect(); - } else { - LL_INFOS("LLLogin") << "PromptMFAToken: no token, attemptComplete" << LL_ENDL; - attemptComplete(); - } - }); + LLNotificationsUtil::add("PromptMFAToken", args, payload, + boost::bind(&LLLoginInstance::handleMFAChallenge, this, _1, _2)); } else if( reason_response == "key" || reason_response == "presence" @@ -547,23 +529,59 @@ void LLLoginInstance::handleIndeterminate(const LLSD& event) bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key) { - if(accepted) - { - LL_INFOS("LLLogin") << "LLLoginInstance::handleTOSResponse: accepted" << LL_ENDL; + if(accepted) + { + LL_INFOS("LLLogin") << "LLLoginInstance::handleTOSResponse: accepted " << LL_ENDL; - // Set the request data to true and retry login. - mRequestData["params"][key] = true; - reconnect(); - } - else - { - LL_INFOS("LLLogin") << "LLLoginInstance::handleTOSResponse: attemptComplete" << LL_ENDL; + // Set the request data to true and retry login. + mRequestData["params"][key] = true; - attemptComplete(); - } + if (!mRequestData["params"]["token"].asString().empty()) + { + // SL-18511 this TOS failure happened while we are in the middle of an MFA challenge/response. + // the previously entered token is very likely expired, so prompt again + LLSD args(llsd::map( "MESSAGE", LLTrans::getString("LoginFailedAuthenticationMFARequired") )); + LLSD payload; + LLNotificationsUtil::add("PromptMFAToken", args, payload, + boost::bind(&LLLoginInstance::handleMFAChallenge, this, _1, _2)); + } + else + { + reconnect(); + } + } + else + { + LL_INFOS("LLLogin") << "LLLoginInstance::handleTOSResponse: attemptComplete" << LL_ENDL; - LLEventPumps::instance().obtain(TOS_REPLY_PUMP).stopListening(TOS_LISTENER_NAME); - return true; + attemptComplete(); + } + + LLEventPumps::instance().obtain(TOS_REPLY_PUMP).stopListening(TOS_LISTENER_NAME); + return true; +} + +bool LLLoginInstance::handleMFAChallenge(LLSD const & notif, LLSD const & response) +{ + bool continue_clicked = response["continue"].asBoolean(); + std::string token = response["token"].asString(); + LL_DEBUGS("LLLogin") << "PromptMFAToken: response: " << response << " continue_clicked" << continue_clicked << LL_ENDL; + + // strip out whitespace - SL-17034/BUG-231938 + token = boost::regex_replace(token, boost::regex("\\s"), ""); + + if (continue_clicked && !token.empty()) + { + LL_INFOS("LLLogin") << "PromptMFAToken: token submitted" << LL_ENDL; + + // Set the request data to true and retry login. + mRequestData["params"]["token"] = token; + reconnect(); + } else { + LL_INFOS("LLLogin") << "PromptMFAToken: no token, attemptComplete" << LL_ENDL; + attemptComplete(); + } + return true; } std::string construct_start_string() diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index b759b43474..ee3ef0e4b1 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -84,6 +84,7 @@ private: void syncWithUpdater(ResponsePtr resp, const LLSD& notification, const LLSD& response); bool handleTOSResponse(bool v, const std::string& key); + bool handleMFAChallenge(LLSD const & notif, LLSD const & response); void attemptComplete() { mAttemptComplete = true; } // In the future an event? From 7b3dcfba3c97f7472087687a74bab5c581d2b68f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 1 Nov 2022 16:14:56 +0100 Subject: [PATCH 2/9] Fix nullpointer guard --- indra/newview/llpanelprofile.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 1b0b25629f..49f7c20798 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1064,7 +1064,7 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) #else if (own_profile) #endif -// +// { mImageActionMenuButton->setVisible(TRUE); mImageActionMenuButton->setMenu("menu_fs_profile_image_actions.xml", LLMenuButton::MP_BOTTOM_RIGHT); @@ -1113,11 +1113,11 @@ void LLPanelProfileSecondLife::updateData() else { // restore UDP profiles for opensim that does not support the cap -#ifdef OPENSIM +#ifdef OPENSIM if (LLGridManager::instance().isInOpenSim() && !(getSelfProfile() /* TODO(Beq):No longer neeed? && !getEmbedded()*/)) { LLAvatarPropertiesProcessor::getInstance()->sendAvatarGroupsRequest(avatar_id); - } + } else #endif // @@ -1138,7 +1138,7 @@ void LLPanelProfileSecondLife::refreshName() void LLPanelProfileSecondLife::apply(LLAvatarData* data) { #ifdef OPENSIM - if (LLGridManager::instance().isInOpenSim() && getIsLoaded() && getSelfProfile()) + if (LLGridManager::instance().isInOpenSim() && getIsLoaded() && getSelfProfile()) { data->image_id = mImageId; data->about_text = mDescriptionEdit->getValue().asString(); @@ -1262,9 +1262,10 @@ void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avat fillPartnerData(avatar_data); fillAccountStatus(avatar_data); + // Restore UDP profiles #ifdef OPENSIM - if (LLGridManager::instance().isInOpenSim()) + if (LLGridManager::instance().isInOpenSim()) { LLFloater* floater_profile = LLFloaterReg::findInstance("profile", LLSD().with("id", avatar_id)); if (!floater_profile) @@ -1272,13 +1273,16 @@ void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avat // floater is dead, so panels are dead as well return; } - LLPanel *panel = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); - auto *panel_profile = dynamic_cast(panel); - if (!panel_profile) + LLPanel* panel = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); + auto* panel_profile = dynamic_cast(panel); + if (panel_profile) + { + panel_profile->setAvatarData(avatar_data); + } + else { LL_WARNS() << PANEL_PROFILE_VIEW << " not found" << LL_ENDL; - } - panel_profile->setAvatarData(avatar_data); + } } #endif // From c047a29b1ea6021d519da40ce36e93d197069ee0 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 1 Nov 2022 16:16:12 +0100 Subject: [PATCH 3/9] Actually simplify this --- indra/newview/llpanelprofile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 49f7c20798..49a114b195 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1273,8 +1273,7 @@ void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avat // floater is dead, so panels are dead as well return; } - LLPanel* panel = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); - auto* panel_profile = dynamic_cast(panel); + LLPanelProfile* panel_profile = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); if (panel_profile) { panel_profile->setAvatarData(avatar_data); From 492a208b75b703366e1e2878a8b360f910d0d0d3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 1 Nov 2022 16:21:27 +0100 Subject: [PATCH 4/9] More simplifications --- indra/newview/llpanelprofile.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 49a114b195..3a2f16cc52 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -2245,8 +2245,7 @@ void LLPanelProfileSecondLife::onSaveDescriptionChanges() // floater is dead, so panels are dead as well return; } - LLPanel *panel = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); - auto *panel_profile = dynamic_cast(panel); + LLPanelProfile* panel_profile = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); if (!panel_profile) { LL_WARNS() << PANEL_PROFILE_VIEW << " not found" << LL_ENDL; @@ -2262,7 +2261,7 @@ void LLPanelProfileSecondLife::onSaveDescriptionChanges() LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&avatar_data); } - } + } } #endif // @@ -2482,7 +2481,7 @@ void LLPanelProfileSecondLife::onCommitProfileImage(const LLUUID& id) else { // Make OpenSim profiles work again -#ifdef OPENSIM +#ifdef OPENSIM if(LLGridManager::getInstance()->isInOpenSim()) { mImageId = id; @@ -2572,6 +2571,7 @@ void LLPanelProfileWeb::apply(LLAvatarData* data) } #endif // + void LLPanelProfileWeb::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { mAvatarNameCacheConnection.disconnect(); @@ -2869,7 +2869,7 @@ void LLPanelProfileFirstLife::onCommitPhoto(const LLUUID& id) else { // Make OpenSim profiles work again -#ifdef OPENSIM +#ifdef OPENSIM if(LLGridManager::getInstance()->isInOpenSim()) { mImageId = id; @@ -2925,8 +2925,7 @@ void LLPanelProfileFirstLife::onSaveDescriptionChanges() // floater is dead, so panels are dead as well return; } - LLPanel *panel = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); - auto *panel_profile = dynamic_cast(panel); + LLPanelProfile* panel_profile = floater_profile->findChild(PANEL_PROFILE_VIEW, TRUE); if (!panel_profile) { LL_WARNS() << PANEL_PROFILE_VIEW << " not found" << LL_ENDL; @@ -2941,7 +2940,7 @@ void LLPanelProfileFirstLife::onSaveDescriptionChanges() LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&avatar_data); } - } + } } #endif // @@ -3015,7 +3014,7 @@ void LLPanelProfileFirstLife::resetData() auto show_image_buttons = getSelfProfile(); #ifdef OPENSIM std::string cap_url = gAgent.getRegionCapability(PROFILE_IMAGE_UPLOAD_CAP); - if( cap_url.empty() && LLGridManager::instance().isInOpenSim() ) + if (cap_url.empty() && LLGridManager::instance().isInOpenSim()) { show_image_buttons = false; } @@ -3069,10 +3068,10 @@ void LLPanelProfileNotes::updateData() boost::bind(request_avatar_properties_coro, cap_url, avatar_id)); } // Restore UDO profiles -#ifdef OPENSIM +#ifdef OPENSIM else { - LLAvatarPropertiesProcessor::getInstance()->sendAvatarNotesRequest(avatar_id); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarNotesRequest(avatar_id); } #endif // @@ -3273,7 +3272,7 @@ void LLPanelProfile::updateData() // Restore UDP profiles else { - LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(avatar_id); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(avatar_id); } // } From d5bc1d996a85398de5eefe142870a345b3e30cd7 Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 1 Nov 2022 15:27:17 +0000 Subject: [PATCH 5/9] [FIRE-32218] [Local Mesh] Crash when creating surrogate mesh after closing local mesh floater don't rely on cached this pointer in the callback. Use the explictly stored floater_pointer instead --- indra/newview/vjfloaterlocalmesh.cpp | 57 +++++++++++++++------------- indra/newview/vjlocalmesh.h | 1 + 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/indra/newview/vjfloaterlocalmesh.cpp b/indra/newview/vjfloaterlocalmesh.cpp index 786119281d..b2d672af17 100644 --- a/indra/newview/vjfloaterlocalmesh.cpp +++ b/indra/newview/vjfloaterlocalmesh.cpp @@ -367,12 +367,10 @@ bool LLFloaterLocalMesh::processPrimCreated(LLViewerObject* object) // Select the new object LLSelectMgr::getInstance()->selectObjectAndFamily(object, TRUE); - update_selected_target( object->getID() ); // LLUUID local_id{"aee92334-90e9-110b-7c03-0ff3bc19de63"}; LLUUID local_id{}; - auto* volp = object->getVolume(); if(!volp) { @@ -393,37 +391,42 @@ bool LLFloaterLocalMesh::processPrimCreated(LLViewerObject* object) { return false; } - auto scroll_ctrl_selected_item = this->mScrollCtrl->getFirstSelected(); - if(!scroll_ctrl_selected_item){return true;}; // at this point we have a valid object even if we can't fill it. - auto scroll_ctrl_selected_column = scroll_ctrl_selected_item->getColumn(LOCAL_TRACKING_ID_COLUMN); - if(!scroll_ctrl_selected_column){return true;}; // at this point we have a valid object even if we can't fill it. - - auto objectlist_combo_box = this->getChild("object_apply_list"); - if(!objectlist_combo_box){return true;}; // at this point we have a valid object even if we can't fill it. - - // TODO: replace this with check box. "apply selected" - bool apply_local { scroll_ctrl_selected_item && scroll_ctrl_selected_column && objectlist_combo_box }; - - if ( apply_local ) + if(auto floater_ptr = LLLocalMeshSystem::getInstance()->getFloaterPointer()) { - local_id = scroll_ctrl_selected_column->getValue().asUUID(); - // fill it up with local goodness - static const bool use_scale {true}; + floater_ptr->update_selected_target( object->getID() ); + auto scroll_ctrl_selected_item = floater_ptr->mScrollCtrl->getFirstSelected(); + if(!scroll_ctrl_selected_item){return true;}; // at this point we have a valid object even if we can't fill it. - // // make sure the selection is still valid, and if so - get id. + auto scroll_ctrl_selected_column = scroll_ctrl_selected_item->getColumn(LOCAL_TRACKING_ID_COLUMN); + if(!scroll_ctrl_selected_column){return true;}; // at this point we have a valid object even if we can't fill it. - // get selected local file id, object idx and use_scale boolean - int object_idx = objectlist_combo_box->getFirstSelectedIndex(); - LLLocalMeshSystem::getInstance()->applyVObject(object->getID(), local_id, object_idx, use_scale); - volp = object->getVolume(); - if(!volp) + auto objectlist_combo_box = floater_ptr->getChild("object_apply_list"); + if(!objectlist_combo_box){return true;}; // at this point we have a valid object even if we can't fill it. + + // TODO: replace this with check box. "apply selected" + bool apply_local { scroll_ctrl_selected_item && scroll_ctrl_selected_column && objectlist_combo_box }; + + if ( apply_local ) { - return true; + local_id = scroll_ctrl_selected_column->getValue().asUUID(); + // fill it up with local goodness + static const bool use_scale {true}; + + // // make sure the selection is still valid, and if so - get id. + + // get selected local file id, object idx and use_scale boolean + int object_idx = objectlist_combo_box->getFirstSelectedIndex(); + LLLocalMeshSystem::getInstance()->applyVObject(object->getID(), local_id, object_idx, use_scale); + volp = object->getVolume(); + if(!volp) + { + return true; + } + volume_params = volp->getParams(); + object->updateVolume(volume_params); + object->markForUpdate(true); } - volume_params = volp->getParams(); - object->updateVolume(volume_params); - object->markForUpdate(true); } return true; } diff --git a/indra/newview/vjlocalmesh.h b/indra/newview/vjlocalmesh.h index e50ac6ba43..aa4ce2e8ee 100644 --- a/indra/newview/vjlocalmesh.h +++ b/indra/newview/vjlocalmesh.h @@ -244,6 +244,7 @@ class LLLocalMeshSystem : public LLSingleton // floater two-way communication void registerFloaterPointer(LLFloaterLocalMesh* floater_ptr); + LLFloaterLocalMesh* getFloaterPointer(){return mFloaterPtr;}; void triggerFloaterRefresh( bool keep_selection=true ); std::vector getFileInfoVector() const; std::vector getFileLog(LLUUID local_file_id) const; From c79a5cda6e644fefb9e1af50327cc6ee0ca6c7cc Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 1 Nov 2022 15:30:27 +0000 Subject: [PATCH 6/9] [FIRE-32169] [Local Mesh] Add ? Help icon for local mesh wiki pages TBD * floater_local_mesh (just links to the three panels) and some general info. * local_mesh_assets (description of the main asset list tab) * local_mesh_log (description of the log tab) * local_mesh_settings (descroption of the settings tab) --- .../newview/skins/default/xui/en/floater_vj_local_mesh.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_vj_local_mesh.xml b/indra/newview/skins/default/xui/en/floater_vj_local_mesh.xml index bd4320835c..21a9e3cd03 100644 --- a/indra/newview/skins/default/xui/en/floater_vj_local_mesh.xml +++ b/indra/newview/skins/default/xui/en/floater_vj_local_mesh.xml @@ -14,6 +14,7 @@ save_visibility="true" single_instance="false" save_dock_state="false" + help_topic="floater_local_mesh" title="Local Mesh"> @@ -63,7 +64,7 @@ + help_topic="local_mesh_log"> + help_topic="local_mesh_settings"> Date: Tue, 1 Nov 2022 17:16:13 -0400 Subject: [PATCH 7/9] Increment viewer version to 6.6.8 following promotion of DRTVWR-575 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 5db1411e12..4aa5a3a58e 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.6.7 +6.6.8 From 3139c1a43de70a441f441d078e044218b25bf685 Mon Sep 17 00:00:00 2001 From: Pantera Date: Wed, 2 Nov 2022 08:58:52 +0100 Subject: [PATCH 8/9] FIRE-32365 Russian translation update, by Romka Swallowtail --- indra/newview/skins/default/xui/ru/floater_model_preview.xml | 1 + indra/newview/skins/default/xui/ru/menu_inventory.xml | 2 ++ indra/newview/skins/default/xui/ru/menu_viewer.xml | 1 + 3 files changed, 4 insertions(+) diff --git a/indra/newview/skins/default/xui/ru/floater_model_preview.xml b/indra/newview/skins/default/xui/ru/floater_model_preview.xml index 5a41eaed0a..eb9bfc594c 100644 --- a/indra/newview/skins/default/xui/ru/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/ru/floater_model_preview.xml @@ -131,6 +131,7 @@ Куб Шестиугольник Определенные + Ограничительная рамка Из файла