From 64aa684ef13462782d379b063a2746c204539a6574afb8aebe48a8f5f93881ad Mon Sep 17 00:00:00 2001 From: Arjen de Korte Date: Wed, 17 Feb 2021 21:28:44 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/server:php:extensions/php-smbclient?expand=0&rev=2 --- .gitattributes | 23 +++++++ .gitignore | 1 + ...ncorrect-deallocation-of-zend_string.patch | 36 +++++++++++ php7-smbclient.changes | 28 +++++++++ php7-smbclient.spec | 63 +++++++++++++++++++ smbclient-1.0.0.tgz | 3 + 6 files changed, 154 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-fix-incorrect-deallocation-of-zend_string.patch create mode 100644 php7-smbclient.changes create mode 100644 php7-smbclient.spec create mode 100644 smbclient-1.0.0.tgz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-fix-incorrect-deallocation-of-zend_string.patch b/0001-fix-incorrect-deallocation-of-zend_string.patch new file mode 100644 index 0000000..592ca3e --- /dev/null +++ b/0001-fix-incorrect-deallocation-of-zend_string.patch @@ -0,0 +1,36 @@ +From 8945cd9d07069af37aedd42593638cf6b49c815f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +Date: Fri, 11 Jan 2019 10:24:50 -0300 +Subject: [PATCH] fix incorrect deallocation of zend_string + +zend_strings are to be zend_string_release'd and emalloc'ed +memory efree'd. +--- + smbclient.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/smbclient.c b/smbclient.c +index 81ebd5a..bae1d54 100644 +--- a/smbclient.c ++++ b/smbclient.c +@@ -1345,15 +1345,16 @@ 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); ++ efree(buf); + #endif + } +- efree(buf); + 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; +-- +2.20.1 + diff --git a/php7-smbclient.changes b/php7-smbclient.changes new file mode 100644 index 0000000..714b37a --- /dev/null +++ b/php7-smbclient.changes @@ -0,0 +1,28 @@ +------------------------------------------------------------------- +Fri Jan 11 13:41:36 UTC 2019 - Cristian Rodríguez + +- Upgrade to version 1.0.0 (boo#1123503) + * stream optimization: reuse previous connections (Remi) +- 0001-fix-incorrect-deallocation-of-zend_string.patch: zend_strings + are to be zend_string_release()'ed not efree()'ed. + +------------------------------------------------------------------- +Thu Dec 20 16:48:09 UTC 2018 - jweberhofer@weberhofer.at + +- Added php7-smbclient-fix_for_PHP_7.3.patch to allow building with PHP 7.3 + as discussed in gh#eduardok/libsmbclient-php#60 + +------------------------------------------------------------------- +Mon Jul 23 09:50:15 UTC 2018 - idonmez@suse.com + +- Cleanup with spec-cleaner + +------------------------------------------------------------------- +Tue Mar 27 23:55:54 UTC 2018 - crrodriguez@opensuse.org + +- Build module with -fvisibility=hidden + +------------------------------------------------------------------- +Mon Nov 20 15:15:07 UTC 2017 - crrodriguez@opensuse.org + +- Initial version for php 7 diff --git a/php7-smbclient.spec b/php7-smbclient.spec new file mode 100644 index 0000000..94295dd --- /dev/null +++ b/php7-smbclient.spec @@ -0,0 +1,63 @@ +# +# spec file for package php7-smbclient +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define pkg_name smbclient +Name: php7-smbclient +Version: 1.0.0 +Release: 0 +Summary: A PHP wrapper for libsmbclient +License: PHP-3.01 +Group: Productivity/Networking/Web/Servers +URL: http://pecl.php.net/package/smbclient +Source: http://pecl.php.net/get/%{pkg_name}-%{version}.tgz +BuildRequires: php7-devel >= 7.0 +BuildRequires: pkgconfig +BuildRequires: pkgconfig(smbclient) +Patch0: 0001-fix-incorrect-deallocation-of-zend_string.patch +Requires: php(api) = %{php_core_api} +Requires: php(zend-abi) = %{php_zend_api} +Provides: php-smbclient = %{version} +Obsoletes: php-smbclient < %{version} + +%description +smbclient is a PHP extension that uses Samba's libsmbclient library to provide +Samba related functions and 'smb' streams to PHP programs. + +%prep +%setup -q -n %{pkg_name}-%{version} +%patch0 -p1 +%build +export CFLAGS="%{optflags} -fvisibility=hidden" +%{_bindir}/phpize +%configure +make %{?_smp_mflags} + +%check +make %{?_smp_mflags} test PHP_EXECUTABLE=%{_bindir}/php NO_INTERACTION=1 + +%install +make install INSTALL_ROOT=%{buildroot} +mkdir -p %{buildroot}%{_sysconfdir}/php7/conf.d +echo "; comment out next line to disable smbclient extension in php" > %{buildroot}%{_sysconfdir}/php7/conf.d/%{pkg_name}.ini +echo 'extension = smbclient.so' >> %{buildroot}%{_sysconfdir}/php7/conf.d/%{pkg_name}.ini + +%files +%{_libdir}/php7/extensions/%{pkg_name}.so +%config(noreplace) %{_sysconfdir}/php7/conf.d/%{pkg_name}.ini + +%changelog diff --git a/smbclient-1.0.0.tgz b/smbclient-1.0.0.tgz new file mode 100644 index 0000000..11d2e55 --- /dev/null +++ b/smbclient-1.0.0.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c57cd1be108673ada51f9cc14d874a6b24d849d7e817d5e2774c18ebd6a389a5 +size 32017