File php-5.1.2-CVE-2006-3018.patch of Package php

--- ext/session/mod_files.c	2006/01/01 12:50:12	1.100.2.2
+++ ext/session/mod_files.c	2006/04/18 00:31:45	1.100.2.3
@@ -397,10 +397,12 @@
 	if (!ps_files_path_create(buf, sizeof(buf), data, key))
 		return FAILURE;
 	
-	ps_files_close(data);
+	if (data->fd != -1) {
+		ps_files_close(data);
 	
-	if (VCWD_UNLINK(buf) == -1) {
-		return FAILURE;
+		if (VCWD_UNLINK(buf) == -1) {
+			return FAILURE;
+		}
 	}
 
 	return SUCCESS;
openSUSE Build Service is sponsored by