From a8ae0bc63b359b13a6d53afb50ac2efccba5eac6 Mon Sep 17 00:00:00 2001 From: David James Date: Wed, 1 Dec 2010 13:43:48 -0800 Subject: [PATCH] Update prebuilt.py to set permissions correctly on created Packages file. Since the local Packages file is a temporary file, other users won't have permissions to read it. rsync copies those permissions over to the remote server. To ensure remote server has the right permissions, we need to use chmod a+r on either the local file or the remote file. In this case, I chose to run rsync on the remote file. TEST=rsync -av --chmod=a+r foo bar and verify permissions are added to bar. BUG=chromium-os:5311 Change-Id: Iee4c8df00b36b9f9434546603195ea1906b289f1 Review URL: http://codereview.chromium.org/5501001 --- prebuilt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prebuilt.py b/prebuilt.py index 607397ee8d..2bada2ea35 100755 --- a/prebuilt.py +++ b/prebuilt.py @@ -441,11 +441,12 @@ def UploadPrebuilt(build_path, upload_location, version, binhost_base_url, ssh_server, remote_path = remote_location.split(':', 1) d = { 'pkg_index': tmp_packages_file.name, 'pkgs': pkgs, + 'remote_packages': '%s/Packages' % remote_location.rstrip('/'), 'remote_path': remote_path, 'remote_location': remote_location, 'ssh_server': ssh_server } cmds = ['ssh %(ssh_server)s mkdir -p %(remote_path)s' % d, - 'rsync -av %(pkg_index)s %(remote_location)s/Packages' % d] + 'rsync -av --chmod=a+r %(pkg_index)s %(remote_packages)s' % d] if pkgs: cmds.append('rsync -Rav %(pkgs)s %(remote_location)s/' % d) for cmd in cmds: