diff options
| author | 2014-09-23 16:24:36 +0000 | |
|---|---|---|
| committer | 2014-09-23 16:24:36 +0000 | |
| commit | 25c866a8efa148886280b34c0413a1c2c20c247f (patch) | |
| tree | 2d928ea084620bbd8d13d7cf7c2f405f5b75e706 | |
| parent | 660af7eb1a55e2df7da45aa63ca227141ef86b34 (diff) | |
| parent | e2adb1ff4af09d66096df64461c80d4126ab2692 (diff) | |
am e2adb1ff: Merge "Sanity-check paths of files to be restored" into jb-mr2-dev
* commit 'e2adb1ff4af09d66096df64461c80d4126ab2692':
Sanity-check paths of files to be restored
| -rw-r--r-- | services/java/com/android/server/BackupManagerService.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index a537e99dfa98..2c88c3254d2d 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -3390,6 +3390,14 @@ class BackupManagerService extends IBackupManager.Stub { break; } + // The path needs to be canonical + if (info.path.contains("..") || info.path.contains("//")) { + if (MORE_DEBUG) { + Slog.w(TAG, "Dropping invalid path " + info.path); + } + okay = false; + } + // If the policy is satisfied, go ahead and set up to pipe the // data to the agent. if (DEBUG && okay && mAgent != null) { |