Show
Ignore:
Timestamp:
02/08/06 10:45:50 (3 years ago)
Author:
zoeloelip
Message:

The owner of the a sysvipc mutex will now be changed on creation of

of the mutex. The user will be set to the uid set with
--with-eaccelerator-userid. This way the semaphore doesn't need to
be public writable anymore.

Moved some inactive contributors to the inactive list.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/mm.c

    r131 r150  
    322322  int rc; 
    323323  union semun arg; 
    324  
    325   if ((lock->semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0666)) < 0) { 
    326     return 0; 
    327   } 
     324  struct semid_ds buf; 
     325 
     326  if ((lock->semid = semget(IPC_PRIVATE, 1, IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR)) < 0) { 
     327    return 0; 
     328  } 
     329 
     330  arg.buf = &buf; 
     331  do { 
     332    rc = semctl(lock->semid, 0, IPC_STAT, arg); 
     333  } while (rc < 0 && errno == EINTR); 
     334 
     335  buf.sem_perm.uid = EA_USERID; 
     336 
     337  do { 
     338    rc = semctl(lock->semid, 0, IPC_SET, arg); 
     339  } while (rc < 0 && errno == EINTR); 
     340   
    328341  arg.val = 1; 
    329342  do {