fsck: clean up temporary mountpoint

We used to leave directories like

  /tmp/gocryptfs.fsck.104431245

behind. Let's clean up after ourselves.
This commit is contained in:
Jakob Unterwurzacher 2021-06-02 19:28:20 +02:00
parent a38e5988ba
commit 307dfd7f71
1 changed files with 4 additions and 0 deletions

View File

@ -295,6 +295,10 @@ func fsck(args *argContainer) (exitcode int) {
err = srv.Unmount()
if err != nil {
tlog.Warn.Printf("failed to unmount %q: %v", ck.mnt, err)
} else {
if err := syscall.Rmdir(ck.mnt); err != nil {
tlog.Warn.Printf("cleaning up %q failed: %v", ck.mnt, err)
}
}
}()
// Recursively check the root dir