From 9a33aeb07e67db720cbb3bbce84761e06a57ca87 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 7 Oct 2024 19:46:13 +0200 Subject: [PATCH] system/trust - link location could be a file or link, but when it exists, it should be removed. fixes: Scanning /usr/share/certs/trusted for certificates... Scanning /usr/local/share/certs for certificates... Traceback (most recent call last): File "/usr/local/opnsense/scripts/system/certctl.py", line 195, in cmds[sys.argv[1]]() File "/usr/local/opnsense/scripts/system/certctl.py", line 152, in cmd_rehash os.symlink(src_filename, dst_filename) FileExistsError: [Errno 17] File exists: --- src/opnsense/scripts/system/certctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opnsense/scripts/system/certctl.py b/src/opnsense/scripts/system/certctl.py index c384be5e4..555002d0b 100755 --- a/src/opnsense/scripts/system/certctl.py +++ b/src/opnsense/scripts/system/certctl.py @@ -147,7 +147,7 @@ def cmd_rehash(): f_out.write(record['data']) os.chmod(dst_filename, 0o644) else: - if os.path.isfile(dst_filename): + if os.path.isfile(dst_filename) or os.path.islink(dst_filename): os.remove(dst_filename) os.symlink(src_filename, dst_filename)