php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67818
Patch FTBS-issue-67818.patch revision 2016-11-29 09:20 UTC by malorent dot ext at orange dot com

Patch FTBS-issue-67818.patch for crack Bug #67818

Patch version 2016-11-29 09:20 UTC

Return to Bug #67818 | Download this patch
Patch Revisions:

Developer: malorent.ext@orange.com

Index: php-crack-0.4/crack-0.4/crack.c
===================================================================
--- php-crack-0.4.orig/crack-0.4/crack.c	2005-09-21 11:00:06.000000000 +0200
+++ php-crack-0.4/crack-0.4/crack.c	2016-11-29 10:18:07.027509584 +0100
@@ -38,7 +38,7 @@
 
 /* {{{ crack_functions[]
  */
-function_entry crack_functions[] = {
+zend_function_entry crack_functions[] = {
 	PHP_FE(crack_opendict,			NULL)
 	PHP_FE(crack_closedict,			NULL)
 	PHP_FE(crack_check,				NULL)
@@ -96,38 +96,6 @@
 	int filename_len;
 	int result = SUCCESS;
 	
-	if (PG(safe_mode)) {
-		filename_len = strlen(path) + 10;
-		filename = (char *) emalloc(filename_len);
-		if (NULL == filename) {
-			return FAILURE;
-		}
-        
-		memset(filename, '\0', filename_len);
-		strcpy(filename, path);
-		strcat(filename, ".pwd");
-		if (!php_checkuid(filename, "r", CHECKUID_CHECK_FILE_AND_DIR)) {
-			efree(filename);
-			return FAILURE;
-		}
-		
-		memset(filename, '\0', filename_len);
-		strcpy(filename, path);
-		strcat(filename, ".pwi");
-		if (!php_checkuid(filename, "r", CHECKUID_CHECK_FILE_AND_DIR)) {
-			efree(filename);
-			return FAILURE;
-		}
-		
-		memset(filename, '\0', filename_len);
-		strcpy(filename, path);
-		strcat(filename, ".hwm");
-		if (!php_checkuid(filename, "r", CHECKUID_CHECK_FILE_AND_DIR)) {
-			efree(filename);
-			return FAILURE;
-		}
-	}
-	
 	if (php_check_open_basedir(path TSRMLS_CC)) {
 		return FAILURE;
 	}
Index: php-crack-0.4/crack-0.4/libcrack/src/config.h
===================================================================
--- php-crack-0.4.orig/crack-0.4/libcrack/src/config.h	2005-09-21 11:00:06.000000000 +0200
+++ php-crack-0.4/crack-0.4/libcrack/src/config.h	2016-11-29 10:18:07.027509584 +0100
@@ -1,4 +1,4 @@
-#include "../../config.h"
+#include "../config.h"
 #if ZTS
 # define THREADSAFE 1
 #endif
Index: php-crack-0.4/crack-0.4/libcrack/src/cracklib.h
===================================================================
--- php-crack-0.4.orig/crack-0.4/libcrack/src/cracklib.h	2016-11-29 10:17:31.000000000 +0100
+++ php-crack-0.4/crack-0.4/libcrack/src/cracklib.h	2016-11-29 10:18:07.035509634 +0100
@@ -24,46 +24,30 @@
 #endif
 
 #ifdef HAVE_CONFIG_H
-# include "../../config.h"
+# include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef IN_CRACKLIB
-# define MALLOC(x)                          (malloc(x))
-# define FREE(x)                            (free(x))
-#else
+#if HAVE_CRACK_BUNDLED || defined(WIN32)
 # include "php.h"
 # include "php_ini.h"
 # include "ext/standard/info.h"
 # include "../../php_crack.h"
 # define MALLOC(x)                          (emalloc(x))
 # define FREE(x)                            (efree(x))
-#endif
-
-#ifdef HAVE_U_INT8_T
-typedef u_int8_t int8;
-#else
-typedef unsigned char int8;
-#endif
-
-#ifdef HAVE_U_INT16_T
-typedef u_int16_t int16;
+#elif defined(IN_CRACKLIB)
+# define MALLOC(x)                          (malloc(x))
+# define FREE(x)                            (free(x))
 #else
-typedef unsigned short int int16;
-#endif
-
-#ifdef HAVE_U_INT32_T
-typedef u_int32_t int32;
-#else
-typedef unsigned int int32;
+# error not available yet
 #endif
 
 #define STRINGSIZE                          1024
 #define TRUNCSTRINGSIZE                     (STRINGSIZE/4)
 
+typedef unsigned char int8;
+typedef unsigned short int int16;
+typedef unsigned int int32;
+
 #ifndef NUMWORDS
 # define NUMWORDS                           16
 #endif
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC