summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.h
diff options
context:
space:
mode:
authorRichard J. Moore <rich@kde.org>2014-01-01 16:58:19 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-07 13:04:18 +0100
commitb12b1ddf4880a5157b5edac05e0ef381e9148aae (patch)
treec7354803380ebfffef49fc8bacca4e37b61c5d06 /src/corelib/kernel/qcoreapplication.h
parent9b19a69c89c07b02ab631c1ccfd4d89013b6ec45 (diff)
Prevent foolish use of setuid when using Qt.
In order to prevent people from shooting themselves in the foot, abort if we're running setuid. This behavior can be disabled by calling QCoreApplication::setSetuidAllowed(true) in order to support legacy code. [ChangeLog][QtCore][Important Behavior Changes] Running Qt applications that are setuid has been prevented. If you really need to do this then you can call QCoreApplication::setSetuidAllowed(true) before creating the QCoreApplication instance. Change-Id: I992a9a0cd8420693d438852a05666e3dbb2c9d6a Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.h')
-rw-r--r--src/corelib/kernel/qcoreapplication.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index ae17aeec0e..c2843030fd 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -112,6 +112,9 @@ public:
static void setApplicationVersion(const QString &version);
static QString applicationVersion();
+ static void setSetuidAllowed(bool allow);
+ static bool isSetuidAllowed();
+
static QCoreApplication *instance() { return self; }
#ifndef QT_NO_QOBJECT