Index: /trunk/Makefile.frag
===================================================================
--- /trunk/Makefile.frag	(revision 74)
+++ /trunk/Makefile.frag	(revision 75)
@@ -32,4 +32,7 @@
 disassembler.lo: $(XCACHE_PROC_H) $(srcdir)/processor.c
 
-$(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c
-xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c
+$(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h
+xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h
+
+xcachesvnclean: clean
+	cat $(srcdir)/.cvsignore | grep -v Makefile | xargs rm -f
Index: /trunk/foreachcoresig.h
===================================================================
--- /trunk/foreachcoresig.h	(revision 75)
+++ /trunk/foreachcoresig.h	(revision 75)
@@ -0,0 +1,50 @@
+/* all signals generate coredump by default is list here */
+
+#ifdef SIGABRT
+FOREACH_SIG(SIGABRT);
+#endif
+
+#ifdef SIGBUS
+FOREACH_SIG(SIGBUS);
+#endif
+
+#ifdef SIGEMT
+FOREACH_SIG(SIGEMT);
+#endif
+
+#ifdef SIGFPE
+FOREACH_SIG(SIGFPE);
+#endif
+
+#ifdef SIGILL
+FOREACH_SIG(SIGILL);
+#endif
+
+#ifdef SIGIOT
+FOREACH_SIG(SIGIOT);
+#endif
+
+#ifdef SIGQUIT
+FOREACH_SIG(SIGQUIT);
+#endif
+
+#ifdef SIGSEGV
+FOREACH_SIG(SIGSEGV);
+#endif
+
+#ifdef SIGSYS
+FOREACH_SIG(SIGSYS);
+#endif
+
+#ifdef SIGTRAP
+FOREACH_SIG(SIGTRAP);
+#endif
+
+#ifdef SIGXCPU
+FOREACH_SIG(SIGXCPU);
+#endif
+
+#ifdef SIGXFSZ
+FOREACH_SIG(SIGXFSZ);
+#endif
+
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 74)
+++ /trunk/xcache.c	(revision 75)
@@ -509,4 +509,5 @@
 	int cacheid;
 	xc_entry_data_php_t *php;
+	char *ptr;
 
 	if (!filename || !SG(request_info).path_translated) {
@@ -523,4 +524,5 @@
 		}
 
+		/* absolute path */
 		pbuf = &buf;
 		if (IS_ABSOLUTE_PATH(filename, strlen(filename))) {
@@ -528,9 +530,27 @@
 				return 0;
 			}
-		}
-		else {
-			if (xc_stat(filename, PG(include_path), pbuf TSRMLS_CC) != 0) {   
+			break;
+		}
+
+		/* relative path */
+		if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) {
+			ptr = filename + 1;
+			if (*ptr == '.') {
+				while (*(++ptr) == '.');
+				if (!IS_SLASH(*ptr)) {
+					goto not_relative_path;
+				}   
+			}
+
+			if (VCWD_STAT(filename, pbuf) != 0) {
 				return 0;
 			}
+			break;
+		}
+not_relative_path:
+
+		/* use include_path */
+		if (xc_stat(filename, PG(include_path), pbuf TSRMLS_CC) != 0) {   
+			return 0;
 		}
 	} while (0);
@@ -607,4 +627,8 @@
 		cache->clogs ++; /* is it safe here? */
 		return origin_compile_file(h, type TSRMLS_CC);
+	}
+
+	if (php_check_open_basedir(filename TSRMLS_CC) != 0) {
+		return NULL;
 	}
 
@@ -1720,14 +1744,36 @@
 /* }}} */
 
-/* signal handler */
-static void (*original_sigsegv_handler)(int) = NULL;
-static void xcache_sigsegv_handler(int sig) /* {{{ */
-{
-	if (original_sigsegv_handler != xcache_sigsegv_handler) {
-		signal(SIGSEGV, original_sigsegv_handler);
-	}
-	else {
-		signal(SIGSEGV, SIG_DFL);
-	}
+/* old signal handlers {{{ */
+typedef void (*xc_sighandler_t)(int);
+#define FOREACH_SIG(sig) static xc_sighandler_t old_##sig##_handler = NULL
+#include "foreachcoresig.h"
+#undef FOREACH_SIG
+/* }}} */
+static void xcache_signal_handler(int sig);
+static void xcache_restore_signal_handler() /* {{{ */
+{
+#define FOREACH_SIG(sig) do { \
+	if (old_##sig##_handler != xcache_signal_handler) { \
+		signal(sig, old_##sig##_handler); \
+	} \
+	else { \
+		signal(sig, SIG_DFL); \
+	} \
+} while (0)
+#include "foreachcoresig.h"
+#undef FOREACH_SIG
+}
+/* }}} */
+static void xcache_init_signal_handler() /* {{{ */
+{
+#define FOREACH_SIG(sig) \
+	old_##sig##_handler = signal(sig, xcache_signal_handler)
+#include "foreachcoresig.h"
+#undef FOREACH_SIG
+}
+/* }}} */
+static void xcache_signal_handler(int sig) /* {{{ */
+{
+	xcache_restore_signal_handler();
 	if (xc_coredump_dir && xc_coredump_dir[0]) {
 		chdir(xc_coredump_dir);
@@ -1901,5 +1947,5 @@
 
 	if (xc_coredump_dir && xc_coredump_dir[0]) {
-		original_sigsegv_handler = signal(SIGSEGV, xcache_sigsegv_handler);
+		xcache_init_signal_handler();
 	}
 
@@ -1941,5 +1987,5 @@
 
 	if (xc_coredump_dir && xc_coredump_dir[0]) {
-		signal(SIGSEGV, original_sigsegv_handler);
+		xcache_restore_signal_handler();
 	}
 	if (xc_coredump_dir) {
