Package: php-clamavlib Version: 0.12a-3 Severity: normal Tags: patch Hi,
Attached is the diff for my php-clamavlib 0.12a-3.1 NMU. The patch that closed #409695 was incomplete - this is a better one. Thanks, -- ----------------------------------------------------------------- | ,''`. Stephen Gran | | : :' : [EMAIL PROTECTED] | | `. `' Debian user, admin, and developer | | `- http://www.debian.org | -----------------------------------------------------------------
diff -u php-clamavlib-0.12a/debian/README.Debian php-clamavlib-0.12a/debian/README.Debian --- php-clamavlib-0.12a/debian/README.Debian +++ php-clamavlib-0.12a/debian/README.Debian @@ -45,23 +45,6 @@ virusname: This parameter is used to retrieve the virusname if a virus was found. retcode: This parameter is used to retrieve the return code of the cl_scanfile API function. -string cl_scanbuff(); - Description: - Scan a file given a string buffer. - Parameters: - buffer: string buffer to be scanned. - Return value: - Returns the name of the virus if this is found and returns null when no virus is found. - -string cl_scanbuff_ex(string buffer, int size_buffer, string virusname, int retcode); - Description: - Scan a file given a string buffer (extended version), returns the virusname and return code of the 'cl_scanfile()' API function.. - Parameters: - buffer: string buffer to be scanned. - size_buffer: size of the buffer. - virusname: This parameter is used to retrieve the virusname if a virus was found - retcode: This parameter is used to retrieve the return code of the cl_scanfile API functio - string cl_pretcode(int retcode); Description: Translates the ClamAV return code. @@ -72,7 +55,6 @@ Returns a string with the return code description. Compatibility functions: -string clam_scan_buffer(string buffer); string clam_scan_file(string filename); string clam_get_version() diff -u php-clamavlib-0.12a/debian/changelog php-clamavlib-0.12a/debian/changelog --- php-clamavlib-0.12a/debian/changelog +++ php-clamavlib-0.12a/debian/changelog @@ -1,3 +1,11 @@ +php-clamavlib (0.12a-3.1) unstable; urgency=low + + * Non-maintainer upload. + * Finish fixing breakage caused by new clamav API. This also removes all + the scanbuff functions + + -- Stephen Gran <[EMAIL PROTECTED]> Wed, 28 Feb 2007 00:53:07 +0000 + php-clamavlib (0.12a-3) unstable; urgency=low * Added: German translation (Closes: #407692) (Helge Kreutzmann) diff -u php-clamavlib-0.12a/clamav.c php-clamavlib-0.12a/clamav.c --- php-clamavlib-0.12a/clamav.c +++ php-clamavlib-0.12a/clamav.c @@ -60,12 +60,12 @@ function_entry clamav_functions[] = { PHP_FE(cl_info, NULL) PHP_FE(cl_scanfile, NULL) - PHP_FE(cl_scanbuff, NULL) + /* PHP_FE(cl_scanbuff, NULL) */ PHP_FE(cl_setlimits, NULL) PHP_FE(cl_scanfile_ex, third_and_fourth_args_force_ref) - PHP_FE(cl_scanbuff_ex, third_and_fourth_args_force_ref) + /* PHP_FE(cl_scanbuff_ex, third_and_fourth_args_force_ref) */ PHP_FE(cl_pretcode, NULL) - PHP_FE(clam_scan_buffer, NULL) /* compatibility */ + /* PHP_FE(clam_scan_buffer, NULL) compatibility */ PHP_FE(clam_scan_file, NULL) /* compatibility */ PHP_FE(clam_get_version, NULL) /* compatibility */ {NULL, NULL, NULL} /* Must be the last line in clamav_functions[] */ @@ -144,8 +144,8 @@ int ret; /* return value */ /* database loading */ - if ((ret = cl_loaddbdir(CLAMAV_G(dbpath), &root, &sig_num))) { - php_error(E_WARNING, "cl_loaddbdir: failed\n"); + if ((ret = cl_load(CLAMAV_G(dbpath), &root, &sig_num, CL_DB_STDOPT))) { + php_error(E_WARNING, "cl_load: failed\n"); return FAILURE; } @@ -290,10 +290,10 @@ root = NULL; sig_num = 0; - if ((ret = cl_loaddbdir(CLAMAV_G(dbpath), &root, - &sig_num))) + if ((ret = cl_load(CLAMAV_G(dbpath), &root, + &sig_num, CL_DB_STDOPT))) { - php_error(E_WARNING, "cl_loaddbdir: %s\n", cl_strerror(ret)); + php_error(E_WARNING, "cl_load: %s\n", cl_strerror(ret)); return FAILURE; } @@ -368,22 +368,22 @@ /* }}} */ -/* {{{ php_cl_scanbuff() */ +/* {{{ php_cl_scanbuff() static void php_cl_scanbuff(INTERNAL_FUNCTION_PARAMETERS, int compat) { const int NUM_ARGS = 1; - char *buffer; /* buffer to be scanned */ - int buffer_len; /* length of the string */ - int ret; /* clamav functions return value */ - const char *virname; + char *buffer; // buffer to be scanned + int buffer_len; // length of the string + int ret; // clamav functions return value + const char *virname; - /* argument checking */ + // argument checking if (ZEND_NUM_ARGS() != NUM_ARGS) { WRONG_PARAM_COUNT; return FAILURE; } - /* argument parsing */ + // argument parsing if (zend_parse_parameters(NUM_ARGS TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) { return FAILURE; } @@ -400,7 +400,7 @@ } } -/* }}} */ + }}} */ /* {{{ php_cl_info() */ @@ -439,14 +439,14 @@ /* }}} */ /* {{{ proto string cl_scanbuff(string buffer) - Scans a buffer, given a string (buffer). This function is not fully tested */ + Scans a buffer, given a string (buffer). This function is not fully tested PHP_FUNCTION(cl_scanbuff) { php_cl_scanbuff(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } -/* }}} */ + }}} */ /* {{{ proto void cl_setlimits(int maxfiles, int maxfilesize, int maxreclevel, int maxratio, int archivememlim) @@ -548,20 +548,20 @@ /* {{{ proto int cl_scanbuff_ex(string buff, int buffsize, string virusname, int retcode) Scans a buffer, given a string buffer.It returns the virus name - (if it was found) and the ClamAV return code */ + (if it was found) and the ClamAV return code PHP_FUNCTION(cl_scanbuff_ex) { - /* number of arguments */ + // number of arguments const int NUM_ARGS = 4; - /* parameters */ + // parameters zval *buff; zval *buff_size; zval *virusname; zval *retcode; - /* used for cl_scanfile function */ + // used for cl_scanfile function char *virname = NULL; int ret; @@ -570,36 +570,36 @@ RETURN_FALSE; } - /* parameters parsing */ + // parameters parsing if (zend_parse_parameters(NUM_ARGS TSRMLS_CC, "zzzz", &buff, &buff_size, &virusname, &retcode) != SUCCESS) { WRONG_PARAM_COUNT; RETURN_FALSE; } - /* parameter conversion */ + // parameter conversion convert_to_string_ex(&buff); convert_to_long_ex(&buff_size); - /* clean up old values first */ + // clean up old values first zval_dtor(virusname); zval_dtor(retcode); - /* executing the ClamAV virus checking function */ + // executing the ClamAV virus checking function ret = cl_scanbuff(Z_STRVAL_P(buff), Z_LVAL_P(buff_size), &virname, root); - /* copy the value of the cl_scanfile return value */ + // copy the value of the cl_scanfile return value ZVAL_LONG(retcode, ret); - /* copy the value of the cl_scanfile virusname if a virus was found */ + // copy the value of the cl_scanfile virusname if a virus was found if (ret == CL_VIRUS) ZVAL_STRING(virusname, virname, 1); RETURN_TRUE; } -/* }}} */ + }}} */ /* {{{ proto string cl_pretcode(int retcode) Translates the ClamAV return code */ @@ -707,14 +707,14 @@ /* compatibility functions */ -/* {{{ proto string clam_scan_buffer($buffer) */ +/* {{{ proto string clam_scan_buffer($buffer) PHP_FUNCTION(clam_scan_buffer) { php_cl_scanbuff(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); return SUCCESS; } -/* }}} */ + }}} */ /* {{{ proto string clam_scan_file($filename) */ only in patch2: unchanged: --- php-clamavlib-0.12a.orig/php_clamav.h +++ php-clamavlib-0.12a/php_clamav.h @@ -49,14 +49,14 @@ /* functions */ PHP_FUNCTION(cl_info); PHP_FUNCTION(cl_scanfile); -PHP_FUNCTION(cl_scanbuff); +/* PHP_FUNCTION(cl_scanbuff); */ PHP_FUNCTION(cl_setlimits); PHP_FUNCTION(cl_scanfile_ex); -PHP_FUNCTION(cl_scanbuff_ex); +/* PHP_FUNCTION(cl_scanbuff_ex); */ PHP_FUNCTION(cl_pretcode); /* compatibility functions */ -PHP_FUNCTION(clam_scan_buffer); +/* PHP_FUNCTION(clam_scan_buffer); */ PHP_FUNCTION(clam_scan_file); PHP_FUNCTION(clam_get_version);
signature.asc
Description: Digital signature