Diffstat (limited to 'noncore/settings/networksettings/ppp/runtests.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/runtests.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/noncore/settings/networksettings/ppp/runtests.cpp b/noncore/settings/networksettings/ppp/runtests.cpp index 83ef2ea..5548601 100644 --- a/noncore/settings/networksettings/ppp/runtests.cpp +++ b/noncore/settings/networksettings/ppp/runtests.cpp | |||
@@ -41,14 +41,12 @@ | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifndef _PATH_RESCONF | 43 | #ifndef _PATH_RESCONF |
44 | #define _PATH_RESCONF "/etc/resolv.conf" | 44 | #define _PATH_RESCONF "/etc/resolv.conf" |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | //#include <klocale.h> | ||
48 | #define i18n QObject::tr | ||
49 | #include "pppdata.h" | 47 | #include "pppdata.h" |
50 | 48 | ||
51 | // initial effective uid (main.cpp) | 49 | // initial effective uid (main.cpp) |
52 | extern uid_t euid; | 50 | extern uid_t euid; |
53 | 51 | ||
54 | // secure pppd location (opener.cpp) | 52 | // secure pppd location (opener.cpp) |
@@ -214,59 +212,59 @@ int runTests() { | |||
214 | if(f) | 212 | if(f) |
215 | fclose(f); | 213 | fclose(f); |
216 | } | 214 | } |
217 | 215 | ||
218 | if(!access) { | 216 | if(!access) { |
219 | QMessageBox::warning(0,"error", | 217 | QMessageBox::warning(0,"error", |
220 | i18n("You're not allowed to dial out with " | 218 | QObject::tr("You're not allowed to dial out with " |
221 | "kppp.\nContact your system administrator.")); | 219 | "kppp.\nContact your system administrator.")); |
222 | return TEST_CRITICAL; | 220 | return TEST_CRITICAL; |
223 | } | 221 | } |
224 | } | 222 | } |
225 | 223 | ||
226 | // Test 1: search the pppd binary | 224 | // Test 1: search the pppd binary |
227 | const char *f = pppdPath(); | 225 | const char *f = pppdPath(); |
228 | 226 | ||
229 | if(!f) { | 227 | if(!f) { |
230 | QMessageBox::warning(0,"error", | 228 | QMessageBox::warning(0,"error", |
231 | i18n("Cannot find the PPP daemon!\n" | 229 | QObject::tr("Cannot find the PPP daemon!\n" |
232 | "Make sure that pppd is installed.")); | 230 | "Make sure that pppd is installed.")); |
233 | warning++; | 231 | warning++; |
234 | } | 232 | } |
235 | 233 | ||
236 | // Test 2: check access to the pppd binary | 234 | // Test 2: check access to the pppd binary |
237 | if(f) { | 235 | if(f) { |
238 | #if 0 | 236 | #if 0 |
239 | if(access(f, X_OK) != 0 /* && geteuid() != 0 */) { | 237 | if(access(f, X_OK) != 0 /* && geteuid() != 0 */) { |
240 | KMessageBox::warning(0, | 238 | KMessageBox::warning(0, |
241 | i18n("You do not have the permission " | 239 | QObject::tr("You do not have the permission " |
242 | "to start pppd!\n" | 240 | "to start pppd!\n" |
243 | "Contact your system administrator " | 241 | "Contact your system administrator " |
244 | "and ask to get access to pppd.")); | 242 | "and ask to get access to pppd.")); |
245 | return TEST_CRITICAL; | 243 | return TEST_CRITICAL; |
246 | } | 244 | } |
247 | #endif | 245 | #endif |
248 | 246 | ||
249 | if(geteuid() != 0) { | 247 | if(geteuid() != 0) { |
250 | struct stat st; | 248 | struct stat st; |
251 | stat(f, &st); | 249 | stat(f, &st); |
252 | if(st.st_uid != 0 || (st.st_mode & S_ISUID) == 0) { | 250 | if(st.st_uid != 0 || (st.st_mode & S_ISUID) == 0) { |
253 | QMessageBox::warning(0,"error", | 251 | QMessageBox::warning(0,"error", |
254 | i18n("You don't have sufficient permission to run\n" | 252 | QObject::tr("You don't have sufficient permission to run\n" |
255 | "%1\n" | 253 | "%1\n" |
256 | "Please make sure that kppp is owned by root " | 254 | "Please make sure that kppp is owned by root " |
257 | "and has the SUID bit set.").arg(f)); | 255 | "and has the SUID bit set.").arg(f)); |
258 | warning++; | 256 | warning++; |
259 | } | 257 | } |
260 | } | 258 | } |
261 | } | 259 | } |
262 | 260 | ||
263 | // Test 5: check for existence of /etc/resolv.conf | 261 | // Test 5: check for existence of /etc/resolv.conf |
264 | if (access(_PATH_RESCONF, R_OK) != 0) { | 262 | if (access(_PATH_RESCONF, R_OK) != 0) { |
265 | QString file = _PATH_RESCONF" "; | 263 | QString file = _PATH_RESCONF" "; |
266 | QString msgstr = i18n("%1 is missing or can't be read!\n" | 264 | QString msgstr = QObject::tr("%1 is missing or can't be read!\n" |
267 | "Ask your system administrator to create " | 265 | "Ask your system administrator to create " |
268 | "this file (can be empty) with appropriate " | 266 | "this file (can be empty) with appropriate " |
269 | "read and write permissions.").arg(file); | 267 | "read and write permissions.").arg(file); |
270 | QMessageBox::warning(0, "errror", msgstr); | 268 | QMessageBox::warning(0, "errror", msgstr); |
271 | warning ++; | 269 | warning ++; |
272 | } | 270 | } |