diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 65.patch | 42 | ||||
-rw-r--r-- | php-smbclient.spec | 37 |
3 files changed, 63 insertions, 17 deletions
@@ -1,3 +1,4 @@ +libsmbclient-php-phpunit.xml package-*.xml *.tgz *.tar.gz diff --git a/65.patch b/65.patch new file mode 100644 index 0000000..43fed80 --- /dev/null +++ b/65.patch @@ -0,0 +1,42 @@ +From d3afedb016aa319246177a3c516ca4804f08dd45 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 22 Feb 2019 15:19:18 +0100 +Subject: [PATCH] fix string free + +--- + .gitignore | 2 ++ + smbclient.c | 6 ++++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/smbclient.c b/smbclient.c +index 81ebd5a..faeb505 100644 +--- a/smbclient.c ++++ b/smbclient.c +@@ -1345,15 +1345,17 @@ PHP_FUNCTION(smbclient_read) + + if ((ZSTR_LEN(buf) = smbc_read(state->ctx, file, ZSTR_VAL(buf), count)) >= 0) { + RETURN_STR(buf); ++ } ++ zend_string_release(buf); + #else + void *buf = emalloc(count); + ssize_t nbytes; + + if ((nbytes = smbc_read(state->ctx, file, buf, count)) >= 0) { + RETURN_STRINGL(buf, nbytes, 0); +-#endif + } + efree(buf); ++#endif + switch (state->err = errno) { + case EISDIR: php_error(E_WARNING, "Read error: Is a directory"); break; + case EBADF: php_error(E_WARNING, "Read error: Not a valid file resource or not open for reading"); break; +@@ -1738,7 +1740,7 @@ PHP_FUNCTION(smbclient_removexattr) + PHP_FUNCTION(smbclient_option_get) + { + zend_long option; +- char *ret; ++ const char *ret; + zval *zstate; + php_smbclient_state *state; + diff --git a/php-smbclient.spec b/php-smbclient.spec index 9e8a5aa..45feb6c 100644 --- a/php-smbclient.spec +++ b/php-smbclient.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-smbclient # -# Copyright (c) 2015-2018 Remi Collet +# Copyright (c) 2015-2019 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -37,9 +37,9 @@ Name: %{?sub_prefix}php-smbclient Version: 1.0.0 %if 0%{?gh_date} -Release: 0.5.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 0.7.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif Summary: PHP wrapper for libsmbclient @@ -55,6 +55,8 @@ Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz Source2: %{gh_project}-phpunit.xml %endif +Patch0: https://patch-diff.githubusercontent.com/raw/eduardok/libsmbclient-php/pull/65.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear @@ -83,36 +85,29 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff -%if "%{php_version}" > "5.6" -Obsoletes: php56u-%{pecl_name} <= %{version} -Obsoletes: php56u-pecl-%{pecl_name} <= %{version} -Obsoletes: php56w-%{pecl_name} <= %{version} -Obsoletes: php56w-pecl-%{pecl_name} <= %{version} -%endif %if "%{php_version}" > "7.0" -Obsoletes: php70u-%{pecl_name} <= %{version} Obsoletes: php70u-pecl-%{pecl_name} <= %{version} -Obsoletes: php70w-%{pecl_name} <= %{version} -Obsoletes: php70w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.1" -Obsoletes: php71u-%{pecl_name} <= %{version} Obsoletes: php71u-pecl-%{pecl_name} <= %{version} Obsoletes: php71w-%{pecl_name} <= %{version} Obsoletes: php71w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.2" -Obsoletes: php72u-%{pecl_name} <= %{version} Obsoletes: php72u-pecl-%{pecl_name} <= %{version} Obsoletes: php72w-%{pecl_name} <= %{version} Obsoletes: php72w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.3" -Obsoletes: php73u-%{pecl_name} <= %{version} -Obsoletes: php73u-pecl-%{pecl_name} <= %{version} +Obsoletes: php73-pecl-%{pecl_name} <= %{version} Obsoletes: php73w-%{pecl_name} <= %{version} Obsoletes: php73w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.4" +Obsoletes: php74-pecl-%{pecl_name} <= %{version} +Obsoletes: php74w-%{pecl_name} <= %{version} +Obsoletes: php74w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -145,6 +140,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +#patch0 -p1 -b .pr65 + # Check extension version ver=$(sed -n '/define PHP_SMBCLIENT_VERSION/{s/.* "//;s/".*$//;p}' php_smbclient.h) if test "$ver" != "%{version}%{?prever}%{?gh_date:-dev}"; then @@ -210,7 +207,7 @@ done --modules | grep %{pecl_name} %if %{with_zts} -: Minimal load test for NTS extension +: Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} @@ -262,6 +259,12 @@ fi %changelog +* Tue Jul 23 2019 Remi Collet <remi@remirepo.net> - 1.0.0-3 +- rebuild for 7.4.0beta1 + +* Wed May 29 2019 Remi Collet <remi@remirepo.net> - 1.0.0-2 +- add fix from https://github.com/eduardok/libsmbclient-php/pull/65 + * Wed Dec 26 2018 Remi Collet <remi@remirepo.net> - 1.0.0-1 - update to 1.0.0 |