summaryrefslogtreecommitdiffstats
path: root/daemons/dnssec/ipa-ods-exporter
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2015-03-16 16:43:10 +0100
committerJan Cholasta <jcholast@redhat.com>2015-04-20 08:27:35 +0000
commit3d2feac0e416c66ba37eee53ef5b3833c2c3e414 (patch)
tree77d8907c8dbba8db76db3cac3b9be09ffc970f01 /daemons/dnssec/ipa-ods-exporter
parenta8e30e96716992e4160abdb7ac5995bb75e54eae (diff)
downloadfreeipa-3d2feac0e416c66ba37eee53ef5b3833c2c3e414.tar.gz
freeipa-3d2feac0e416c66ba37eee53ef5b3833c2c3e414.tar.xz
freeipa-3d2feac0e416c66ba37eee53ef5b3833c2c3e414.zip
Adopted kinit_keytab and kinit_password for kerberos auth
Calls to ipautil.run using kinit were replaced with calls kinit_keytab/kinit_password functions implemented in the PATCH 0015. Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Simo Sorce <ssorce@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'daemons/dnssec/ipa-ods-exporter')
-rwxr-xr-xdaemons/dnssec/ipa-ods-exporter6
1 files changed, 4 insertions, 2 deletions
diff --git a/daemons/dnssec/ipa-ods-exporter b/daemons/dnssec/ipa-ods-exporter
index 401f35087..6d33b79bb 100755
--- a/daemons/dnssec/ipa-ods-exporter
+++ b/daemons/dnssec/ipa-ods-exporter
@@ -399,7 +399,9 @@ ipalib.api.finalize()
# Kerberos initialization
PRINCIPAL = str('%s/%s' % (DAEMONNAME, ipalib.api.env.host))
log.debug('Kerberos principal: %s', PRINCIPAL)
-ipautil.kinit_hostprincipal(paths.IPA_ODS_EXPORTER_KEYTAB, WORKDIR, PRINCIPAL)
+ccache_name = os.path.join(WORKDIR, 'ccache')
+ipautil.kinit_keytab(PRINCIPAL, paths.IPA_ODS_EXPORTER_KEYTAB, ccache_name)
+os.environ['KRB5CCNAME'] = ccache_name
log.debug('Got TGT')
# LDAP initialization
@@ -407,7 +409,7 @@ dns_dn = DN(ipalib.api.env.container_dns, ipalib.api.env.basedn)
ldap = ipalib.api.Backend[ldap2]
# fixme
log.debug('Connecting to LDAP')
-ldap.connect(ccache="%s/ccache" % WORKDIR)
+ldap.connect(ccache=ccache_name)
log.debug('Connected')