diff options
-rw-r--r-- | client/dbclient.cpp | 18 | ||||
-rw-r--r-- | db/db.vcproj | 2820 | ||||
-rw-r--r-- | db/security.cpp | 98 | ||||
-rw-r--r-- | db/security.h | 10 | ||||
-rw-r--r-- | db/security_commands.cpp | 274 | ||||
-rw-r--r-- | util/mmap.cpp | 8 |
6 files changed, 1616 insertions, 1612 deletions
diff --git a/client/dbclient.cpp b/client/dbclient.cpp index 9fea40df1b9..e346d84ae80 100644 --- a/client/dbclient.cpp +++ b/client/dbclient.cpp @@ -72,15 +72,15 @@ namespace mongo { { b << "authenticate" << 1 << "nonce" << nonce << "user" << username << "key"; - md5digest d;
- {
- md5_state_t st;
- md5_init(&st);
- md5_append(&st, (const md5_byte_t *) &nonce, sizeof(nonce));
- md5_append(&st, (const md5_byte_t *) username, strlen(username));
- md5_append(&st, (const md5_byte_t *) password, strlen(password));
- md5_finish(&st, d);
- }
+ md5digest d; + { + md5_state_t st; + md5_init(&st); + md5_append(&st, (const md5_byte_t *) &nonce, sizeof(nonce)); + md5_append(&st, (const md5_byte_t *) username, strlen(username)); + md5_append(&st, (const md5_byte_t *) password, strlen(password)); + md5_finish(&st, d); + } b.appendBinData("key", 16, MD5Type, (const char *) d); authCmd = b.done(); //cout << "TEMP: authCmd: " << authCmd.toString() << endl; diff --git a/db/db.vcproj b/db/db.vcproj index ca4d0c264bf..3629aed1d5a 100644 --- a/db/db.vcproj +++ b/db/db.vcproj @@ -1,1410 +1,1410 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="db"
- ProjectGUID="{215B2D68-0A70-4D10-8E75-B31010C62A91}"
- RootNamespace="db"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- UseOfMFC="0"
- UseOfATL="0"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""..\pcre-7.4";"c:\Program Files\boost\boost_1_35_0";"c:\program files\java\jdk\include";"c:\program files\java\jdk\include\win32""
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;PCRE_STATIC"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="2"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""c:\Program Files\boost\boost_1_35_0\lib""
- IgnoreAllDefaultLibraries="false"
- IgnoreDefaultLibraryNames=""
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories=""..\pcre-7.4";"c:\Program Files\boost\boost_1_35_0";"c:\program files\java\jdk\include";"c:\program files\java\jdk\include\win32""
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;PCRE_STATIC"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="stdafx.h"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""c:\program files\boost\boost_1_35_0\lib""
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="release_nojni|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories=""..\pcre-7.4";"c:\Program Files\boost\boost_1_35_0";"c:\program files\java\jdk\include";"c:\program files\java\jdk\include\win32""
- PreprocessorDefinitions="NOJNI;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;PCRE_STATIC"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="stdafx.h"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""c:\program files\boost\boost_1_35_0\lib""
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\btree.cpp"
- >
- </File>
- <File
- RelativePath=".\btreecursor.cpp"
- >
- </File>
- <File
- RelativePath=".\clientcursor.cpp"
- >
- </File>
- <File
- RelativePath=".\cloner.cpp"
- >
- </File>
- <File
- RelativePath=".\commands.cpp"
- >
- </File>
- <File
- RelativePath=".\cursor.cpp"
- >
- </File>
- <File
- RelativePath=".\db.cpp"
- >
- </File>
- <File
- RelativePath="..\client\dbclient.cpp"
- >
- </File>
- <File
- RelativePath=".\dbcommands.cpp"
- >
- </File>
- <File
- RelativePath=".\dbeval.cpp"
- >
- </File>
- <File
- RelativePath=".\dbhelpers.cpp"
- >
- </File>
- <File
- RelativePath=".\dbinfo.cpp"
- >
- </File>
- <File
- RelativePath=".\dbwebserver.cpp"
- >
- </File>
- <File
- RelativePath=".\instance.cpp"
- >
- </File>
- <File
- RelativePath=".\introspect.cpp"
- >
- </File>
- <File
- RelativePath=".\javajs.cpp"
- >
- </File>
- <File
- RelativePath=".\jsobj.cpp"
- >
- </File>
- <File
- RelativePath=".\json.cpp"
- >
- </File>
- <File
- RelativePath=".\lasterror.cpp"
- >
- </File>
- <File
- RelativePath=".\matcher.cpp"
- >
- </File>
- <File
- RelativePath=".\namespace.cpp"
- >
- </File>
- <File
- RelativePath=".\pdfile.cpp"
- >
- </File>
- <File
- RelativePath=".\query.cpp"
- >
- </File>
- <File
- RelativePath=".\queryoptimizer.cpp"
- >
- </File>
- <File
- RelativePath=".\repl.cpp"
- >
- </File>
- <File
- RelativePath=".\security.cpp"
- >
- </File>
- <File
- RelativePath=".\security_commands.cpp"
- >
- </File>
- <File
- RelativePath="..\stdafx.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\tests.cpp"
- >
- </File>
- <Filter
- Name="util"
- >
- <File
- RelativePath="..\util\background.cpp"
- >
- </File>
- <File
- RelativePath="..\util\md5.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\util\md5main.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\grid\message.cpp"
- >
- </File>
- <File
- RelativePath="..\util\miniwebserver.cpp"
- >
- </File>
- <File
- RelativePath="..\util\mmap.cpp"
- >
- </File>
- <File
- RelativePath="..\util\sock.cpp"
- >
- </File>
- <File
- RelativePath="..\util\util.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\btree.h"
- >
- </File>
- <File
- RelativePath=".\clientcursor.h"
- >
- </File>
- <File
- RelativePath=".\commands.h"
- >
- </File>
- <File
- RelativePath=".\cursor.h"
- >
- </File>
- <File
- RelativePath=".\database.h"
- >
- </File>
- <File
- RelativePath=".\db.h"
- >
- </File>
- <File
- RelativePath=".\dbhelpers.h"
- >
- </File>
- <File
- RelativePath=".\dbinfo.h"
- >
- </File>
- <File
- RelativePath=".\dbmessage.h"
- >
- </File>
- <File
- RelativePath=".\introspect.h"
- >
- </File>
- <File
- RelativePath=".\javajs.h"
- >
- </File>
- <File
- RelativePath=".\jsobj.h"
- >
- </File>
- <File
- RelativePath=".\json.h"
- >
- </File>
- <File
- RelativePath=".\matcher.h"
- >
- </File>
- <File
- RelativePath="..\grid\message.h"
- >
- </File>
- <File
- RelativePath=".\minilex.h"
- >
- </File>
- <File
- RelativePath=".\namespace.h"
- >
- </File>
- <File
- RelativePath=".\pdfile.h"
- >
- </File>
- <File
- RelativePath="..\grid\protocol.h"
- >
- </File>
- <File
- RelativePath=".\query.h"
- >
- </File>
- <File
- RelativePath=".\queryoptimizer.h"
- >
- </File>
- <File
- RelativePath=".\repl.h"
- >
- </File>
- <File
- RelativePath=".\replset.h"
- >
- </File>
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath=".\scanandorder.h"
- >
- </File>
- <File
- RelativePath=".\security.h"
- >
- </File>
- <File
- RelativePath="..\stdafx.h"
- >
- </File>
- <File
- RelativePath=".\storage.h"
- >
- </File>
- <Filter
- Name="util"
- >
- <File
- RelativePath="..\util\builder.h"
- >
- </File>
- <File
- RelativePath="..\util\goodies.h"
- >
- </File>
- <File
- RelativePath="..\util\hashtab.h"
- >
- </File>
- <File
- RelativePath=".\lasterror.h"
- >
- </File>
- <File
- RelativePath="..\util\log.h"
- >
- </File>
- <File
- RelativePath="..\util\lruishmap.h"
- >
- </File>
- <File
- RelativePath="..\util\md5.h"
- >
- </File>
- <File
- RelativePath="..\util\md5.hpp"
- >
- </File>
- <File
- RelativePath="..\util\miniwebserver.h"
- >
- </File>
- <File
- RelativePath="..\util\mmap.h"
- >
- </File>
- <File
- RelativePath="..\util\sock.h"
- >
- </File>
- <File
- RelativePath="..\util\unittest.h"
- >
- </File>
- </Filter>
- <Filter
- Name="client"
- >
- <File
- RelativePath="..\client\connpool.h"
- >
- </File>
- <File
- RelativePath="..\client\dbclient.h"
- >
- </File>
- <File
- RelativePath="..\client\model.h"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- <File
- RelativePath=".\db.rc"
- >
- </File>
- <File
- RelativePath="..\targetver.h"
- >
- </File>
- </Filter>
- <Filter
- Name="misc"
- >
- <File
- RelativePath=".\makefile"
- >
- </File>
- <File
- RelativePath="..\pcre-7.4\pcrecpp.cc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcrecpp.h"
- >
- </File>
- </Filter>
- <Filter
- Name="libs_etc"
- >
- <File
- RelativePath="..\..\boostw\boost_1_34_1\boost\config\auto_link.hpp"
- >
- </File>
- <File
- RelativePath="C:\Program Files\Java\jdk\lib\jvm.lib"
- >
- <FileConfiguration
- Name="release_nojni|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCustomBuildTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\boostw\boost_1_34_1\boost\version.hpp"
- >
- </File>
- </Filter>
- <Filter
- Name="pcre"
- >
- <File
- RelativePath="..\pcre-7.4\config.h"
- >
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre.h"
- >
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_chartables.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_compile.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_config.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_dfa_exec.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_exec.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_fullinfo.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_get.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_globals.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_info.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_maketables.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_newline.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_ord2utf8.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_refcount.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_scanner.cc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_stringpiece.cc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_study.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_tables.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_try_flipped.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_ucp_searchfuncs.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_valid_utf8.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_version.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcre_xclass.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\pcre-7.4\pcreposix.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="release_nojni|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- </FileConfiguration>
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9.00" + Name="db" + ProjectGUID="{215B2D68-0A70-4D10-8E75-B31010C62A91}" + RootNamespace="db" + Keyword="Win32Proj" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="1" + UseOfMFC="0" + UseOfATL="0" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""..\pcre-7.4";"c:\Program Files\boost\boost_1_35_0";"c:\program files\java\jdk\include";"c:\program files\java\jdk\include\win32"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;PCRE_STATIC" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="2" + WarningLevel="3" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="ws2_32.lib" + LinkIncremental="2" + AdditionalLibraryDirectories=""c:\Program Files\boost\boost_1_35_0\lib"" + IgnoreAllDefaultLibraries="false" + IgnoreDefaultLibraryNames="" + GenerateDebugInformation="true" + SubSystem="1" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="1" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories=""..\pcre-7.4";"c:\Program Files\boost\boost_1_35_0";"c:\program files\java\jdk\include";"c:\program files\java\jdk\include\win32"" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;PCRE_STATIC" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="2" + PrecompiledHeaderThrough="stdafx.h" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="ws2_32.lib" + LinkIncremental="1" + AdditionalLibraryDirectories=""c:\program files\boost\boost_1_35_0\lib"" + GenerateDebugInformation="true" + SubSystem="1" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="release_nojni|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="1" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories=""..\pcre-7.4";"c:\Program Files\boost\boost_1_35_0";"c:\program files\java\jdk\include";"c:\program files\java\jdk\include\win32"" + PreprocessorDefinitions="NOJNI;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;PCRE_STATIC" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="2" + PrecompiledHeaderThrough="stdafx.h" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="ws2_32.lib" + LinkIncremental="1" + AdditionalLibraryDirectories=""c:\program files\boost\boost_1_35_0\lib"" + GenerateDebugInformation="true" + SubSystem="1" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\btree.cpp" + > + </File> + <File + RelativePath=".\btreecursor.cpp" + > + </File> + <File + RelativePath=".\clientcursor.cpp" + > + </File> + <File + RelativePath=".\cloner.cpp" + > + </File> + <File + RelativePath=".\commands.cpp" + > + </File> + <File + RelativePath=".\cursor.cpp" + > + </File> + <File + RelativePath=".\db.cpp" + > + </File> + <File + RelativePath="..\client\dbclient.cpp" + > + </File> + <File + RelativePath=".\dbcommands.cpp" + > + </File> + <File + RelativePath=".\dbeval.cpp" + > + </File> + <File + RelativePath=".\dbhelpers.cpp" + > + </File> + <File + RelativePath=".\dbinfo.cpp" + > + </File> + <File + RelativePath=".\dbwebserver.cpp" + > + </File> + <File + RelativePath=".\instance.cpp" + > + </File> + <File + RelativePath=".\introspect.cpp" + > + </File> + <File + RelativePath=".\javajs.cpp" + > + </File> + <File + RelativePath=".\jsobj.cpp" + > + </File> + <File + RelativePath=".\json.cpp" + > + </File> + <File + RelativePath=".\lasterror.cpp" + > + </File> + <File + RelativePath=".\matcher.cpp" + > + </File> + <File + RelativePath=".\namespace.cpp" + > + </File> + <File + RelativePath=".\pdfile.cpp" + > + </File> + <File + RelativePath=".\query.cpp" + > + </File> + <File + RelativePath=".\queryoptimizer.cpp" + > + </File> + <File + RelativePath=".\repl.cpp" + > + </File> + <File + RelativePath=".\security.cpp" + > + </File> + <File + RelativePath=".\security_commands.cpp" + > + </File> + <File + RelativePath="..\stdafx.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="1" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="1" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="1" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\tests.cpp" + > + </File> + <Filter + Name="util" + > + <File + RelativePath="..\util\background.cpp" + > + </File> + <File + RelativePath="..\util\md5.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\util\md5main.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\grid\message.cpp" + > + </File> + <File + RelativePath="..\util\miniwebserver.cpp" + > + </File> + <File + RelativePath="..\util\mmap.cpp" + > + </File> + <File + RelativePath="..\util\sock.cpp" + > + </File> + <File + RelativePath="..\util\util.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath=".\btree.h" + > + </File> + <File + RelativePath=".\clientcursor.h" + > + </File> + <File + RelativePath=".\commands.h" + > + </File> + <File + RelativePath=".\cursor.h" + > + </File> + <File + RelativePath=".\database.h" + > + </File> + <File + RelativePath=".\db.h" + > + </File> + <File + RelativePath=".\dbhelpers.h" + > + </File> + <File + RelativePath=".\dbinfo.h" + > + </File> + <File + RelativePath=".\dbmessage.h" + > + </File> + <File + RelativePath=".\introspect.h" + > + </File> + <File + RelativePath=".\javajs.h" + > + </File> + <File + RelativePath=".\jsobj.h" + > + </File> + <File + RelativePath=".\json.h" + > + </File> + <File + RelativePath=".\matcher.h" + > + </File> + <File + RelativePath="..\grid\message.h" + > + </File> + <File + RelativePath=".\minilex.h" + > + </File> + <File + RelativePath=".\namespace.h" + > + </File> + <File + RelativePath=".\pdfile.h" + > + </File> + <File + RelativePath="..\grid\protocol.h" + > + </File> + <File + RelativePath=".\query.h" + > + </File> + <File + RelativePath=".\queryoptimizer.h" + > + </File> + <File + RelativePath=".\repl.h" + > + </File> + <File + RelativePath=".\replset.h" + > + </File> + <File + RelativePath=".\resource.h" + > + </File> + <File + RelativePath=".\scanandorder.h" + > + </File> + <File + RelativePath=".\security.h" + > + </File> + <File + RelativePath="..\stdafx.h" + > + </File> + <File + RelativePath=".\storage.h" + > + </File> + <Filter + Name="util" + > + <File + RelativePath="..\util\builder.h" + > + </File> + <File + RelativePath="..\util\goodies.h" + > + </File> + <File + RelativePath="..\util\hashtab.h" + > + </File> + <File + RelativePath=".\lasterror.h" + > + </File> + <File + RelativePath="..\util\log.h" + > + </File> + <File + RelativePath="..\util\lruishmap.h" + > + </File> + <File + RelativePath="..\util\md5.h" + > + </File> + <File + RelativePath="..\util\md5.hpp" + > + </File> + <File + RelativePath="..\util\miniwebserver.h" + > + </File> + <File + RelativePath="..\util\mmap.h" + > + </File> + <File + RelativePath="..\util\sock.h" + > + </File> + <File + RelativePath="..\util\unittest.h" + > + </File> + </Filter> + <Filter + Name="client" + > + <File + RelativePath="..\client\connpool.h" + > + </File> + <File + RelativePath="..\client\dbclient.h" + > + </File> + <File + RelativePath="..\client\model.h" + > + </File> + </Filter> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + <File + RelativePath=".\db.rc" + > + </File> + <File + RelativePath="..\targetver.h" + > + </File> + </Filter> + <Filter + Name="misc" + > + <File + RelativePath=".\makefile" + > + </File> + <File + RelativePath="..\pcre-7.4\pcrecpp.cc" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcrecpp.h" + > + </File> + </Filter> + <Filter + Name="libs_etc" + > + <File + RelativePath="..\..\boostw\boost_1_34_1\boost\config\auto_link.hpp" + > + </File> + <File + RelativePath="C:\Program Files\Java\jdk\lib\jvm.lib" + > + <FileConfiguration + Name="release_nojni|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\boostw\boost_1_34_1\boost\version.hpp" + > + </File> + </Filter> + <Filter + Name="pcre" + > + <File + RelativePath="..\pcre-7.4\config.h" + > + </File> + <File + RelativePath="..\pcre-7.4\pcre.h" + > + </File> + <File + RelativePath="..\pcre-7.4\pcre_chartables.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_compile.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_config.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_dfa_exec.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_exec.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_fullinfo.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_get.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_globals.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_info.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_maketables.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_newline.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_ord2utf8.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_refcount.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_scanner.cc" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_stringpiece.cc" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_study.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_tables.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_try_flipped.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_ucp_searchfuncs.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_valid_utf8.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_version.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcre_xclass.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\pcre-7.4\pcreposix.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="release_nojni|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/db/security.cpp b/db/security.cpp index cee278c09d9..4ada176a0a5 100644 --- a/db/security.cpp +++ b/db/security.cpp @@ -1,49 +1,49 @@ -
-// security.cpp
-
-#include "stdafx.h"
-#include "security.h"
-#include "../util/md5.hpp"
-#include "json.h"
-#include "pdfile.h"
-#include "db.h"
-#include "dbhelpers.h"
-
-namespace mongo {
-
- extern "C" int do_md5_test(void);
-
- boost::thread_specific_ptr<AuthenticationInfo> authInfo;
-
- Security::Security(){
-#if defined(__linux__)
- devrandom = new ifstream("/dev/urandom", ios::binary|ios::in);
- massert( "can't open dev/urandom", devrandom->is_open() );
-#elif defined(_WIN32)
- srand(curTimeMicros());
-#else
- srandomdev();
-#endif
- assert( sizeof(nonce) == 8 );
-
- if ( do_md5_test() )
- massert("md5 unit test fails", false);
- }
-
- nonce Security::getNonce(){
- nonce n;
-#if defined(__linux__)
- devrandom->read((char*)&n, sizeof(n));
- massert("devrandom failed", !devrandom->fail());
-#elif defined(_WIN32)
- n = ((unsigned long long)rand())<<32 | rand();
-#else
- n = random();
-#endif
- return n;
- }
-
- Security security;
-
-} // namespace mongo
-
+ +// security.cpp + +#include "stdafx.h" +#include "security.h" +#include "../util/md5.hpp" +#include "json.h" +#include "pdfile.h" +#include "db.h" +#include "dbhelpers.h" + +namespace mongo { + + extern "C" int do_md5_test(void); + + boost::thread_specific_ptr<AuthenticationInfo> authInfo; + + Security::Security(){ +#if defined(__linux__) + devrandom = new ifstream("/dev/urandom", ios::binary|ios::in); + massert( "can't open dev/urandom", devrandom->is_open() ); +#elif defined(_WIN32) + srand(curTimeMicros()); +#else + srandomdev(); +#endif + assert( sizeof(nonce) == 8 ); + + if ( do_md5_test() ) + massert("md5 unit test fails", false); + } + + nonce Security::getNonce(){ + nonce n; +#if defined(__linux__) + devrandom->read((char*)&n, sizeof(n)); + massert("devrandom failed", !devrandom->fail()); +#elif defined(_WIN32) + n = ((unsigned long long)rand())<<32 | rand(); +#else + n = random(); +#endif + return n; + } + + Security security; + +} // namespace mongo + diff --git a/db/security.h b/db/security.h index 75dbda3b122..fa10220565f 100644 --- a/db/security.h +++ b/db/security.h @@ -1,8 +1,8 @@ -// security.h
-
-/**
-* Copyright (C) 2009 10gen Inc.
-*
+// security.h + +/** +* Copyright (C) 2009 10gen Inc. +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. diff --git a/db/security_commands.cpp b/db/security_commands.cpp index d29227ce610..534b69acfdc 100644 --- a/db/security_commands.cpp +++ b/db/security_commands.cpp @@ -1,137 +1,137 @@ -// security_commands.cpp
-// security.cpp links with both dbgrid and db. this file db only -- at least for now.
-
-// security.cpp
-
-#include "stdafx.h"
-#include "security.h"
-#include "../util/md5.hpp"
-#include "json.h"
-#include "pdfile.h"
-#include "db.h"
-#include "dbhelpers.h"
-#include "commands.h"
-#include "jsobj.h"
-
-namespace mongo {
-
-/* authentication
-
- system.users contains
- { user : <username>, pwd : <pwd_string>, ... }
-
- getnonce sends nonce to client
-
- client then sends { authenticate:1, nonce:<nonce>, user:<username>, key:<key> }
-
- where <key> is md5(<nonce><username><pwd>) as a BinData type
-*/
-
- boost::thread_specific_ptr<double> lastNonce;
-
- class CmdGetNonce : public Command {
- public:
- virtual bool logTheOp() {
- return false;
- }
- virtual bool slaveOk() {
- return true;
- }
- CmdGetNonce() : Command("getnonce") {}
- bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
- double *d = new double((double) security.getNonce());
- result.append("nonce", *d);
- lastNonce.reset(d);
- return true;
- }
- } cmdGetNonce;
-
- class CmdLogout : public Command {
- public:
- virtual bool logTheOp() {
- return false;
- }
- virtual bool slaveOk() {
- return true;
- }
- CmdLogout() : Command("logout") {}
- bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
- // database->name is the one we are logging out...
- result.append("info", "not yet implemented, coming soon");
- return true;
- }
- } cmdLogout;
-
- class CmdAuthenticate : public Command {
- public:
- virtual bool logTheOp() {
- return false;
- }
- virtual bool slaveOk() {
- return true;
- }
- CmdAuthenticate() : Command("authenticate") {}
- bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
- string user = cmdObj.getStringField("user");
- BSONElement key = cmdObj.findElement("key");
- BSONElement nonce = cmdObj.findElement("nonce");
- if( user.empty() || key.type() != BinData || nonce.type() != NumberDouble ) {
- log() << "field missing/wrong type in received authenticate command " << database->name << '\n'; log() << "field missing/wrong type in received authenticate command " << database->name << '\n';
- errmsg = "auth fails";
- sleepmillis(10);
- return false;
- }
-
- double n = nonce.number();
- {
- double *ln = lastNonce.release();
-
- if( ln == 0 || n != *ln ) {
- log() << "auth: bad nonce received. could be a driver bug or a security attack. db:" << database->name << '\n'; log() << "field missing/wr " << database->name << '\n';
- errmsg = "auth fails";
- sleepmillis(30);
- return false;
- }
- }
-
- static BSONObj userPattern = fromjson("{\"user\":1}");
- string systemUsers = database->name + ".system.users";
- OCCASIONALLY Helpers::ensureIndex(systemUsers.c_str(), userPattern, "user_1");
-
- BSONObj userObj;
- {
- BSONObjBuilder b;
- b << "user" << user;
- BSONObj query = b.done();
- if( !Helpers::findOne(systemUsers.c_str(), query, userObj) ) {
- log() << "auth: couldn't find user " << user << ", " << systemUsers << '\n';
- errmsg = "auth fails";
- return false;
- }
- }
- md5digest d;
- {
- md5_state_t st;
- md5_init(&st);
- md5_append(&st, (const md5_byte_t *) &n, sizeof(n));
- md5_append(&st, (const md5_byte_t *) user.c_str(), user.size());
- string pwd = userObj.getStringField("pwd");
- md5_append(&st, (const md5_byte_t *) pwd.c_str(), pwd.size());
- md5_finish(&st, d);
- }
-
- int keylen;
- const char *keydata = key.binData(keylen);
- uassert( "bad key", keylen == 16 );
-
- if( memcmp(d, keydata, 16) != 0 ) {
- log() << "auth: key mismatch " << user << ", ns:" << ns << '\n';
- errmsg = "auth fails";
- return false;
- }
-
- return true;
- }
- } cmdAuthenticate;
-
-} // namespace mongo
+// security_commands.cpp +// security.cpp links with both dbgrid and db. this file db only -- at least for now. + +// security.cpp + +#include "stdafx.h" +#include "security.h" +#include "../util/md5.hpp" +#include "json.h" +#include "pdfile.h" +#include "db.h" +#include "dbhelpers.h" +#include "commands.h" +#include "jsobj.h" + +namespace mongo { + +/* authentication + + system.users contains + { user : <username>, pwd : <pwd_string>, ... } + + getnonce sends nonce to client + + client then sends { authenticate:1, nonce:<nonce>, user:<username>, key:<key> } + + where <key> is md5(<nonce><username><pwd>) as a BinData type +*/ + + boost::thread_specific_ptr<double> lastNonce; + + class CmdGetNonce : public Command { + public: + virtual bool logTheOp() { + return false; + } + virtual bool slaveOk() { + return true; + } + CmdGetNonce() : Command("getnonce") {} + bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { + double *d = new double((double) security.getNonce()); + result.append("nonce", *d); + lastNonce.reset(d); + return true; + } + } cmdGetNonce; + + class CmdLogout : public Command { + public: + virtual bool logTheOp() { + return false; + } + virtual bool slaveOk() { + return true; + } + CmdLogout() : Command("logout") {} + bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { + // database->name is the one we are logging out... + result.append("info", "not yet implemented, coming soon"); + return true; + } + } cmdLogout; + + class CmdAuthenticate : public Command { + public: + virtual bool logTheOp() { + return false; + } + virtual bool slaveOk() { + return true; + } + CmdAuthenticate() : Command("authenticate") {} + bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { + string user = cmdObj.getStringField("user"); + BSONElement key = cmdObj.findElement("key"); + BSONElement nonce = cmdObj.findElement("nonce"); + if( user.empty() || key.type() != BinData || nonce.type() != NumberDouble ) { + log() << "field missing/wrong type in received authenticate command " << database->name << '\n'; log() << "field missing/wrong type in received authenticate command " << database->name << '\n'; + errmsg = "auth fails"; + sleepmillis(10); + return false; + } + + double n = nonce.number(); + { + double *ln = lastNonce.release(); + + if( ln == 0 || n != *ln ) { + log() << "auth: bad nonce received. could be a driver bug or a security attack. db:" << database->name << '\n'; log() << "field missing/wr " << database->name << '\n'; + errmsg = "auth fails"; + sleepmillis(30); + return false; + } + } + + static BSONObj userPattern = fromjson("{\"user\":1}"); + string systemUsers = database->name + ".system.users"; + OCCASIONALLY Helpers::ensureIndex(systemUsers.c_str(), userPattern, "user_1"); + + BSONObj userObj; + { + BSONObjBuilder b; + b << "user" << user; + BSONObj query = b.done(); + if( !Helpers::findOne(systemUsers.c_str(), query, userObj) ) { + log() << "auth: couldn't find user " << user << ", " << systemUsers << '\n'; + errmsg = "auth fails"; + return false; + } + } + md5digest d; + { + md5_state_t st; + md5_init(&st); + md5_append(&st, (const md5_byte_t *) &n, sizeof(n)); + md5_append(&st, (const md5_byte_t *) user.c_str(), user.size()); + string pwd = userObj.getStringField("pwd"); + md5_append(&st, (const md5_byte_t *) pwd.c_str(), pwd.size()); + md5_finish(&st, d); + } + + int keylen; + const char *keydata = key.binData(keylen); + uassert( "bad key", keylen == 16 ); + + if( memcmp(d, keydata, 16) != 0 ) { + log() << "auth: key mismatch " << user << ", ns:" << ns << '\n'; + errmsg = "auth fails"; + return false; + } + + return true; + } + } cmdAuthenticate; + +} // namespace mongo diff --git a/util/mmap.cpp b/util/mmap.cpp index ff943504588..24e97ad5718 100644 --- a/util/mmap.cpp +++ b/util/mmap.cpp @@ -46,7 +46,9 @@ namespace mongo { if ( !boost::filesystem::exists( filename ) ) return; // make sure we map full length if preexisting file. - length = boost::filesystem::file_size( filename ); + boost::uintmax_t l = boost::filesystem::file_size( filename ); + assert( l <= 0x7fffffff ); + length = (int) l; } #if defined(_WIN32) @@ -217,7 +219,9 @@ namespace mongo { #endif void* MemoryMappedFile::map(const char *filename) { - return map( filename , file_size( filename ) ); // file_size is from boost + boost::uintmax_t l = boost::filesystem::file_size( filename ); + assert( l <= 0x7fffffff ); + return map( filename , (int) l ); } } // namespace mongo |