pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.122 2000/04/19 16:03:31 mast Exp $"); + RCSID("$Id: threads.c,v 1.123 2000/05/20 13:28:36 grubba Exp $");      int num_threads = 1;   int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "mapping.h"   #include "object.h"   #include "pike_macros.h"
pike.git/src/threads.c:212: Inside #if defined(POSIX_THREADS)
  #ifdef POSIX_THREADS   pthread_attr_t pattr;   pthread_attr_t small_pattr;   #endif   int thread_storage_offset;      struct thread_starter   {    struct object *id;    struct array *args; + #ifdef BROKEN_LINUX_THREAD_EUID +  int euid, egid; + #endif /* BROKEN_LINUX_THREAD_EUID */   };      struct thread_local   {    INT32 id;   };      static volatile IMUTEX_T *interleave_list = NULL;      void low_init_threads_disable(void)
pike.git/src/threads.c:556:      TH_RETURN_TYPE new_thread_func(void * data)   {    struct thread_starter arg = *(struct thread_starter *)data;    JMP_BUF back;    INT32 tmp;       THREADS_FPRINTF(0, (stderr,"THREADS_DISALLOW() Thread %08x created...\n",    (unsigned int)arg.id));    + #ifdef BROKEN_LINUX_THREAD_EUID +  /* Work-around for Linux's pthreads not propagating the +  * effective uid & gid. +  */ +  if (!geteuid()) { +  setegid(arg->egid); +  seteuid(arg->euid); +  } + #endif /* BROKEN_LINUX_THREAD_EUID */ +     if((tmp=mt_lock_interpreter()))    fatal("Failed to lock interpreter, return value=%d, errno=%d\n",tmp,   #ifdef __NT__    GetLastError()   #else    errno   #endif    );    init_interpreter();    thread_id=arg.id;
pike.git/src/threads.c:671:   void f_thread_create(INT32 args)   {    THREAD_T dummy;    struct thread_starter *arg;    int tmp;    arg = ALLOC_STRUCT(thread_starter);    arg->args=aggregate_array(args);    arg->id=clone_object(thread_id_prog,0);    OBJ2THREAD(arg->id)->status=THREAD_RUNNING;    + #ifdef BROKEN_LINUX_THREAD_EUID +  arg->euid = geteuid(); +  arg->egid = getegid(); + #endif /* BROKEN_LINUX_THREAD_EUID */ +     do {    tmp = th_create(& OBJ2THREAD(arg->id)->id,    new_thread_func,    arg);    } while( tmp == EINTR );       if(!tmp)    {    num_threads++;    thread_table_insert(arg->id);