From 1b81daad3a5fd5d207f8fe88d3259f46746a3559 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Sat, 24 Jun 2023 12:05:09 +1100
Subject: [PATCH] also remove the parsed module directory

---
 src/lib66/exec/ssexec_remove.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/lib66/exec/ssexec_remove.c b/src/lib66/exec/ssexec_remove.c
index db96f011..f90c87d5 100644
--- a/src/lib66/exec/ssexec_remove.c
+++ b/src/lib66/exec/ssexec_remove.c
@@ -237,6 +237,24 @@ int ssexec_remove(int argc, char const *const *argv, ssexec_t *info)
 
                 resolve_free(mwres) ;
             }
+
+            char dir[SS_MAX_PATH_LEN + 1] ;
+
+            if (!info->owner) {
+
+                auto_strings(dir, SS_SERVICE_ADMDIR, ares[pos].sa.s + ares[pos].name) ;
+
+            } else {
+
+                if (!set_ownerhome_stack(dir))
+                    log_dieusys(LOG_EXIT_SYS, "unable to find the home directory of the user") ;
+
+                size_t dirlen = strlen(dir) ;
+
+                auto_strings(dir + dirlen, SS_SERVICE_USERDIR, ares[pos].sa.s + ares[pos].name) ;
+            }
+
+            auto_remove(dir) ;
         }
     }
 
-- 
GitLab