Merge "Sanity-check paths of files to be restored" into jb-mr2-dev

This commit is contained in:
Jeff Vander Stoep
2014-09-23 16:13:41 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {