From e6a5c9f77406f3f53de158c2a65afdcb925d6896 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Wed, 23 Oct 2019 13:07:26 +0300 Subject: [PATCH 1/2] Do not encode path separator --- changelog/unreleased/36319 | 5 +++++ lib/private/LargeFileHelper.php | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/36319 diff --git a/changelog/unreleased/36319 b/changelog/unreleased/36319 new file mode 100644 index 000000000000..1238f4086c59 --- /dev/null +++ b/changelog/unreleased/36319 @@ -0,0 +1,5 @@ +Bugfix: LargeFileHelper::getFileSizeViaCurl is broken with newer libcurl + +getFileSizeViaCurl is a workaround for 32 bit platforms. Path separator was encoded when encoding the path but newer libcurl doesn't support that. + +https://github.com/owncloud/core/pull/36319 diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php index 3e4c0e042f13..c35c0db8ade7 100644 --- a/lib/private/LargeFileHelper.php +++ b/lib/private/LargeFileHelper.php @@ -114,7 +114,9 @@ public function getFileSize($filename) { */ public function getFileSizeViaCurl($fileName) { if (\OC::$server->getIniWrapper()->getString('open_basedir') === '') { - $encodedFileName = \rawurlencode($fileName); + $pathParts = \explode('/', $fileName); + $encodedPathParts = \array_map('rawurlencode', $pathParts); + $encodedFileName = \implode('/', $encodedPathParts); $ch = \curl_init("file://$encodedFileName"); \curl_setopt($ch, CURLOPT_NOBODY, true); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); From 40955f0e7680da530d52badd03fa841e6feb51c6 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 24 Oct 2019 14:24:33 +0545 Subject: [PATCH 2/2] disable external samba and windows phpunit tests - issue 36322 --- .drone.starlark | 6 +- .drone.yml | 261 ------------------------------------------------ 2 files changed, 4 insertions(+), 263 deletions(-) diff --git a/.drone.starlark b/.drone.starlark index 47cde708f836..dc630682f73e 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -49,9 +49,11 @@ config = { ], 'externalTypes': [ 'webdav', - 'samba', + # disable - see https://github.com/owncloud/core/issues/36322 + # 'samba', 'sftp', - 'windows', + # disable - see https://github.com/owncloud/core/issues/36322 + # 'windows', 'scality' ], 'coverage': True diff --git a/.drone.yml b/.drone.yml index ca4fb8962620..0d705bbdef55 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2891,141 +2891,6 @@ depends_on: - phan-php7.2 - phan-php7.3 ---- -kind: pipeline -type: docker -name: phpunit-php7.1-sqlite-samba - -platform: - os: linux - arch: amd64 - -workspace: - base: /drone - path: src - -steps: -- name: cache-restore - pull: always - image: plugins/s3-cache:1 - settings: - access_key: - from_secret: cache_s3_access_key - endpoint: - from_secret: cache_s3_endpoint - restore: true - secret_key: - from_secret: cache_s3_secret_key - when: - instance: - - drone.owncloud.services - - drone.owncloud.com - -- name: composer-install - pull: always - image: owncloudci/php:7.1 - commands: - - make install-composer-deps - environment: - COMPOSER_HOME: /drone/src/.cache/composer - -- name: vendorbin-install - pull: always - image: owncloudci/php:7.1 - commands: - - make vendor-bin-deps - environment: - COMPOSER_HOME: /drone/src/.cache/composer - -- name: yarn-install - pull: always - image: owncloudci/php:7.1 - commands: - - make install-nodejs-deps - environment: - NPM_CONFIG_CACHE: /drone/src/.cache/npm - YARN_CACHE_FOLDER: /drone/src/.cache/yarn - bower_storage__packages: /drone/src/.cache/bower - -- name: install-server - pull: always - image: owncloudci/php:7.1 - commands: - - bash tests/drone/install-server.sh - - php occ a:l - - php occ config:system:set trusted_domains 1 --value=server - - php occ log:manage --level 2 - - php occ config:list - - php occ security:certificates:import /drone/server.crt - - php occ security:certificates - environment: - DB_TYPE: sqlite - -- name: fix-permissions - pull: always - image: owncloudci/php:7.1 - commands: - - chown -R www-data /drone/src - -- name: owncloud-log-server - pull: always - image: owncloud/ubuntu:18.04 - detach: true - commands: - - tail -f /drone/src/data/owncloud.log - -- name: phpunit-tests - pull: always - image: owncloudci/php:7.1 - commands: - - su-exec www-data bash tests/drone/test-phpunit.sh - environment: - COVERAGE: true - DB_TYPE: sqlite - FILES_EXTERNAL_TYPE: samba - -- name: coverage-upload - pull: always - image: plugins/codecov:2 - settings: - files: - - "*.xml" - flags: - - phpunit - paths: - - tests/output/coverage - environment: - CODECOV_TOKEN: - from_secret: codecov_token - when: - instance: - - drone.owncloud.services - - drone.owncloud.com - -services: -- name: samba - pull: always - image: owncloudci/samba:latest - command: - - -u - - test;test - - -s - - public;/tmp;yes;no;no;test;none;test - - -S - -trigger: - ref: - - refs/pull/** - - refs/tags/** - - refs/heads/master - -depends_on: -- coding-standard-php7.3 -- phpstan-php7.1 -- phan-php7.1 -- phan-php7.2 -- phan-php7.3 - --- kind: pipeline type: docker @@ -3157,130 +3022,6 @@ depends_on: - phan-php7.2 - phan-php7.3 ---- -kind: pipeline -type: docker -name: phpunit-php7.1-sqlite-windows - -platform: - os: linux - arch: amd64 - -workspace: - base: /drone - path: src - -steps: -- name: cache-restore - pull: always - image: plugins/s3-cache:1 - settings: - access_key: - from_secret: cache_s3_access_key - endpoint: - from_secret: cache_s3_endpoint - restore: true - secret_key: - from_secret: cache_s3_secret_key - when: - instance: - - drone.owncloud.services - - drone.owncloud.com - -- name: composer-install - pull: always - image: owncloudci/php:7.1 - commands: - - make install-composer-deps - environment: - COMPOSER_HOME: /drone/src/.cache/composer - -- name: vendorbin-install - pull: always - image: owncloudci/php:7.1 - commands: - - make vendor-bin-deps - environment: - COMPOSER_HOME: /drone/src/.cache/composer - -- name: yarn-install - pull: always - image: owncloudci/php:7.1 - commands: - - make install-nodejs-deps - environment: - NPM_CONFIG_CACHE: /drone/src/.cache/npm - YARN_CACHE_FOLDER: /drone/src/.cache/yarn - bower_storage__packages: /drone/src/.cache/bower - -- name: install-server - pull: always - image: owncloudci/php:7.1 - commands: - - bash tests/drone/install-server.sh - - php occ a:l - - php occ config:system:set trusted_domains 1 --value=server - - php occ log:manage --level 2 - - php occ config:list - - php occ security:certificates:import /drone/server.crt - - php occ security:certificates - environment: - DB_TYPE: sqlite - -- name: fix-permissions - pull: always - image: owncloudci/php:7.1 - commands: - - chown -R www-data /drone/src - -- name: owncloud-log-server - pull: always - image: owncloud/ubuntu:18.04 - detach: true - commands: - - tail -f /drone/src/data/owncloud.log - -- name: phpunit-tests - pull: always - image: owncloudci/php:7.1 - commands: - - su-exec www-data bash tests/drone/test-phpunit.sh - environment: - COVERAGE: true - DB_TYPE: sqlite - FILES_EXTERNAL_TYPE: windows - -- name: coverage-upload - pull: always - image: plugins/codecov:2 - settings: - files: - - "*.xml" - flags: - - phpunit - paths: - - tests/output/coverage - environment: - CODECOV_TOKEN: - from_secret: codecov_token - when: - instance: - - drone.owncloud.services - - drone.owncloud.com - -trigger: - ref: - - refs/pull/** - - refs/tags/** - - refs/heads/master - -depends_on: -- coding-standard-php7.3 -- phpstan-php7.1 -- phan-php7.1 -- phan-php7.2 -- phan-php7.3 - --- kind: pipeline type: docker @@ -14358,9 +14099,7 @@ depends_on: - phpunit-php7.3-sqlite - phpunit-php7.3-mariadb10.2 - phpunit-php7.1-sqlite-webdav -- phpunit-php7.1-sqlite-samba - phpunit-php7.1-sqlite-sftp -- phpunit-php7.1-sqlite-windows - phpunit-php7.1-sqlite-scality - apiAuth-mariadb10.2-php7.1 - apiAuthOcs-mariadb10.2-php7.1