I think that when I run "s3cmd sync s3://bucket/ ./", permissios are not set correctly (-rwxr-xr-x). I see this at Ubuntu host.
Show the bug, note perrmissions of file hello-s3cmd.txt are set to 775, that means, file is "executable".
I like that s3cmd prevented file timestamp.
$ s3cmd --version
s3cmd version 2.0.2
$ s3cmd sync s3://s3cmd-bug-demo-us-east-1/ ./
download: 's3://s3cmd-bug-demo-us-east-1/hello-s3cmd.txt' -> './hello-s3cmd.txt' [1 of 1]
66 of 66 100% in 0s 490.15 B/s done
Done. Downloaded 66 bytes in 1.0 seconds, 66.00 B/s.
$ ls -l
-rwxrwxr-x 1 user user 66 Oct 3 09:18 hello-s3cmd.txt
delete the file from local filesystem
$ rm hello-s3cmd.txt
The same but with awscli, permissions of file hello-s3cmd.txt are set to 664; I like it.
$ aws s3 sync s3://s3cmd-bug-demo-us-east-1/ ./
download: s3://s3cmd-bug-demo-us-east-1/hello-s3cmd.txt to ./hello-s3cmd.txt
$ ls -l
-rw-rw-r-- 1 user user 66 Oct 3 11:18 hello-s3cmd.txt
"s3cmd get" sets permissions correctly (to 664), I like it:
This is a patch. Could you review it and apply it?
I checked the code and I see that file mode is set only in "sync" but not in "get" command. Maybe that "file mode" should not be set for files in "sync" but set only to empty directories.
One more point, when I try "s3cmd get s3://s3cmd-bug-demo-us-east-1 --recursive", directory permissions are set correctly, so I guess that all code that plays with "mode" can be removed from "sync" section because that part is handled by "os" or python library...
This is the easy fix, it doesn't change files to be executable; mode 0666 is -rw-rw-rw-.