llvm-project/lldb/source/Interpreter
Jason Molenda 878ae01889 This patch stops lldb from loading a .lldbinit file from the current
working directory by default -- a typical security problem that we
need to be more conservative about.

It adds a new target setting, target.load-cwd-lldbinit which may
be true (always read $cwd/.lldbinit), false (never read $cwd/.lldbinit)
or warn (warn if there is a $cwd/.lldbinit and don't read it).  The
default is set to warn.  If this is met with unhappiness, we can look
at changing the default to true (to match current behavior) on a 
different platform.

This does not affect reading of ~/.lldbinit - that will still be read,
as before.  If you run lldb in your home directory, it will not warn
about the presence of a .lldbinit file there.

I had to add two SB API - SBHostOS::GetUserHomeDirectory and 
SBFileSpec::AppendPathComponent - for the lldb driver code to be
able to get the home directory path in an OS neutral manner.

The warning text is

There is a .lldbinit file in the current directory which is not being read.
To silence this warning without sourcing in the local .lldbinit,
add the following to the lldbinit file in your home directory:
    settings set target.load-cwd-lldbinit false
To allow lldb to source .lldbinit files in the current working directory,
set the value of this variable to true.  Only do so if you understand and
accept the security risk.

<rdar://problem/24199163> 

llvm-svn: 261280
2016-02-19 00:05:17 +00:00
..
Args.cpp LLDB needs a mutex around getopt_long_only() function calls to avoid multi-threading option parsing issues. 2015-11-05 00:38:39 +00:00
CMakeLists.txt [cmake] Remove LLVM_NO_RTTI. 2015-09-03 08:46:55 +00:00
CommandHistory.cpp Addresses an unsigned underflow situation that can occur when dumping an empty command history. 2016-01-06 00:33:07 +00:00
CommandInterpreter.cpp This patch stops lldb from loading a .lldbinit file from the current 2016-02-19 00:05:17 +00:00
CommandObject.cpp Move things from the LanguageRuntime that obviously belong in the new Language plugin instead. 2015-09-02 01:06:46 +00:00
CommandObjectRegexCommand.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectScript.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectScript.h Fix Clang-tidy modernize-use-override warnings in some files in source; other minor fixes. 2015-10-26 17:00:13 +00:00
CommandOptionValidators.cpp Revert "Fix broken tests due to new error output." 2014-07-09 16:31:49 +00:00
CommandReturnObject.cpp Fix a glitch in the Driver's batch mode when used with "attach". 2016-01-08 00:20:47 +00:00
OptionGroupArchitecture.cpp Revert "Fix broken tests due to new error output." 2014-07-09 16:31:49 +00:00
OptionGroupBoolean.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionGroupFile.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionGroupFormat.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
OptionGroupOutputFile.cpp Fix a variety of typos. 2015-06-18 05:27:05 +00:00
OptionGroupPlatform.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
OptionGroupString.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionGroupUInt64.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionGroupUUID.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionGroupValueObjectDisplay.cpp Add a more tweakable way for ValueObjectPrinter to control pointer expansion. NFC. 2015-07-27 18:34:14 +00:00
OptionGroupVariable.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
OptionGroupWatchpoint.cpp Changed '-x'/'-xsize' to '-s'/'-size' when specifying 2015-03-26 00:42:27 +00:00
OptionValue.cpp Add an OptionValueLanguage class 2015-02-20 19:46:30 +00:00
OptionValueArch.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
OptionValueArgs.cpp Reimplemented the code that backed the "settings" in lldb. There were many issues with the previous implementation: 2012-08-22 17:17:09 +00:00
OptionValueArray.cpp Add -Wimplicit-fallthrough command line option to clang in 2016-02-16 04:14:33 +00:00
OptionValueBoolean.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionValueChar.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionValueDictionary.cpp Fix a variety of typos. 2015-06-18 05:27:05 +00:00
OptionValueEnumeration.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionValueFileSpec.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
OptionValueFileSpecLIst.cpp Add -Wimplicit-fallthrough command line option to clang in 2016-02-16 04:14:33 +00:00
OptionValueFormat.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
OptionValueFormatEntity.cpp Fixed "format-string" based settings so they can have quotes on them without leaving the quotes in the format string: 2015-06-03 02:02:48 +00:00
OptionValueLanguage.cpp Added support for enumerating the languages that actually support TypeSystems 2015-10-08 23:07:53 +00:00
OptionValuePathMappings.cpp Add -Wimplicit-fallthrough command line option to clang in 2016-02-16 04:14:33 +00:00
OptionValueProperties.cpp Add support for specifying a language to use when parsing breakpoints. 2015-07-21 22:05:07 +00:00
OptionValueRegex.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionValueSInt64.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionValueString.cpp Fix use-after-free in OptionValueString. 2015-05-22 19:33:54 +00:00
OptionValueUInt64.cpp Refactor OptionValue::SetValueFromCString to use llvm::StringRef 2015-02-20 11:14:59 +00:00
OptionValueUUID.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
Options.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
Property.cpp Move things from the LanguageRuntime that obviously belong in the new Language plugin instead. 2015-09-02 01:06:46 +00:00
ScriptInterpreter.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
embedded_interpreter.py Make some more of the LLDB/SWIG/Python glue Python 3 aware. 2015-10-16 17:52:32 +00:00