Skip to content

Fix Signiture Does Not Match when mounting Amazon S3 external storage - #9509

Merged
DeepDiver1975 merged 1 commit into
masterfrom
ctjctj-fix_amazons3
Jul 8, 2014
Merged

DeepDiver1975 merged 1 commit into
masterfrom
ctjctj-fix_amazons3

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

For some reason the aws-sdk-php package does not caclulate the
signiture correctly when accessing an object in a bucket with a name of
'.'.

When we are at the top of a S3 bucket there is a need(?) to have a directory
name. Per standard Unix the name picked was '.' (dot or period). This
choice exercises the aws-sdk bug.

This fix is to add a field to the method to store the name to use instead of
'.' which at this point is hard coded to ''. We also add a private
function 'cleanKey()' which will test for the '.' name and replace it with
the variable. Finally all calls to manipulate objects where the path is
not obviously not '.' are processed through cleanKey().

An example where we don't process through clean key would be
'Key' => $path.'/',

Use correct relationship operator

Per feed back use === instead of ==

use '/' instead of ''

For some reason the aws-sdk-php package does not caclulate the
signiture correctly when accessing an object in a bucket with a name of
'.'.

When we are at the top of a S3 bucket there is a need(?) to have a directory
name.  Per standard Unix the name picked was '.' (dot or period).  This
choice exercises the aws-sdk bug.

This fix is to add a field to the method to store the name to use instead of
'.' which at this point is hard coded to '<root>'.  We also add a private
function 'cleanKey()' which will test for the '.' name and replace it with
the variable.  Finally all calls to manipulate objects where the path is
not obviously not '.' are processed through cleanKey().

An example where we don't process through clean key would be
	'Key' => $path.'/',

Use correct relationship operator

Per feed back use === instead of ==

use '/' instead of '<root>'
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@butonic

butonic commented Jul 8, 2014

Copy link
Copy Markdown
Contributor

👍 great

@ctjctj would be nice to hear if '/' works for you as well

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

Tested here as well

  • upload to s3 root
  • create folder in root
  • create file in root
  • upload to folder
  • create file in folder
  • create folder in folder

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

👍

@ghost

ghost commented Jul 8, 2014

Copy link
Copy Markdown

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

WTF

00:41:55.428 .............................../autotest.sh: line 136:  3686 Segmentation fault      $PHPUNIT --configuration phpunit-autotest.xml --log-junit autotest-results-$1.xml --coverage-clover autotest-clover-$1.xml --coverage-html coverage-html-$1 $2 $3

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@karlitschek

Copy link
Copy Markdown
Contributor

looks good 👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

Unit test execution can be ignored - files_external is untested by jenkins -> merge

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@karlitschek I'll prepare the backport

DeepDiver1975 added a commit that referenced this pull request Jul 8, 2014
Fix Signiture Does Not Match when mounting Amazon S3 external storage
@DeepDiver1975
DeepDiver1975 merged commit 46ba08a into master Jul 8, 2014
@DeepDiver1975
DeepDiver1975 deleted the ctjctj-fix_amazons3 branch July 8, 2014 12:25
@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

backport stable7: c02e95f

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@karlitschek @craigpg according to #6724 this issue applies to oc6 as well - I'll backport - ok?

@karlitschek

Copy link
Copy Markdown
Contributor

yes. backport please

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

backport stable6: 3c3ebd5

@ctjctj

ctjctj commented Jul 8, 2014

Copy link
Copy Markdown
Contributor

Thank you everybody for your work on this. Fortunately for me I went from
being unemployed to fully employed and have not had time to get back to
this. Again thank you all.

On Tue, Jul 8, 2014 at 9:08 AM, Thomas Müller [email protected]
wrote:

backport stable6: 3c3ebd5
3c3ebd5

—
Reply to this email directly or view it on GitHub
#9509 (comment).

@PVince81 PVince81 mentioned this pull request Jul 10, 2014
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants