Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 8, 2014

Conversation

DeepDiver1975
Copy link
Member

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

A new inspection was created.

@butonic
Copy link
Member

butonic commented Jul 8, 2014

👍 great

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

@DeepDiver1975
Copy link
Member 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
Member Author

👍

@ghost
Copy link

ghost commented Jul 8, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/6035/

@DeepDiver1975
Copy link
Member 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
Member Author

@owncloud-bot retest this please

@karlitschek
Copy link
Contributor

looks good 👍

@DeepDiver1975
Copy link
Member Author

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

@DeepDiver1975
Copy link
Member 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
Member Author

backport stable7: c02e95f

@DeepDiver1975
Copy link
Member Author

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

@karlitschek
Copy link
Contributor

yes. backport please

@DeepDiver1975
Copy link
Member Author

backport stable6: 3c3ebd5

@ctjctj
Copy link
Contributor

ctjctj commented Jul 8, 2014

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 notifications@github.com
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.

None yet

6 participants