Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 1 | From f838998f3f28d93a8085047725da96404b0ae56c Mon Sep 17 00:00:00 2001 |
| 2 | From: Pierre-Hugues Husson <phh@phh.me> |
| 3 | Date: Sat, 17 Feb 2018 19:39:38 +0100 |
| 4 | Subject: [PATCH 1/2] Allow deletion of symlink |
| 5 | |
| 6 | Change-Id: I9731895f88729072297f753088583aabbe6990f4 |
| 7 | --- |
| 8 | Ext4Crypt.cpp | 1 + |
| 9 | 1 file changed, 1 insertion(+) |
| 10 | |
| 11 | diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp |
| 12 | index 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 Husson | 2acef1d | 2018-04-05 20:10:30 +0200 | [diff] [blame^] | 24 | 2.7.4 |
Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 25 | |