1
0
forked from pool/php-smbclient

- Use _multibuild to also build for php8

- Update to version 1.0.5
  * Fixes possible segfault in php_smb_ops_close.

- Update to version 1.0.4
  * Check if smbc_setOptionProtocols is available, as at least one
    distro might have a libsmbclient that is too old.

- Update to version 1.0.3
  * Add client min/max protocol to streams, and make either min/max
    optional.
- Update to version 1.0.2
  * Introduces smbclient_client_protocols() to set min and max
    protocol for negotiation.

- Upgrade to version 1.0.1
  * Code fixes for PHP 7.4/8, and memory free, ReadTest added,
    Travis build updated, and smbclient_state_init documentation fixed
- Remove patch (upstreamed)
  - 0001-fix-incorrect-deallocation-of-zend_string.patch
- Use php_cfgdir and php_extdir macros to determine location of files

OBS-URL: https://build.opensuse.org/package/show/server:php:extensions/php-smbclient?expand=0&rev=3
This commit is contained in:
Arjen de Korte 2021-02-17 21:41:27 +00:00 committed by Git OBS Bridge
parent 64aa684ef1
commit 12ffd9ae39
8 changed files with 106 additions and 85 deletions

View File

@ -1,36 +0,0 @@
From 8945cd9d07069af37aedd42593638cf6b49c815f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crodriguez@owncloud.com>
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

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>php7</package>
<package>php8</package>
</multibuild>

1
php-smbclient-rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("invalid-spec-name")

66
php-smbclient.changes Normal file
View File

@ -0,0 +1,66 @@
-------------------------------------------------------------------
Wed Feb 17 21:32:51 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- Use _multibuild to also build for php8
-------------------------------------------------------------------
Thu Feb 11 12:30:02 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- Update to version 1.0.5
* Fixes possible segfault in php_smb_ops_close.
-------------------------------------------------------------------
Fri Jan 22 10:06:14 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- Update to version 1.0.4
* Check if smbc_setOptionProtocols is available, as at least one
distro might have a libsmbclient that is too old.
-------------------------------------------------------------------
Thu Jan 21 13:50:35 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- Update to version 1.0.3
* Add client min/max protocol to streams, and make either min/max
optional.
- Update to version 1.0.2
* Introduces smbclient_client_protocols() to set min and max
protocol for negotiation.
-------------------------------------------------------------------
Sun Jan 17 10:36:07 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- Upgrade to version 1.0.1
* Code fixes for PHP 7.4/8, and memory free, ReadTest added,
Travis build updated, and smbclient_state_init documentation fixed
- Remove patch (upstreamed)
- 0001-fix-incorrect-deallocation-of-zend_string.patch
- Use php_cfgdir and php_extdir macros to determine location of files
-------------------------------------------------------------------
Fri Jan 11 13:41:36 UTC 2019 - Cristian Rodríguez <crodriguez@owncloud.com>
- 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

View File

@ -1,7 +1,7 @@
#
# spec file for package php7-smbclient
# spec file for package php-smbclient
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,18 +17,30 @@
%define pkg_name smbclient
Name: php7-smbclient
Version: 1.0.0
%define flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
%define php_name php
ExclusiveArch: do-not-build
%else
%define php_name %{flavor}
%endif
%if 0%{?suse_version} <= 1500
%define php_extdir %(%{__php_config} --extension-dir)
%define php_cfgdir %{_sysconfdir}/%{php_name}/conf.d
%endif
Name: %{php_name}-%{pkg_name}
Version: 1.0.5
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
URL: https://pecl.php.net/package/smbclient
Source: https://pecl.php.net/get/%{pkg_name}-%{version}.tgz
BuildRequires: %{php_name}-devel
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}
@ -40,24 +52,26 @@ 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
%{__phpize}
%configure
make %{?_smp_mflags}
%make_build
%check
make %{?_smp_mflags} test PHP_EXECUTABLE=%{_bindir}/php NO_INTERACTION=1
%make_build 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
%make_install INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{php_cfgdir}
cat > %{buildroot}%{php_cfgdir}/%{pkg_name}.ini << EOF
; comment out next line to disable %{pkg_name} extension in php
extension = %{pkg_name}.so
EOF
%files
%{_libdir}/php7/extensions/%{pkg_name}.so
%config(noreplace) %{_sysconfdir}/php7/conf.d/%{pkg_name}.ini
%config(noreplace) %{php_cfgdir}/%{pkg_name}.ini
%{php_extdir}/%{pkg_name}.so
%changelog

View File

@ -1,28 +0,0 @@
-------------------------------------------------------------------
Fri Jan 11 13:41:36 UTC 2019 - Cristian Rodríguez <crodriguez@owncloud.com>
- 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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c57cd1be108673ada51f9cc14d874a6b24d849d7e817d5e2774c18ebd6a389a5
size 32017

3
smbclient-1.0.5.tgz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70dbd36b5ab362b961b97e2835e857b7e5caaa6a9fa27ca8996feeb1075040ed
size 32993