mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 10:18:59 +03:00
prevent upload from sensitive path
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
3c6415147b
commit
97d6f2954c
1 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,7 @@ package com.owncloud.android.files.services;
|
|||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.accounts.OnAccountsUpdateListener;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
|
@ -449,6 +450,7 @@ public class FileUploader extends Service
|
|||
/**
|
||||
* Start a new {@link UploadFileOperation}.
|
||||
*/
|
||||
@SuppressLint("SdCardPath")
|
||||
private void startNewUpload(
|
||||
User user,
|
||||
List<String> requestedUploads,
|
||||
|
@ -461,6 +463,11 @@ public class FileUploader extends Service
|
|||
OCFile file,
|
||||
boolean disableRetries
|
||||
) {
|
||||
if (file.getStoragePath().startsWith("/data/data/")) {
|
||||
Log_OC.d(TAG, "Upload from sensitive path is not allowed");
|
||||
return;
|
||||
}
|
||||
|
||||
OCUpload ocUpload = new OCUpload(file, user.toPlatformAccount());
|
||||
ocUpload.setFileSize(file.getFileLength());
|
||||
ocUpload.setNameCollisionPolicy(nameCollisionPolicy);
|
||||
|
|
Loading…
Reference in a new issue