mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Changes to fix compatibility with Fedora 14
Fedora 14 introduced the following incompatiblities: - the kerberos binaries moved from /usr/kerberos/[s]/bin to /usr/[s]bin - the xmlrpclib in Python 2.7 is not fully backwards compatible to 2.6 Also, when moving the installed host service principals: - don't assume that krbticketflags is set - allow multiple values for krbextradata ticket 155
This commit is contained in:
@@ -89,7 +89,7 @@ def write_tmp_file(txt):
|
||||
|
||||
return fd
|
||||
|
||||
def run(args, stdin=None, raiseonerr=True, nolog=()):
|
||||
def run(args, stdin=None, raiseonerr=True, nolog=(), env=None):
|
||||
"""
|
||||
Execute a command and return stdin, stdout and the process return code.
|
||||
|
||||
@@ -113,11 +113,13 @@ def run(args, stdin=None, raiseonerr=True, nolog=()):
|
||||
|
||||
If an value isn't found in the list it is silently ignored.
|
||||
"""
|
||||
if env is None:
|
||||
env={"PATH": "/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}
|
||||
if stdin:
|
||||
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
|
||||
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, env=env)
|
||||
stdout,stderr = p.communicate(stdin)
|
||||
else:
|
||||
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
|
||||
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, env=env)
|
||||
stdout,stderr = p.communicate()
|
||||
|
||||
# The command and its output may include passwords that we don't want
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
import sys
|
||||
import httplib
|
||||
import getpass
|
||||
import logging
|
||||
@@ -161,7 +162,7 @@ class NSSConnection(httplib.HTTPConnection):
|
||||
logging.debug("connect: %s", net_addr)
|
||||
self.sock.connect(net_addr)
|
||||
|
||||
def endheaders(self):
|
||||
def endheaders(self, message=None):
|
||||
"""
|
||||
Explicitly close the connection if an error is returned after the
|
||||
headers are sent. This will likely mean the initial SSL handshake
|
||||
@@ -170,7 +171,13 @@ class NSSConnection(httplib.HTTPConnection):
|
||||
"""
|
||||
try:
|
||||
# FIXME: httplib uses old-style classes so super doesn't work
|
||||
httplib.HTTPConnection.endheaders(self)
|
||||
# Python 2.7 changed the API for endheaders. This is an attempt
|
||||
# to work across versions
|
||||
(major, minor, micro, releaselevel, serial) = sys.version_info
|
||||
if major == 2 and minor < 7:
|
||||
httplib.HTTPConnection.endheaders(self)
|
||||
else:
|
||||
httplib.HTTPConnection.endheaders(self, message)
|
||||
except NSPRError, e:
|
||||
self.close()
|
||||
raise e
|
||||
|
||||
Reference in New Issue
Block a user