mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
ipa-server-install uninstall: remove tdb files
ipa-server-install uninstaller must remove samba *.tdb files in /var/lib/samba, /var/lib/samba/private and /var/lib/samba/lock. The current code calls rm on the relative path filename instead of building an absolute path filename, resulting in failure to remove the tdb files. Related: https://pagure.io/freeipa/issue/8687 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
91334b271a
commit
bbe554acf4
@ -918,9 +918,16 @@ class ADTRUSTInstance(service.Service):
|
||||
ipautil.remove_file(self.smb_conf)
|
||||
|
||||
# Remove samba's persistent and temporary tdb files
|
||||
if os.path.isdir(paths.SAMBA_DIR):
|
||||
tdb_files = [tdb_file for tdb_file in os.listdir(paths.SAMBA_DIR)
|
||||
if tdb_file.endswith(".tdb")]
|
||||
# in /var/lib/samba and /var/lib/samba/private
|
||||
for smbpath in (paths.SAMBA_DIR,
|
||||
os.path.join(paths.SAMBA_DIR, "private"),
|
||||
os.path.join(paths.SAMBA_DIR, "lock")):
|
||||
if os.path.isdir(smbpath):
|
||||
tdb_files = [
|
||||
os.path.join(smbpath, tdb_file)
|
||||
for tdb_file in os.listdir(smbpath)
|
||||
if tdb_file.endswith(".tdb")
|
||||
]
|
||||
for tdb_file in tdb_files:
|
||||
ipautil.remove_file(tdb_file)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user