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

Unified Diff: build/android/provision_devices.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/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index ce6d570ac6bdd6e46f43a9c29e9efe0ebc662a90..39c3095083e6f57d6e30f71ba1b401cb3cdbf612 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -137,16 +137,16 @@ def CheckExternalStorage(device):
"""
try:
with device_temp_file.DeviceTempFile(
- device.adb, suffix='.sh', dir=device.GetExternalStoragePath()):
- pass
+ device.adb, suffix='.sh', dir=device.GetExternalStoragePath()) as f:
+ device.WriteFile(f.name, 'test')
except device_errors.CommandFailedError:
logging.info('External storage not writable. Remounting / as RW')
device.RunShellCommand(['mount', '-o', 'remount,rw', '/'],
check_return=True, as_root=True)
device.EnableRoot()
with device_temp_file.DeviceTempFile(
- device.adb, suffix='.sh', dir=device.GetExternalStoragePath()):
- pass
+ device.adb, suffix='.sh', dir=device.GetExternalStoragePath()) as f:
+ device.WriteFile(f.name, 'test')
def WipeChromeData(device, options):
"""Wipes chrome specific data from device

Powered by Google App Engine
This is Rietveld 408576698