diff options
Diffstat (limited to 'src/userdel.c')
-rw-r--r-- | src/userdel.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/userdel.c b/src/userdel.c index c8de1d31..7be46e8d 100644 --- a/src/userdel.c +++ b/src/userdel.c @@ -53,6 +53,7 @@ #include "getdef.h" #include "groupio.h" #include "nscd.h" +#include "sssd.h" #include "prototypes.h" #include "pwauth.h" #include "pwio.h" @@ -1271,6 +1272,23 @@ int main (int argc, char **argv) #endif /* EXTRA_CHECK_HOME_DIR */ if (rflg) { +#ifdef WITH_BTRFS + int is_subvolume = btrfs_is_subvolume (user_home); + if (is_subvolume < 0) { + errors++; + /* continue */ + } + else if (is_subvolume > 0) { + if (btrfs_remove_subvolume (user_home)) { + fprintf (stderr, + _("%s: error removing subvolume %s\n"), + Prog, user_home); + errors++; + /* continue */ + } + } + else +#endif if (remove_tree (user_home, true) != 0) { fprintf (stderr, _("%s: error removing directory %s\n"), @@ -1328,6 +1346,7 @@ int main (int argc, char **argv) nscd_flush_cache ("passwd"); nscd_flush_cache ("group"); + sssd_flush_cache (SSSD_DB_PASSWD | SSSD_DB_GROUP); return ((0 != errors) ? E_HOMEDIR : E_SUCCESS); } |