mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-12 17:21:55 -06:00
Allow overriding NSS database path in RPCClient.
Part of https://fedorahosted.org/freeipa/ticket/3259 Part of https://fedorahosted.org/freeipa/ticket/3520 Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
459d6cff4e
commit
eaebefe5f6
@ -483,7 +483,7 @@ class SSLTransport(LanguageAwareTransport):
|
|||||||
if self._connection and host == self._connection[0]:
|
if self._connection and host == self._connection[0]:
|
||||||
return self._connection[1]
|
return self._connection[1]
|
||||||
|
|
||||||
dbdir = paths.NSS_DB_DIR
|
dbdir = getattr(context, 'nss_dir', paths.NSS_DB_DIR)
|
||||||
no_init = self.__nss_initialized(dbdir)
|
no_init = self.__nss_initialized(dbdir)
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
conn = NSSHTTPS(host, 443, dbdir=dbdir, no_init=no_init)
|
conn = NSSHTTPS(host, 443, dbdir=dbdir, no_init=no_init)
|
||||||
@ -762,7 +762,7 @@ class RPCClient(Connectible):
|
|||||||
return session_url
|
return session_url
|
||||||
|
|
||||||
def create_connection(self, ccache=None, verbose=False, fallback=True,
|
def create_connection(self, ccache=None, verbose=False, fallback=True,
|
||||||
delegate=False):
|
delegate=False, nss_dir=None):
|
||||||
try:
|
try:
|
||||||
rpc_uri = self.env[self.env_rpc_uri_key]
|
rpc_uri = self.env[self.env_rpc_uri_key]
|
||||||
principal = get_current_principal()
|
principal = get_current_principal()
|
||||||
@ -774,6 +774,9 @@ class RPCClient(Connectible):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
# No session key, do full Kerberos auth
|
# No session key, do full Kerberos auth
|
||||||
pass
|
pass
|
||||||
|
# This might be dangerous. Use at your own risk!
|
||||||
|
if nss_dir:
|
||||||
|
context.nss_dir = nss_dir
|
||||||
urls = self.get_url_list(rpc_uri)
|
urls = self.get_url_list(rpc_uri)
|
||||||
serverproxy = None
|
serverproxy = None
|
||||||
for url in urls:
|
for url in urls:
|
||||||
|
Loading…
Reference in New Issue
Block a user