Changeset View
Changeset View
Standalone View
Standalone View
greeter/main.cpp
Show All 26 Lines | |||||
27 | #include <signal.h> | 27 | #include <signal.h> | ||
28 | 28 | | |||
29 | #include "greeterapp.h" | 29 | #include "greeterapp.h" | ||
30 | 30 | | |||
31 | #include <config-kscreenlocker.h> | 31 | #include <config-kscreenlocker.h> | ||
32 | #if HAVE_SYS_PRCTL_H | 32 | #if HAVE_SYS_PRCTL_H | ||
33 | #include <sys/prctl.h> | 33 | #include <sys/prctl.h> | ||
34 | #endif | 34 | #endif | ||
35 | #if HAVE_SYS_PROCCTL_H | ||||
36 | #include <unistd.h> | ||||
37 | #include <sys/procctl.h> | ||||
38 | #endif | ||||
35 | 39 | | |||
36 | static void signalHandler(int signum) | 40 | static void signalHandler(int signum) | ||
37 | { | 41 | { | ||
38 | ScreenLocker::UnlockApp *instance = qobject_cast<ScreenLocker::UnlockApp *>(QCoreApplication::instance()); | 42 | ScreenLocker::UnlockApp *instance = qobject_cast<ScreenLocker::UnlockApp *>(QCoreApplication::instance()); | ||
39 | 43 | | |||
40 | if (!instance) | 44 | if (!instance) | ||
41 | return; | 45 | return; | ||
42 | 46 | | |||
Show All 12 Lines | |||||
55 | } | 59 | } | ||
56 | 60 | | |||
57 | int main(int argc, char* argv[]) | 61 | int main(int argc, char* argv[]) | ||
58 | { | 62 | { | ||
59 | // disable ptrace on the greeter | 63 | // disable ptrace on the greeter | ||
60 | #if HAVE_PR_SET_DUMPABLE | 64 | #if HAVE_PR_SET_DUMPABLE | ||
61 | prctl(PR_SET_DUMPABLE, 0); | 65 | prctl(PR_SET_DUMPABLE, 0); | ||
62 | #endif | 66 | #endif | ||
67 | #if HAVE_PROC_TRACE_CTL | ||||
rakuco: There's an extra space before the `if` here and in a few other places. | |||||
68 | int mode = PROC_TRACE_CTL_DISABLE; | ||||
69 | procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode); | ||||
70 | #endif | ||||
63 | 71 | | |||
64 | KLocalizedString::setApplicationDomain("kscreenlocker_greet"); | 72 | KLocalizedString::setApplicationDomain("kscreenlocker_greet"); | ||
65 | 73 | | |||
66 | // explicitly disable input methods as it makes it impossible to unlock, see BUG 306932 | 74 | // explicitly disable input methods as it makes it impossible to unlock, see BUG 306932 | ||
67 | // but explicitly set on screen keyboard such as maliit is allowed | 75 | // but explicitly set on screen keyboard such as maliit is allowed | ||
68 | if (qgetenv("QT_IM_MODULE") != QByteArrayLiteral("maliit")) { | 76 | if (qgetenv("QT_IM_MODULE") != QByteArrayLiteral("maliit")) { | ||
69 | qputenv("QT_IM_MODULE", QByteArrayLiteral("compose")); | 77 | qputenv("QT_IM_MODULE", QByteArrayLiteral("compose")); | ||
70 | } | 78 | } | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 125 | if (parser.isSet(testingOption)) { | |||
123 | if (!theme.isEmpty()) { | 131 | if (!theme.isEmpty()) { | ||
124 | app.setTheme(theme); | 132 | app.setTheme(theme); | ||
125 | } | 133 | } | ||
126 | 134 | | |||
127 | // allow ptrace if testing is enabled | 135 | // allow ptrace if testing is enabled | ||
128 | #if HAVE_PR_SET_DUMPABLE | 136 | #if HAVE_PR_SET_DUMPABLE | ||
129 | prctl(PR_SET_DUMPABLE, 1); | 137 | prctl(PR_SET_DUMPABLE, 1); | ||
130 | #endif | 138 | #endif | ||
139 | #if HAVE_PROC_TRACE_CTL | ||||
140 | int mode = PROC_TRACE_CTL_ENABLE; | ||||
141 | procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode); | ||||
rakuco: The indentation here looks wrong. | |||||
142 | #endif | ||||
131 | } else { | 143 | } else { | ||
132 | app.setImmediateLock(parser.isSet(immediateLockOption)); | 144 | app.setImmediateLock(parser.isSet(immediateLockOption)); | ||
133 | } | 145 | } | ||
134 | app.setNoLock(parser.isSet(nolockOption)); | 146 | app.setNoLock(parser.isSet(nolockOption)); | ||
135 | 147 | | |||
136 | bool ok = false; | 148 | bool ok = false; | ||
137 | int graceTime = parser.value(graceTimeOption).toInt(&ok); | 149 | int graceTime = parser.value(graceTimeOption).toInt(&ok); | ||
138 | if (ok) { | 150 | if (ok) { | ||
Show All 24 Lines |
There's an extra space before the if here and in a few other places.