summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2010-08-31 08:23:30 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-09-03 08:22:25 (GMT)
commit5738dcd705e7edde816940f9c0ab2c364c81ad20 (patch)
treee6be0a4b0f11289a7f0e8f6b4d4cce1de28aee8e /qmake
parentdac9e5dd5644d29d6a8dde752e7c594727f16661 (diff)
downloadQt-5738dcd705e7edde816940f9c0ab2c364c81ad20.zip
Qt-5738dcd705e7edde816940f9c0ab2c364c81ad20.tar.gz
Qt-5738dcd705e7edde816940f9c0ab2c364c81ad20.tar.bz2
Ensure that we load system libraries from the correct location.
This was a security hole that has been there for a while, but the public awareness have recently rised so the threat is more imminent now. The solution is to fix all places where we dynamically load system libraries. More specifically, we now load all system libraries with an absolute path that points to a library in the system directory (usually c:\windows\system32). We therefore introduce a small class named QSystemLibrary that only loads libraries located in the system path. This shares some of the API with QLibrary (in order to make the patch as small as possible). We don't fix QLibrary due to risk of regressions. In addition, applications can fix the code that calls QLibrary themselves. The problem does not apply to Windows CE, since the search order is documented as not searching in the current directory. However, it touches some CE-specific code - therefore QSystemLibrary is sometimes used on WinCE (however, it will just do a normal LoadLibrary() since its safe anyway). This change does not affect the testability plugin (it is not clearly documented where that plugin is located, and the plugin should never be used in production code anyway) Loading OpenSSL libraries The ssl libraries are handled specially, and searched in this order (we cannot expect them to always be in the system folder): 1. Application path 2. System libraries path 3. Trying all paths inside the PATH environment variable Task-number: QT-3825 Reviewed-by: Thiago Macieira Reviewed-by: Peter Hartmann
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.win325
-rw-r--r--qmake/qmake.pri3
2 files changed, 7 insertions, 1 deletions
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 48d84b7..c452c5a 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -102,6 +102,7 @@ QTOBJS= \
qtemporaryfile.obj \
qabstractfileengine.obj \
qfsfileengine_win.obj \
+ qsystemlibrary.obj \
qfsfileengine_iterator_win.obj \
qfileinfo.obj \
qglobal.obj \
@@ -155,6 +156,7 @@ clean::
-del qtemporaryfile.obj
-del qabstractfileengine.obj
-del qfsfileengine_win.obj
+ -del qsystemlibrary.obj
-del qfsfileengine_iterator_win.obj
-del qfileinfo.obj
-del qglobal.obj
@@ -313,6 +315,9 @@ qtemporaryfile.obj: $(SOURCE_PATH)\src\corelib\io\qtemporaryfile.cpp
qfsfileengine_win.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_win.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_win.cpp
+qsystemlibrary.obj: $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp
+
qfsfileengine_iterator_win.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator_win.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator_win.cpp
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index b82ab4d..8d3a559 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -128,7 +128,8 @@ bootstrap { #Qt code
LIBS += -framework ApplicationServices
}
} else:win32 {
- SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp
+ SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp \
+ qsystemlibrary.cpp
win32-msvc*:LIBS += ole32.lib advapi32.lib
win32-g++:LIBS += -lole32 -luuid
}