1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

Target: Add read permissions to tmp files before pulling

Previously trying to pull a file from an android target would fail if the file
was owned by root, this commit adds read permissions to the file before
attempting to pull.
This commit is contained in:
Marc Bonnici 2017-04-21 15:21:40 +01:00
parent 98cf7d00c7
commit f6d02c6611

View File

@ -961,6 +961,7 @@ class AndroidTarget(Target):
device_tempfile = self.path.join(self._file_transfer_cache, source.lstrip(self.path.sep)) device_tempfile = self.path.join(self._file_transfer_cache, source.lstrip(self.path.sep))
self.execute("mkdir -p '{}'".format(self.path.dirname(device_tempfile))) self.execute("mkdir -p '{}'".format(self.path.dirname(device_tempfile)))
self.execute("cp '{}' '{}'".format(source, device_tempfile), as_root=True) self.execute("cp '{}' '{}'".format(source, device_tempfile), as_root=True)
self.execute("chmod 0644 '{}'".format(device_tempfile), as_root=True)
self.conn.pull(device_tempfile, dest, timeout=timeout) self.conn.pull(device_tempfile, dest, timeout=timeout)
# Android-specific # Android-specific