pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1695: Inside #if defined(HAVE_BROKEN_LINUX_THREAD_EUID) and #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
  #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);   #ifdef PIKE_DEBUG    if (current == -1)    fprintf (stderr, "%s:%d: Unexpected error from prctl(2). errno=%d\n",    __FILE__, __LINE__, errno);   #endif   #endif -  setegid(arg.egid); -  seteuid(arg.euid); + #ifdef HAVE_BROKEN_LINUX_THREAD_EUID +  if( setegid(arg.egid) != 0 || seteuid(arg.euid) != 0 ) +  { +  fprintf (stderr, "%s:%d: Unexpected error from setegid(2). errno=%d\n", +  __FILE__, __LINE__, errno); +  } + #endif   #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)    if (current != -1 && prctl(PR_SET_DUMPABLE, current) == -1) {   #if defined(PIKE_DEBUG)    fprintf (stderr, "%s:%d: Unexpected error from prctl(2). errno=%d\n",    __FILE__, __LINE__, errno);   #endif    }   #endif    }   #endif /* HAVE_BROKEN_LINUX_THREAD_EUID */
pike.git/src/threads.c:3044: Inside #if defined(HAVE_BROKEN_LINUX_THREAD_EUID)
  #ifdef HAVE_BROKEN_LINUX_THREAD_EUID    /* Work-around for Linux's pthreads not propagating the    * 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); + #ifdef HAVE_BROKEN_LINUX_THREAD_EUID +  if( setegid(arg.egid) != 0 || seteuid(arg.euid) != 0 ) +  { +  fprintf (stderr, "%s:%d: Unexpected error from setegid(2). errno=%d\n", +  __FILE__, __LINE__, errno); +  } + #endif   #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)    if (prctl(PR_SET_DUMPABLE, current) == -1)    Pike_fatal ("Didn't expect prctl to go wrong. errno=%d\n", errno);   #endif    }   #endif /* HAVE_BROKEN_LINUX_THREAD_EUID */       do    {   /* if(farmers == me) Pike_fatal("Ouch!\n"); */