From 414553ad93a989ebcc8d9c805fcb46b62e6ff4ef Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 6 Jun 2023 10:34:36 -0700 Subject: [PATCH] samba: Remove additional configuration files on uninstall Tests: - Uninstall samba. Notice that /etc/default/samba and /etc/samba/smb-freedombox.conf are removed. - Reinstall samba and notice that the two files are restored to their expected content. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/samba/privileged.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plinth/modules/samba/privileged.py b/plinth/modules/samba/privileged.py index adb2d41d0..cb10482b4 100644 --- a/plinth/modules/samba/privileged.py +++ b/plinth/modules/samba/privileged.py @@ -3,6 +3,7 @@ import configparser import os +import pathlib import shutil import subprocess @@ -312,3 +313,6 @@ def restore_shares(): def uninstall(): """Drop all Samba shares.""" _conf_command(['drop']) + for path in [CONF_PATH, DEFAULT_FILE]: + # Both files are typically created on setup() + pathlib.Path(path).unlink(missing_ok=True)