From 2f5dc746811d449d4dc489c1abfa2c1f2f1becf2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 29 Dec 2020 08:01:28 +0100 Subject: update to 1.0.1 drop patches merged upstream --- .gitignore | 2 ++ 65.patch | 42 ---------------------- 73.patch | 101 ----------------------------------------------------- PHPINFO | 4 +-- REFLECTION | 62 ++++++++++++++++---------------- php-smbclient.spec | 20 ++++------- 6 files changed, 41 insertions(+), 190 deletions(-) delete mode 100644 65.patch delete mode 100644 73.patch diff --git a/.gitignore b/.gitignore index 969b846..0137d58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ +clog libsmbclient-php-phpunit.xml package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/65.patch b/65.patch deleted file mode 100644 index 43fed80..0000000 --- a/65.patch +++ /dev/null @@ -1,42 +0,0 @@ -From d3afedb016aa319246177a3c516ca4804f08dd45 Mon Sep 17 00:00:00 2001 -From: Remi Collet -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/73.patch b/73.patch deleted file mode 100644 index 28ab97d..0000000 --- a/73.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 951f266b04c381a13d33d6445abe5d15c3fd8c53 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 1 Sep 2020 09:57:04 +0200 -Subject: [PATCH 1/2] fix for changes in stream in 7.4 - ---- - smb_streams.c | 23 ++++++++++++++++++++++- - 1 file changed, 22 insertions(+), 1 deletion(-) - -diff --git a/smb_streams.c b/smb_streams.c -index b6f73c6..8448dd6 100644 ---- a/smb_streams.c -+++ b/smb_streams.c -@@ -190,7 +190,11 @@ static int php_smb_ops_flush(php_stream *stream TSRMLS_DC) - return 0; - } - -+#if PHP_VERSION_ID < 70400 - static size_t php_smb_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -+#else -+static ssize_t php_smb_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -+#endif - { - ssize_t n = 0; - STREAM_DATA_FROM_STREAM(); -@@ -208,12 +212,20 @@ static size_t php_smb_ops_read(php_stream *stream, char *buf, size_t count TSRML - if (n == 0 || n < (ssize_t)count) { - stream->eof = 1; - } -+#if PHP_VERSION_ID < 70400 - return (n < 1 ? 0 : (size_t)n); -+#else -+ return n; -+#endif - } - -+#if PHP_VERSION_ID < 70400 - static size_t php_smb_ops_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -+#else -+static ssize_t php_smb_ops_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -+#endif - { -- size_t len = 0; -+ ssize_t len = 0; - STREAM_DATA_FROM_STREAM(); - - if (!self || !self->handle) { -@@ -225,7 +237,12 @@ static size_t php_smb_ops_write(php_stream *stream, const char *buf, size_t coun - if (self->smbc_write) { - len = self->smbc_write(self->state->ctx, self->handle, buf, count); - } -+ -+#if PHP_VERSION_ID < 70400 -+ return (len < 0 ? 0 : (size_t)len); -+#else - return len; -+#endif - } - - static int php_smb_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ -@@ -500,7 +517,11 @@ static int php_smbdir_ops_close(php_stream *stream, int close_handle TSRMLS_DC) - return EOF; - } - -+#if PHP_VERSION_ID < 70400 - static size_t php_smbdir_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -+#else -+static ssize_t php_smbdir_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -+#endif - { - struct smbc_dirent *dirent; - php_stream_dirent *ent = (php_stream_dirent*)buf; - -From 93c27f7c7680110b130641cf874207625bcc454a Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 1 Sep 2020 09:57:20 +0200 -Subject: [PATCH 2/2] fix for upcoming PHP 8 - ---- - php_smbclient.h | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/php_smbclient.h b/php_smbclient.h -index ee17501..6b26ebe 100644 ---- a/php_smbclient.h -+++ b/php_smbclient.h -@@ -128,6 +128,14 @@ PHP_FUNCTION(smbclient_fstatvfs); - #endif - #endif - -+#if PHP_MAJOR_VERSION >= 8 -+#define TSRMLS_D void -+#define TSRMLS_DC -+#define TSRMLS_C -+#define TSRMLS_CC -+#define TSRMLS_FETCH() -+#endif -+ - extern php_stream_wrapper php_stream_smb_wrapper; - php_smbclient_state * php_smbclient_state_new (php_stream_context *context, int init TSRMLS_DC); - void php_smbclient_state_free (php_smbclient_state *state TSRMLS_DC); diff --git a/PHPINFO b/PHPINFO index 73362c2..d1c6527 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,5 +2,5 @@ smbclient smbclient Support => enabled -smbclient extension Version => 1.0.0 -libsmbclient library Version => 4.9.4 +smbclient extension Version => 1.0.1 +libsmbclient library Version => 4.13.3 diff --git a/REFLECTION b/REFLECTION index 1513da2..66e66b0 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,36 +1,36 @@ -Extension [ extension #138 smbclient version 1.0.0 ] { +Extension [ extension #118 smbclient version 1.0.1 ] { - Constants [30] { - Constant [ integer SMBCLIENT_XATTR_CREATE ] { 1 } - Constant [ integer SMBCLIENT_XATTR_REPLACE ] { 2 } - Constant [ integer SMBCLIENT_OPT_OPEN_SHAREMODE ] { 1 } - Constant [ integer SMBCLIENT_OPT_ENCRYPT_LEVEL ] { 2 } - Constant [ integer SMBCLIENT_OPT_CASE_SENSITIVE ] { 3 } - Constant [ integer SMBCLIENT_OPT_BROWSE_MAX_LMB_COUNT ] { 4 } - Constant [ integer SMBCLIENT_OPT_URLENCODE_READDIR_ENTRIES ] { 5 } - Constant [ integer SMBCLIENT_OPT_USE_KERBEROS ] { 6 } - Constant [ integer SMBCLIENT_OPT_FALLBACK_AFTER_KERBEROS ] { 7 } - Constant [ integer SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN ] { 8 } - Constant [ integer SMBCLIENT_OPT_USE_CCACHE ] { 9 } - Constant [ integer SMBCLIENT_OPT_USE_NT_HASH ] { 10 } - Constant [ integer SMBCLIENT_OPT_NETBIOS_NAME ] { 11 } - Constant [ integer SMBCLIENT_OPT_WORKGROUP ] { 12 } - Constant [ integer SMBCLIENT_OPT_USER ] { 13 } - Constant [ integer SMBCLIENT_OPT_PORT ] { 14 } - Constant [ integer SMBCLIENT_OPT_TIMEOUT ] { 15 } - Constant [ integer SMBCLIENT_SHAREMODE_DENY_DOS ] { 0 } - Constant [ integer SMBCLIENT_SHAREMODE_DENY_ALL ] { 1 } - Constant [ integer SMBCLIENT_SHAREMODE_DENY_WRITE ] { 2 } - Constant [ integer SMBCLIENT_SHAREMODE_DENY_READ ] { 3 } - Constant [ integer SMBCLIENT_SHAREMODE_DENY_NONE ] { 4 } - Constant [ integer SMBCLIENT_SHAREMODE_DENY_FCB ] { 7 } - Constant [ integer SMBCLIENT_ENCRYPTLEVEL_NONE ] { 0 } - Constant [ integer SMBCLIENT_ENCRYPTLEVEL_REQUEST ] { 1 } - Constant [ integer SMBCLIENT_ENCRYPTLEVEL_REQUIRE ] { 2 } - Constant [ integer SMBCLIENT_VFS_RDONLY ] { 1 } - Constant [ integer SMBCLIENT_VFS_DFS ] { 268435456 } - Constant [ integer SMBCLIENT_VFS_CASE_INSENSITIVE ] { 536870912 } - Constant [ integer SMBCLIENT_VFS_NO_UNIXCIFS ] { 1073741824 } + Constant [ int SMBCLIENT_XATTR_CREATE ] { 1 } + Constant [ int SMBCLIENT_XATTR_REPLACE ] { 2 } + Constant [ int SMBCLIENT_OPT_OPEN_SHAREMODE ] { 1 } + Constant [ int SMBCLIENT_OPT_ENCRYPT_LEVEL ] { 2 } + Constant [ int SMBCLIENT_OPT_CASE_SENSITIVE ] { 3 } + Constant [ int SMBCLIENT_OPT_BROWSE_MAX_LMB_COUNT ] { 4 } + Constant [ int SMBCLIENT_OPT_URLENCODE_READDIR_ENTRIES ] { 5 } + Constant [ int SMBCLIENT_OPT_USE_KERBEROS ] { 6 } + Constant [ int SMBCLIENT_OPT_FALLBACK_AFTER_KERBEROS ] { 7 } + Constant [ int SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN ] { 8 } + Constant [ int SMBCLIENT_OPT_USE_CCACHE ] { 9 } + Constant [ int SMBCLIENT_OPT_USE_NT_HASH ] { 10 } + Constant [ int SMBCLIENT_OPT_NETBIOS_NAME ] { 11 } + Constant [ int SMBCLIENT_OPT_WORKGROUP ] { 12 } + Constant [ int SMBCLIENT_OPT_USER ] { 13 } + Constant [ int SMBCLIENT_OPT_PORT ] { 14 } + Constant [ int SMBCLIENT_OPT_TIMEOUT ] { 15 } + Constant [ int SMBCLIENT_SHAREMODE_DENY_DOS ] { 0 } + Constant [ int SMBCLIENT_SHAREMODE_DENY_ALL ] { 1 } + Constant [ int SMBCLIENT_SHAREMODE_DENY_WRITE ] { 2 } + Constant [ int SMBCLIENT_SHAREMODE_DENY_READ ] { 3 } + Constant [ int SMBCLIENT_SHAREMODE_DENY_NONE ] { 4 } + Constant [ int SMBCLIENT_SHAREMODE_DENY_FCB ] { 7 } + Constant [ int SMBCLIENT_ENCRYPTLEVEL_NONE ] { 0 } + Constant [ int SMBCLIENT_ENCRYPTLEVEL_REQUEST ] { 1 } + Constant [ int SMBCLIENT_ENCRYPTLEVEL_REQUIRE ] { 2 } + Constant [ int SMBCLIENT_VFS_RDONLY ] { 1 } + Constant [ int SMBCLIENT_VFS_DFS ] { 268435456 } + Constant [ int SMBCLIENT_VFS_CASE_INSENSITIVE ] { 536870912 } + Constant [ int SMBCLIENT_VFS_NO_UNIXCIFS ] { 1073741824 } } - Functions { diff --git a/php-smbclient.spec b/php-smbclient.spec index ce97d31..c50c817 100644 --- a/php-smbclient.spec +++ b/php-smbclient.spec @@ -35,11 +35,11 @@ %global with_tests 0%{?_with_tests:1} Name: %{?sub_prefix}php-smbclient -Version: 1.0.0 +Version: 1.0.1 %if 0%{?gh_date} Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif Summary: PHP wrapper for libsmbclient @@ -55,9 +55,6 @@ 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 -Patch1: https://patch-diff.githubusercontent.com/raw/eduardok/libsmbclient-php/pull/73.patch - BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear @@ -106,12 +103,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter private shared -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif - %description %{pecl_name} is a PHP extension that uses Samba's libsmbclient @@ -136,9 +127,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr65 -%patch1 -p1 -b .pr73 - # 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 @@ -256,6 +244,10 @@ fi %changelog +* Tue Dec 29 2020 Remi Collet - 1.0.1-1 +- update to 1.0.1 +- drop patches merged upstream + * Wed Sep 30 2020 Remi Collet - 1.0.0-9 - rebuild for PHP 8.0.0RC1 -- cgit