Changeset View
Changeset View
Standalone View
Standalone View
kcheckpass/kcheckpass.c
| Show First 20 Lines • Show All 275 Lines • ▼ Show 20 Line(s) | |||||
| 276 | #if HAVE_PR_SET_DUMPABLE | 276 | #if HAVE_PR_SET_DUMPABLE | ||
| 277 | prctl(PR_SET_DUMPABLE, 0); | 277 | prctl(PR_SET_DUMPABLE, 0); | ||
| 278 | #endif | 278 | #endif | ||
| 279 | #if HAVE_PROC_TRACE_CTL | 279 | #if HAVE_PROC_TRACE_CTL | ||
| 280 | int mode = PROC_TRACE_CTL_DISABLE; | 280 | int mode = PROC_TRACE_CTL_DISABLE; | ||
| 281 | procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode); | 281 | procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode); | ||
| 282 | #endif | 282 | #endif | ||
| 283 | 283 | | |||
| 284 | // prevent becoming an orphan while waiting for SIGUSR2 | ||||
| 285 | #if HAVE_PR_SET_DUMPABLE | ||||
| 286 | prctl(PR_SET_PDEATHSIG, SIGUSR2); | ||||
| 287 | #endif | ||||
| 288 | | ||||
| 284 | /* Make sure stdout/stderr are open */ | 289 | /* Make sure stdout/stderr are open */ | ||
| 285 | for (c = 1; c <= 2; c++) { | 290 | for (c = 1; c <= 2; c++) { | ||
| 286 | if (fcntl(c, F_GETFL) == -1) { | 291 | if (fcntl(c, F_GETFL) == -1) { | ||
| 287 | if ((nfd = open("/dev/null", O_WRONLY)) < 0) { | 292 | if ((nfd = open("/dev/null", O_WRONLY)) < 0) { | ||
| 288 | message("cannot open /dev/null: %s\n", strerror(errno)); | 293 | message("cannot open /dev/null: %s\n", strerror(errno)); | ||
| 289 | exit(10); | 294 | exit(10); | ||
| 290 | } | 295 | } | ||
| 291 | if (c != nfd) { | 296 | if (c != nfd) { | ||
| ▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines | |||||