Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83e6640f authored by AVINASH GUSAIN's avatar AVINASH GUSAIN Committed by Arnau Vàzquez
Browse files

storage wrapper fix for encryption

parent 40a7cf02
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ RUN patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider
RUN patch -u ${BASE_DIR}/lib/private/legacy/OC_Helper.php -i ${TMP_PATCH_DIR}/014-add-mail-usage.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch
RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch
RUN patch -u ${BASE_DIR}/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php -i ${TMP_PATCH_DIR}/017-storage-wrapper.patch
RUN rm -rf ${TMP_PATCH_DIR}

# autocomplete leak tweak apps frontend with sed, disable group suggestion
+18 −27
Original line number Diff line number Diff line
From: ArnauVP <arnauvp@e.email>
Date: Fri, 27 Mar 2022 00:00:00 +0000
Subject: [PATCH] Makes password reset links use recovery email set through "email-recovery" app

This patch adds the necessary changes to core NC controller for "email-recovery" app to work correctly.
Instead of the user's email address, the user's recovery email address set through the "email-recovery" app is used for the password reset email.
It also handles different input types like username, username@domain, username@aliasdomain.

--- LostController.php.orig	2022-05-27 02:05:38.000000000 +0200
+++ LostController.php	2022-05-27 02:08:24.000000000 +0200
@@ -174,6 +174,21 @@
--- ./core/Controller/LostController.php	2022-05-27 14:46:14.400838300 +0530
+++ .//core/Controller/LostController-new.php	2022-05-27 14:46:16.710838300 +0530
@@ -174,6 +174,20 @@
 	 */
 	protected function checkPasswordResetToken(string $token, string $userId): void {
 		try {
+
+			$domain = $this->config->getSystemValue('mail_domain', '');
+			$domainSuffix = !empty($domain) ? '@' . $domain : '';
+			$altDomain = $this->config->getSystemValue('alt_mail_domain', '');
@@ -30,7 +21,7 @@ It also handles different input types like username, username@domain, username@a
 			$user = $this->userManager->get($userId);
 			$this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true);
 		} catch (InvalidTokenException $e) {
@@ -287,8 +302,22 @@
@@ -287,8 +301,22 @@
 	 * @throws \OCP\PreConditionNotMetException
 	 */
 	protected function sendEmail($input) {
+22 −0
Original line number Diff line number Diff line
--- ./lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php	2022-05-27 12:40:13.680838300 +0530
+++ ./lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener-new.php	2022-05-27 12:41:07.530838300 +0530
@@ -26,6 +26,7 @@
 namespace OC\Authentication\Listeners;
 
 use OC\Files\Cache\Cache;
+use OC\Files\Storage\Wrapper\Wrapper;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventListener;
 use OCP\Files\Config\IMountProviderCollection;
@@ -56,6 +57,11 @@
 			if (!$storage) {
 				throw new \Exception("User has no home storage");
 			}
+			// remove all wrappers, so we do the delete directly on the home storage bypassing any wrapper
+			while ($storage->instanceOfStorage(Wrapper::class)) {
+				/** @var Wrapper $storage */
+				$storage = $storage->getWrapperStorage();
+			}
 			$this->homeStorageCache[$event->getUser()->getUID()] = $storage;
 		}
 		if ($event instanceof UserDeletedEvent) {