Changeset 150
- Timestamp:
- 02/08/06 10:45:50 (3 years ago)
- Files:
-
- eaccelerator/trunk/AUTHORS (modified) (1 diff)
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/config.m4 (modified) (3 diffs)
- eaccelerator/trunk/eaccelerator.c (modified) (2 diffs)
- eaccelerator/trunk/mm.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/AUTHORS
r84 r150 1 1 Actual Team : 2 - Frank Alcantara <frankalcantara at users.sourceforge.net>3 2 - Franck Tabary <franck34 at users.sourceforge.net> 4 3 - Bart Vanbrabant <zoeloelip at users.sourceforge.net> 5 - Shin Seung Woo <segv74 at users.sourceforge.net>6 4 7 5 Inactive member(s) : 8 6 - Everaldo Canuto <everaldo_canuto at users.sourceforge.net> 9 7 - Reiner Jung <reinerj at users.sourceforge.net> 8 - Shin Seung Woo <segv74 at users.sourceforge.net> 9 - Frank Alcantara <frankalcantara at users.sourceforge.net> 10 10 11 11 eAccelerator is based on Turck MMCache, written by eaccelerator/trunk/ChangeLog
r144 r150 1 2006-02-08 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 3 * The owner of the a sysvipc mutex will now be changed on creation of 4 of the mutex. The user will be set to the uid set with 5 --with-eaccelerator-userid. This way the semaphore doesn't need to 6 be public writable anymore. 7 * Moved some inactive contributors to the inactive list. 8 1 9 2006-01-10 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 10 eaccelerator/trunk/config.m4
r134 r150 93 93 ]) 94 94 95 AC_ARG_WITH(eaccelerator-userid, 96 [ --with-eaccelerator-userid eAccelerator runs under this userid, only needed when using sysvipc semaphores.],[ 97 ea_userid=$withval 98 ],[ 99 ea_userid=0 100 ]) 101 95 102 dnl PHP_BUILD_SHARED 96 103 if test "$PHP_EACCELERATOR" != "no"; then … … 98 105 AC_DEFINE(HAVE_EACCELERATOR, 1, [Define if you like to use eAccelerator]) 99 106 107 AC_DEFINE_UNQUOTED(EA_USERID, $ea_userid, [The userid eAccelerator will be running under.]) 108 100 109 if test "$eaccelerator_crash_detection" = "yes"; then 101 110 AC_DEFINE(WITH_EACCELERATOR_CRASH_DETECTION, 1, [Define if you like to release eAccelerator resources on PHP crash]) … … 301 310 msg="spinlock" 302 311 elif test "$mm_sem_ipc" = "yes"; then 303 AC_DEFINE(MM_SEM_IPC, 1, [Define if you like to use sysvipc based semaphores]) 304 msg="sysvipc" 312 if test $ea_userid = 0; then 313 AC_MSG_ERROR("You need to pass the user id eaccelerator will be running under when using sysvipc semaphores") 314 else 315 AC_DEFINE(MM_SEM_IPC, 1, [Define if you like to use sysvipc based semaphores]) 316 msg="sysvipc" 317 fi 305 318 elif test "$mm_sem_fcntl" = "yes"; then 306 319 AC_DEFINE(MM_SEM_FCNTL, 1, [Define if you like to use fcntl based semaphores]) eaccelerator/trunk/eaccelerator.c
r140 r150 247 247 } 248 248 EACCELERATOR_UNLOCK_RW(); 249 }250 251 /* check the cache dir */252 static int check_cache_dir(char *cache_dir) {253 struct stat buf;254 // int uid = 0;255 // int gid = 0;256 257 if (stat(cache_dir, &buf) == -1) {258 ea_debug_error("Cache dir does not exist (could not stat %s)\n", cache_dir);259 return FAILURE;260 }261 if (!(buf.st_mode & S_IFDIR)) {262 ea_debug_error("%s is not a directory!\n", cache_dir);263 return FAILURE;264 }265 #if 0266 uid = getuid();267 gid = getgid();268 if (!((buf.st_uid == uid && (buf.st_mode & (S_IRUSR | S_IWUSR))) /* not root, owner and rw */269 || (buf.st_gid == gid && (buf.st_mode & (S_IRGRP | S_IWGRP))) /* not root, group and rw */270 || (buf.st_mode & (S_IROTH & S_IWOTH)))) { /* other and rw */271 ea_debug_error("%s hasn't got the right permissions!\n", cache_dir);272 return 0;273 }274 #endif275 return SUCCESS;276 249 } 277 250 … … 2023 1996 eaccelerator_mm_instance->enabled = 0; 2024 1997 } 2025 #if 02026 if (!eaccelerator_scripts_shm_only && check_cache_dir(EAG(cache_dir)) == FAILURE) {2027 zend_error(E_CORE_WARNING,"[%s] Can not init the cache directory", EACCELERATOR_EXTENSION_NAME);2028 /* disable eA */2029 eaccelerator_mm_instance->enabled = 0;2030 }2031 #endif2032 1998 mm_saved_zend_compile_file = zend_compile_file; 2033 1999 eaccelerator/trunk/mm.c
r131 r150 322 322 int rc; 323 323 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 328 341 arg.val = 1; 329 342 do {