From 6b5411bd9bf98bd7c4bb695b37c2e878f4b0f1ef Mon Sep 17 00:00:00 2001
From: Christian Heimes <cheimes@redhat.com>
Date: Thu, 10 Sep 2015 11:54:32 +0200
Subject: [PATCH] Handle timeout error in ipa-httpd-kdcproxy
The ipa-httpd-kdcproxy script now handles LDAP timeout errors correctly.
A timeout does no longer result into an Apache startup error.
https://fedorahosted.org/freeipa/ticket/5292
Reviewed-By: Martin Basti <mbasti@redhat.com>
---
install/tools/ipa-httpd-kdcproxy | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/install/tools/ipa-httpd-kdcproxy b/install/tools/ipa-httpd-kdcproxy
index 60b22f2cc321d416871c74f3b4d580594c186a85..5e9863f8bd82e1628030b0b767a6697ab2a1d7bd 100755
--- a/install/tools/ipa-httpd-kdcproxy
+++ b/install/tools/ipa-httpd-kdcproxy
@@ -24,6 +24,7 @@ This script creates or removes the symlink from /etc/ipa/ipa-kdc-proxy.conf
to /etc/httpd/conf.d/. It's called from ExecStartPre hook in httpd.service.
"""
import os
+import socket
import sys
from ipalib import api, errors
@@ -81,7 +82,7 @@ class KDCProxyConfig(object):
# EXTERNAL bind as root user
self.con.ldapi = True
self.con.do_bind(timeout=self.time_limit)
- except errors.NetworkError as e:
+ except (errors.NetworkError, socket.timeout) as e:
msg = 'Unable to connect to dirsrv: %s' % e
raise CheckError(msg)
except errors.AuthorizationError as e:
--
2.4.3