Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3354)

Unified Diff: build/android/devil/android/device_utils.py

Issue 1410553004: Reland of Android: Trust large random numbers for temp files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: provision_devices Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/devil/android/device_utils.py
diff --git a/build/android/devil/android/device_utils.py b/build/android/devil/android/device_utils.py
index e2df2d77da3a232c120ccab0de92b82546c6f8f0..c5538e632c73effcfec94e502f0fca69aaf20f4c 100644
--- a/build/android/devil/android/device_utils.py
+++ b/build/android/devil/android/device_utils.py
@@ -1436,8 +1436,10 @@ class DeviceUtils(object):
['cat', device_path], as_root=as_root, check_return=True))
elif as_root and self.NeedsSU():
with device_temp_file.DeviceTempFile(self.adb) as device_temp:
- self.RunShellCommand(['cp', device_path, device_temp.name],
- as_root=True, check_return=True)
+ cmd = 'SRC=%s DEST=%s;cp "$SRC" "$DEST" && chmod 666 "$DEST"' % (
jbudorick 2015/10/16 01:16:55 I'm going to have to mull over that Shrink functio
+ cmd_helper.SingleQuote(device_path),
+ cmd_helper.SingleQuote(device_temp.name))
+ self.RunShellCommand(cmd, as_root=True, check_return=True)
return self._ReadFileWithPull(device_temp.name)
else:
return self._ReadFileWithPull(device_path)
« no previous file with comments | « build/android/devil/android/device_temp_file_test.py ('k') | build/android/devil/android/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698