From 675dd5936da0e44ede6e6b15337bf0c4b1958706 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 17 Feb 2018 19:39:38 +0100 Subject: [PATCH 1/9] Allow deletion of symlink Change-Id: I9731895f88729072297f753088583aabbe6990f4 --- FsCrypt.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/FsCrypt.cpp b/FsCrypt.cpp index 76a02ba..5f95338 100644 --- a/FsCrypt.cpp +++ b/FsCrypt.cpp @@ -262,6 +262,7 @@ static bool prepare_dir(const std::string& dir, mode_t mode, uid_t uid, gid_t gi static bool destroy_dir(const std::string& dir) { LOG(DEBUG) << "Destroying: " << dir; if (rmdir(dir.c_str()) != 0 && errno != ENOENT) { + if(unlink(dir.c_str()) == 0) return true; PLOG(ERROR) << "Failed to destroy " << dir; return false; } -- 2.25.1