Lost access rights when uploading to CAS
Context
Running Bazel test with BuildGrid fails. BuildGrid bot indicate that "buildgrid.bot.bot_session - ERROR - Exception thrown: [[Errno 13] Permission denied: 'external/bazel_tools/tools/test/test-setup.sh']".
Uploading a directory that contains shell scripts to CAS, and then dowloading the same shows that access rights (read and execute) are missing on files in that directory.
Reproduce - First way: Upload a directory to CAS, then download it and verify the access rights of files.
Reproduce - Second way: Use Bazel example cpp-tutorial/stage3. Same example as in https://buildgrid.gitlab.io/buildgrid/using_bazel.html. in cpp-tutorial/stage3/main/BUILD change the cc_binary to cc_test, then run the test using 'bazel test': bazel test //main:hello-world