2003-03-05
2003-03-05 16:18:24 by Martin Stjernholm <mast@lysator.liu.se>
-
d62a63e4f0b2f06f0e0302fcd3e5fac9b2383ec9
(25 lines)
(+24/-1)
[
Show
| Annotate
]
Branch: 7.2
Retain the dumpable flag over the implicit sete?id calls for new threads on
Linux.
Rev: src/configure.in:1.499
Rev: src/threads.c:1.166
1:
#include "global.h"
- RCSID("$Id: threads.c,v 1.165 2002/11/18 17:09:07 mast Exp $");
+ RCSID("$Id: threads.c,v 1.166 2003/03/05 16:18:24 mast Exp $");
PMOD_EXPORT int num_threads = 1;
PMOD_EXPORT int threads_disabled = 0;
24:
#include <errno.h>
+ #ifdef HAVE_SYS_PRCTL_H
+ #include <sys/prctl.h>
+ #endif /* HAVE_SYS_PRCTL_H */
+
PMOD_EXPORT int live_threads = 0;
PMOD_EXPORT COND_T live_threads_change;
PMOD_EXPORT COND_T threads_disabled_change;
607: Inside #if defined(HAVE_BROKEN_LINUX_THREAD_EUID)
* effective uid & gid.
*/
if (!geteuid()) {
+ #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ /* The sete?id calls will clear the dumpable state that we might
+ * have set with system.dumpable. */
+ int current = prctl(PR_GET_DUMPABLE);
+ #endif
setegid(arg.egid);
seteuid(arg.euid);
-
+ #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ if (prctl(PR_SET_DUMPABLE, current) == -1)
+ fatal ("Didn't expect prctl to go wrong. errno=%d\n", errno);
+ #endif
}
#endif /* HAVE_BROKEN_LINUX_THREAD_EUID */
1288: Inside #if defined(HAVE_BROKEN_LINUX_THREAD_EUID)
* effective uid & gid.
*/
if (!geteuid()) {
+ #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ /* The sete?id calls will clear the dumpable state that we might
+ * have set with system.dumpable. */
+ int current = prctl(PR_GET_DUMPABLE);
+ #endif
setegid(me->egid);
seteuid(me->euid);
-
+ #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ if (prctl(PR_SET_DUMPABLE, current) == -1)
+ fatal ("Didn't expect prctl to go wrong. errno=%d\n", errno);
+ #endif
}
#endif /* HAVE_BROKEN_LINUX_THREAD_EUID */