blob: c7c5b99e26e153ebf063168a722f757e85ef7900 [file] [log] [blame]
Pierre-Hugues Husson5d5d68a2018-10-02 16:41:21 +02001From 30efdaa4669e5dcf632457cbdbc06d1943b19700 Mon Sep 17 00:00:00 2001
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +01002From: Pierre-Hugues Husson <phh@phh.me>
3Date: Sat, 17 Feb 2018 19:39:38 +0100
Jon West013ef582018-08-21 20:45:26 -04004Subject: [PATCH 1/5] Allow deletion of symlink
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +01005
6Change-Id: I9731895f88729072297f753088583aabbe6990f4
7---
8 Ext4Crypt.cpp | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
Jon West1fd60302018-08-11 19:14:03 -040012index 67b7e90..99a63b4 100644
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +010013--- a/Ext4Crypt.cpp
14+++ b/Ext4Crypt.cpp
Jon West1fd60302018-08-11 19:14:03 -040015@@ -221,6 +221,7 @@ static bool prepare_dir(const std::string& dir, mode_t mode, uid_t uid, gid_t gi
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +010016 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--
Jon West013ef582018-08-21 20:45:26 -0400242.7.4
Pierre-Hugues Hussonc0ca67e2018-03-22 20:31:17 +010025