From 6a9630eff624643fd725219775784e68d967d04c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 22 Jan 2024 14:14:30 +0100 Subject: [PATCH] python:gp: Avoid path check for cepces-submit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit find_cepces_submit() uses which(), which returns None if not found. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15559 Signed-off-by: Andreas Schneider Reviewed-by: David Mulder Reviewed-by: Pavel Filipenský --- python/samba/gp/gp_cert_auto_enroll_ext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samba/gp/gp_cert_auto_enroll_ext.py b/python/samba/gp/gp_cert_auto_enroll_ext.py index 8ba1960efe5..ddc14ae8e8d 100644 --- a/python/samba/gp/gp_cert_auto_enroll_ext.py +++ b/python/samba/gp/gp_cert_auto_enroll_ext.py @@ -185,7 +185,7 @@ def find_cepces_submit(): def get_supported_templates(server): cepces_submit = find_cepces_submit() - if not cepces_submit or not os.path.exists(cepces_submit): + if not cepces_submit: log.error('Failed to find cepces-submit') return [] @@ -301,7 +301,7 @@ def cert_enroll(ca, ldb, trust_dir, private_dir, auth='Kerberos'): # Setup Certificate Auto Enrollment getcert = which('getcert') cepces_submit = find_cepces_submit() - if getcert is not None and os.path.exists(cepces_submit): + if getcert is not None and cepces_submit is not None: p = Popen([getcert, 'add-ca', '-c', ca['name'], '-e', '%s --server=%s --auth=%s' % (cepces_submit, ca['hostname'], auth)], -- 2.34.1