blob: 9344b35af8999e41243b42e21f880ed12ecf4e3a [file] [log] [blame]
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +01001From f838998f3f28d93a8085047725da96404b0ae56c Mon Sep 17 00:00:00 2001
2From: Pierre-Hugues Husson <phh@phh.me>
3Date: Sat, 17 Feb 2018 19:39:38 +0100
4Subject: [PATCH 1/2] Allow deletion of symlink
5
6Change-Id: I9731895f88729072297f753088583aabbe6990f4
7---
8 Ext4Crypt.cpp | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
12index dc2e42a..6398464 100644
13--- a/Ext4Crypt.cpp
14+++ b/Ext4Crypt.cpp
15@@ -211,6 +211,7 @@ static bool prepare_dir(const std::string& dir, mode_t mode, uid_t uid, gid_t gi
16 static bool destroy_dir(const std::string& dir) {
17 LOG(DEBUG) << "Destroying: " << dir;
18 if (rmdir(dir.c_str()) != 0 && errno != ENOENT) {
19+ if(unlink(dir.c_str()) == 0) return true;
20 PLOG(ERROR) << "Failed to destroy " << dir;
21 return false;
22 }
23--
Pierre-Hugues Husson2acef1d2018-04-05 20:10:30 +0200242.7.4
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +010025