From 45ae4881525730eece3298d3c88984ce0599a106 Mon Sep 17 00:00:00 2001
From: Nemurimasu Neiro
Date: Mon, 6 Sep 2010 00:04:56 +0000
Subject: use setenv instead of putenv
putenv requires that the string not be freed
---
linden/indra/llmedia/llmediaimplgstreamer.cpp | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
(limited to 'linden/indra')
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 2bfe4ea..7af9c9a 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -188,9 +188,6 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
// Protect against GStreamer resetting the locale, yuck.
static std::string saved_locale;
saved_locale = setlocale(LC_ALL, NULL);
-#if LL_DARWIN
- setenv("GST_PLUGIN_SYSTEM_PATH", "lib/gstreamer-plugins", TRUE);
-#endif
if (0 == gst_init_check(NULL, NULL, NULL))
{
LL_WARNS("MediaImpl") << "GStreamer library failed to initialize and load standard plugins." << LL_ENDL;
@@ -294,7 +291,6 @@ void LLMediaImplGStreamer::set_gst_plugin_path()
// Search both Imprudence and Imprudence\lib\gstreamer-plugins.
// But we also want to search the path the user has set, if any.
std::string plugin_path =
- "GST_PLUGIN_PATH=" +
#if LL_WINDOWS
imp_dir + "\\lib\\gstreamer-plugins" +
#elif LL_DARWIN
@@ -307,9 +303,9 @@ void LLMediaImplGStreamer::set_gst_plugin_path()
// Place GST_PLUGIN_PATH in the environment settings
#if LL_WINDOWS
- put_result = _putenv( (char*)plugin_path.c_str() );
+ put_result = _putenv_s( "GST_PLUGIN_PATH", (char*)plugin_path.c_str() );
#elif LL_DARWIN
- put_result = putenv( (char*)plugin_path.c_str() );
+ put_result = setenv( "GST_PLUGIN_PATH", (char*)plugin_path.c_str(), 1 );
#endif
if( put_result == -1 )
@@ -324,9 +320,9 @@ void LLMediaImplGStreamer::set_gst_plugin_path()
// Don't load system plugins. We only want to use ours, to avoid conflicts.
#if LL_WINDOWS
- put_result = _putenv( "GST_PLUGIN_SYSTEM_PATH=\"\"" );
+ put_result = _putenv_s( "GST_PLUGIN_SYSTEM_PATH", "" );
#elif LL_DARWIN
- put_result = putenv( "GST_PLUGIN_SYSTEM_PATH=\"\"" );
+ put_result = setenv( "GST_PLUGIN_SYSTEM_PATH", "", 1 );
#endif
if( put_result == -1 )
--
cgit v1.1
From c01c71d3b22b9acb983c238b608401f7d032ef9b Mon Sep 17 00:00:00 2001
From: Nemurimasu Neiro
Date: Mon, 6 Sep 2010 05:11:05 +0000
Subject: store our password in the Mac OS keychain
much more secure than XORing against a MAC address :)
---
linden/indra/newview/CMakeLists.txt | 2 ++
linden/indra/newview/llstartup.cpp | 45 ++++++++++++++++++++++++++++++++++---
2 files changed, 44 insertions(+), 3 deletions(-)
(limited to 'linden/indra')
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 995ef7e..313ed9f 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -955,11 +955,13 @@ if (DARWIN)
find_library(APPKIT_LIBRARY AppKit)
find_library(COCOA_LIBRARY Cocoa)
find_library(IOKIT_LIBRARY IOKit)
+ find_library(SECURITY_LIBRARY SECURITY)
set(viewer_LIBRARIES
${COCOA_LIBRARY}
${AGL_LIBRARY}
${IOKIT_LIBRARY}
+ ${SECURITY_LIBRARY}
)
# Add resource files to the project.
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 6622740..606262f 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -2935,17 +2935,29 @@ std::string LLStartUp::loadPasswordFromDisk()
return hashed_password;
}
+ // UUID is 16 bytes, written into ASCII is 32 characters
+ // without trailing \0
+ const S32 HASHED_LENGTH = 32;
+
std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
"password.dat");
LLFILE* fp = LLFile::fopen(filepath, "rb"); /* Flawfinder: ignore */
if (!fp)
{
+#if LL_DARWIN
+ UInt32 passwordLength;
+ char *passwordData;
+ OSStatus stat = SecKeychainFindGenericPassword(NULL, 10, "Imprudence", 0, NULL, &passwordLength, (void**)&passwordData, NULL);
+ if (stat == noErr)
+ {
+ if (passwordLength == HASHED_LENGTH)
+ hashed_password.assign(passwordData, HASHED_LENGTH);
+ SecKeychainItemFreeContent(NULL, passwordData);
+ }
+#endif
return hashed_password;
}
- // UUID is 16 bytes, written into ASCII is 32 characters
- // without trailing \0
- const S32 HASHED_LENGTH = 32;
U8 buffer[HASHED_LENGTH+1];
if (1 != fread(buffer, HASHED_LENGTH, 1, fp))
@@ -2969,6 +2981,10 @@ std::string LLStartUp::loadPasswordFromDisk()
{
hashed_password.assign((char*)buffer);
}
+#if LL_DARWIN
+ // we're migrating to the keychain
+ LLFile::remove(filepath);
+#endif
return hashed_password;
}
@@ -2977,6 +2993,19 @@ std::string LLStartUp::loadPasswordFromDisk()
// static
void LLStartUp::savePasswordToDisk(const std::string& hashed_password)
{
+#if LL_DARWIN
+ SecKeychainItemRef keychainItem;
+ OSStatus status = SecKeychainFindGenericPassword(NULL, 10, "Imprudence", 0, NULL, NULL, NULL, &keychainItem);
+ if (status == noErr)
+ {
+ SecKeychainItemModifyAttributesAndData(keychainItem, NULL, hashed_password.length(), hashed_password.c_str());
+ CFRelease(keychainItem);
+ }
+ else
+ {
+ SecKeychainAddGenericPassword(NULL, 10, "Imprudence", 0, NULL, hashed_password.length(), hashed_password.c_str(), NULL);
+ }
+#else
std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
"password.dat");
LLFILE* fp = LLFile::fopen(filepath, "wb"); /* Flawfinder: ignore */
@@ -3000,12 +3029,22 @@ void LLStartUp::savePasswordToDisk(const std::string& hashed_password)
}
fclose(fp);
+#endif
}
// static
void LLStartUp::deletePasswordFromDisk()
{
+#if LL_DARWIN
+ SecKeychainItemRef keychainItem;
+ OSStatus status = SecKeychainFindGenericPassword(NULL, 10, "Imprudence", 0, NULL, NULL, NULL, &keychainItem);
+ if (status == noErr)
+ {
+ SecKeychainItemDelete(keychainItem);
+ CFRelease(keychainItem);
+ }
+#endif
std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
"password.dat");
LLFile::remove(filepath);
--
cgit v1.1
From 0819763a22fa70a3808197ed5bedf0a98ccf1293 Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Wed, 8 Sep 2010 01:17:37 -0700
Subject: Replace '>' glyph in cascading menus with a proper triangle(backport
from Viewer 2)
---
linden/indra/llui/llmenugl.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'linden/indra')
diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp
index e00700a..8bca58a 100644
--- a/linden/indra/llui/llmenugl.cpp
+++ b/linden/indra/llui/llmenugl.cpp
@@ -102,7 +102,7 @@ const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10;
const S32 MENU_ITEM_PADDING = 4;
const std::string BOOLEAN_TRUE_PREFIX( "X" );
-const std::string BRANCH_SUFFIX( ">" );
+const std::string BRANCH_SUFFIX( "\xE2\x96\xB6" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE
const std::string ARROW_UP ("^^^^^^^");
const std::string ARROW_DOWN("vvvvvvv");
--
cgit v1.1
From 30fdc31be51f2e2f2629fded97658464ac37702b Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Wed, 8 Sep 2010 04:17:38 -0700
Subject: Increased max settable value for RenderVolumeLODFactor from 2 to 4
---
.../newview/skins/default/xui/en-us/panel_preferences_graphics1.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'linden/indra')
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml
index 153a111..72a6438 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml
@@ -286,7 +286,7 @@
Value
0
+ ResetFocusOnSelfClick
+
RezWithLandGroup
+ ShowGroupNameInChatIM
+
ShowMiniMapRadar