sudip2das / s3-bash

Automatically exported from code.google.com/p/s3-bash
Other
0 stars 0 forks source link

Putting URL entities in destination file breaks put #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to put any file with the following name:
/mybucket/myfile_%24

What is the expected output? What do you see instead?
This file name is legal according to Amazon. I can put files with the same
name using other products (such as S3 Firefox Organizer) without problem.

First, printf complains:

/home/williamsn/aws/s3-common-functions: line 234: printf: `%24': missing
format character

Then, and I suspect as a result of printf's complaint, Amazon complains:

< HTTP/1.1 403 Forbidden
< x-amz-request-id: 02C590F197CA7005
< x-amz-id-2: VSyfUjV9E18eKe2sSt5how3fhSevjylgoz+fzxejaIJ6ITe9WPw2FfzYDo7uZPuP
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Tue, 03 Feb 2009 04:43:41 GMT
< Server: AmazonS3
< 
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we
calculated does not match the signature you provided. Check your key and
signing method.</Message><StringToSignBytes>50 55 54 0a 31 42 32 4d 32 59
38 41 73 67 54 70 67 41 6d 59 37 50 68 43 66 67 3d 3d 0a 74 65 78 74 2f 70
6c 61 69 6e 0a 4d 6f 6e 2c 20 30 32 20 46 65 62 20 32 30 30 39 20 32 32 3a
34 33 3a 34 31 20 2d 30 36 30 30 0a 2f 6c 79 6e 79 72 64 2e 6e 69 63 68 6f
6c 61 73 77 69 6c 6c 69 61 6d 73 2e 6e 65 74 2e 62 61 63 6b 75 70 2f 66 6f
6f 5f 25 32
34</StringToSignBytes><RequestId>02C590F197CA7005</RequestId><HostId>VSyfUjV9E18
eKe2sSt5how3fhSevjylgoz+fzxejaIJ6ITe9WPw2FfzYDo7uZPuP</HostId><SignatureProvided
>09ZgX9qE9vh7So8466M1ht75V8c=</SignatureProvided><StringToSign>PUT
1B2M2Y8AsgTpgAmY7PhCfg==
text/plain
Mon, 02 Feb 2009 22:43:41 -0600
* Connection #0 to host s3.amazonaws.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
/mybucket/myfile_%24</StringToSign><AWSAccessKeyId>0E8E7CPHCA537KEA5M82</AWSAcce
ssKeyId></Error>

What version of the product are you using? On what operating system?
Version 0.02
SuSE Linux 10.3

Please provide any additional information below.

Original issue reported on code.google.com by admin%dn...@gtempaccount.com on 3 Feb 2009 at 4:49

GoogleCodeExporter commented 8 years ago
Here's how I fixed this bug:

printf was complaining on line 234 of s3-common-functions, so I changed line 
234 from:

printf "$urlPath" >> "$outputFile"

to:

echo -n "$urlPath" >> "$outputFile"

And that cleared it right up. You can put files with (and still without) special
entities in them now.

Original comment by admin%dn...@gtempaccount.com on 3 Feb 2009 at 6:55