Pradeeplogme / s3-bash

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

Header file with acl header not included #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a (Unicode UTF-8, Unix LF) header file. Mine is called xamzfile
2. Add one line...
X-Amz-Acl:public-read
...with a unix LF at the end 
3. Include this file with -a when you upload a file

What is the expected output?
I expect the file to be uploaded with a 'public-read' acl

What do you see instead?
Instead the header file seems to be ignored and acl is set to the default
'FULL_CONTROL'

What version of the product are you using? On what operating system?
s3-bash.0.02 on Mac OS X 10.5.2 Leopard

Please provide any additional information below.
I am trying to upload a jpeg file that can be accessed with a browser. My
command is...
./s3-put -v -a xamzfile -k AWSKey -s AWSSecretAccessKeyIdFile -c image/jpeg
-T testpic.jpg /basket/testpic.jpg

...but I can see in the verbose output that the header file 'xamzfile' is
ignored. The output (edited where necessary) is...

* About to connect() to s3.amazonaws.com port 80 (#0)
*   Trying 72.21.211.241... connected
* Connected to s3.amazonaws.com (72.21.211.241) port 80 (#0)
> PUT /basket/testpic.jpg HTTP/1.1
> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3
OpenSSL/0.9.7l zlib/1.2.3
> Host: s3.amazonaws.com
> Accept: */*
> Date: Wed, 30 Apr 2008 01:07:40 +0100
> Authorization: AWS awskeyappearshere
> Content-Type: image/jpeg
> Content-MD5: R5oTDJb129w9g5QmXdJKEg==
> Content-Length: 7519
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< x-amz-id-2: anotherlongawskeyhere
< x-amz-request-id: arequestidhere
< Date: Wed, 30 Apr 2008 00:07:43 GMT
< ETag: "anetaghere"
< Content-Length: 0
< Server: AmazonS3
< 
* Connection #0 to host s3.amazonaws.com left intact
* Closing connection #0

Original issue reported on code.google.com by willis...@gmail.com on 30 Apr 2008 at 12:24

GoogleCodeExporter commented 8 years ago
On my Mac, I had to make these changes to get this to work:

The header file should read like this:
x-amz-acl:public-read

No caps, no spaces.  Then in s3-common-functions on line 251 change FS=": " to 
read FS=":" (delete the 
space)

And, finally, in s3-common-functions, on line 294 change delete FS="\0" 
altogether.

I'm not quite clear on what the authors intended to do with these awk scripts, 
but they didn't do it right!

Original comment by mrjoshua...@gmail.com on 19 Nov 2008 at 9:06

GoogleCodeExporter commented 8 years ago
the attached patch fixes the erratic behavior. even for other headers like 
Expire: ...

Original comment by batl...@gmail.com on 5 Dec 2008 at 3:17

Attachments: