Jon West | 1fd6030 | 2018-08-11 19:14:03 -0400 | [diff] [blame^] | 1 | From 06a421423c529991ca38ba2d71b76daa9188849e Mon Sep 17 00:00:00 2001 |
Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 2 | From: Pierre-Hugues Husson <phh@phh.me> |
| 3 | Date: Sat, 17 Feb 2018 19:39:38 +0100 |
Jon West | 1fd6030 | 2018-08-11 19:14:03 -0400 | [diff] [blame^] | 4 | Subject: [PATCH] Allow deletion of symlink |
Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 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 |
Jon West | 1fd6030 | 2018-08-11 19:14:03 -0400 | [diff] [blame^] | 12 | index 67b7e90..99a63b4 100644 |
Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 13 | --- a/Ext4Crypt.cpp |
| 14 | +++ b/Ext4Crypt.cpp |
Jon West | 1fd6030 | 2018-08-11 19:14:03 -0400 | [diff] [blame^] | 15 | @@ -221,6 +221,7 @@ static bool prepare_dir(const std::string& dir, mode_t mode, uid_t uid, gid_t gi |
Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 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 | -- |
Jon West | 1fd6030 | 2018-08-11 19:14:03 -0400 | [diff] [blame^] | 24 | 2.17.1 |
Pierre-Hugues Husson | c0ca67e | 2018-03-22 20:31:17 +0100 | [diff] [blame] | 25 | |