mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
082bc48c32
https://review.lineageos.org/q/topic:P_asb_2022-05 https://review.lineageos.org/q/topic:P_asb_2022-06 https://review.lineageos.org/q/topic:P_asb_2022-07 https://review.lineageos.org/q/topic:P_asb_2022-08 https://review.lineageos.org/q/topic:P_asb_2022-09 https://review.lineageos.org/q/topic:P_asb_2022-10 https://review.lineageos.org/q/topic:P_asb_2022-11 https://review.lineageos.org/q/topic:P_asb_2022-12 https://review.lineageos.org/q/topic:P_asb_2023-01 https://review.lineageos.org/q/topic:P_asb_2023-02 https://review.lineageos.org/q/topic:P_asb_2023-03 https://review.lineageos.org/q/topic:P_asb_2023-04 https://review.lineageos.org/q/topic:P_asb_2023-05 https://review.lineageos.org/q/topic:P_asb_2023-06 https://review.lineageos.org/q/topic:P_asb_2023-07 accounted for via manifest change: https://review.lineageos.org/c/LineageOS/android_external_freetype/+/361250 https://review.lineageos.org/q/topic:P_asb_2023-08 accounted for via manifest change: https://review.lineageos.org/c/LineageOS/android_external_freetype/+/364606 accounted for via patches: https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/365328 https://review.lineageos.org/q/topic:P_asb_2023-09 https://review.lineageos.org/q/topic:P_asb_2023-10 https://review.lineageos.org/q/topic:P_asb_2023-11 accounted for via patches: https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/374916 https://review.lineageos.org/q/topic:P_asb_2023-12 https://review.lineageos.org/q/topic:P_asb_2024-01 https://review.lineageos.org/q/topic:P_asb_2024-02 https://review.lineageos.org/q/topic:P_asb_2024-03 https://review.lineageos.org/q/topic:P_asb_2024-04 Signed-off-by: Tavi <tavi@divested.dev>
41 lines
2.2 KiB
Diff
41 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aishwarya Mallampati <amallampati@google.com>
|
|
Date: Wed, 10 May 2023 21:54:43 +0000
|
|
Subject: [PATCH] Update file permissions using canonical path
|
|
|
|
Bug: 264880895
|
|
Bug: 264880689
|
|
Test: atest android.telephonyprovider.cts.MmsPartTest
|
|
atest CtsTelephonyTestCases
|
|
Sanity check - sending and receiving sms and mms manually
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6743638a096c32627f398efd2ea78f08b8a2db8c)
|
|
Merged-In: I8dd888ea31ec07c9f0de38eb8e8170d3ed255686
|
|
Change-Id: I8dd888ea31ec07c9f0de38eb8e8170d3ed255686
|
|
---
|
|
src/com/android/providers/telephony/MmsProvider.java | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/com/android/providers/telephony/MmsProvider.java b/src/com/android/providers/telephony/MmsProvider.java
|
|
index 6ba775ba..7546c246 100644
|
|
--- a/src/com/android/providers/telephony/MmsProvider.java
|
|
+++ b/src/com/android/providers/telephony/MmsProvider.java
|
|
@@ -819,15 +819,16 @@ public class MmsProvider extends ContentProvider {
|
|
String path = getContext().getDir(PARTS_DIR_NAME, 0).getPath() + '/' +
|
|
uri.getPathSegments().get(1);
|
|
try {
|
|
+ File canonicalFile = new File(path).getCanonicalFile();
|
|
String partsDirPath = getContext().getDir(PARTS_DIR_NAME, 0).getCanonicalPath();
|
|
- if (!new File(path).getCanonicalPath().startsWith(partsDirPath)) {
|
|
+ if (!canonicalFile.getPath().startsWith(partsDirPath + '/')) {
|
|
EventLog.writeEvent(0x534e4554, "240685104",
|
|
Binder.getCallingUid(), (TAG + " update: path " + path +
|
|
" does not start with " + partsDirPath));
|
|
return 0;
|
|
}
|
|
// Reset the file permission back to read for everyone but me.
|
|
- Os.chmod(path, 0644);
|
|
+ Os.chmod(canonicalFile.getPath(), 0644);
|
|
if (LOCAL_LOGV) {
|
|
Log.d(TAG, "MmsProvider.update chmod is successful for path: " + path);
|
|
}
|