mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Rename ipa-python directory to ipapython so it is a real python library
We used to install it as ipa, now installing it as ipapython. The rpm is still ipa-python.
This commit is contained in:
parent
58ae191a5a
commit
262ff2d731
14
Makefile
14
Makefile
@ -1,6 +1,6 @@
|
||||
include VERSION
|
||||
|
||||
SUBDIRS=daemons install ipa-python ipa-client ipa-radius-server ipa-radius-admintools
|
||||
SUBDIRS=daemons install ipapython ipa-client ipa-radius-server ipa-radius-admintools
|
||||
|
||||
PRJ_PREFIX=ipa
|
||||
|
||||
@ -64,11 +64,11 @@ version-update: release-update
|
||||
sed -e s/__VERSION__/$(IPA_VERSION)/ version.m4.in \
|
||||
> version.m4
|
||||
|
||||
sed -e s/__VERSION__/$(IPA_VERSION)/ ipa-python/setup.py.in \
|
||||
> ipa-python/setup.py
|
||||
sed -e s/__VERSION__/$(IPA_VERSION)/ ipa-python/version.py.in \
|
||||
> ipa-python/version.py
|
||||
perl -pi -e "s:__NUM_VERSION__:$(IPA_VERSION_MAJOR)$(IPA_VERSION_MINOR)$(IPA_VERSION_RELEASE):" ipa-python/version.py
|
||||
sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/setup.py.in \
|
||||
> ipapython/setup.py
|
||||
sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/version.py.in \
|
||||
> ipapython/version.py
|
||||
perl -pi -e "s:__NUM_VERSION__:$(IPA_VERSION_MAJOR)$(IPA_VERSION_MINOR)$(IPA_VERSION_RELEASE):" ipapython/version.py
|
||||
|
||||
sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
|
||||
ipa-client/ipa-client.spec.in > ipa-client/ipa-client.spec
|
||||
@ -150,7 +150,7 @@ maintainer-clean: clean
|
||||
cd daemons && $(MAKE) maintainer-clean
|
||||
cd install && $(MAKE) maintainer-clean
|
||||
cd ipa-client && $(MAKE) maintainer-clean
|
||||
cd ipa-python && $(MAKE) maintainer-clean
|
||||
cd ipapython && $(MAKE) maintainer-clean
|
||||
cd ipa-radius-admintools && $(MAKE) maintainer-clean
|
||||
cd ipa-radius-server && $(MAKE) maintainer-clean
|
||||
rm -f version.m4
|
||||
|
@ -23,7 +23,7 @@ import sys
|
||||
try:
|
||||
from optparse import OptionParser
|
||||
from ipaserver import ipaldap
|
||||
from ipa import entity, ipautil, config
|
||||
from ipapython import entity, ipautil, config
|
||||
from ipaserver.install import installutils
|
||||
from ipaserver.install.ldapupdate import LDAPUpdate, BadSyntax, UPDATES_DIR
|
||||
from ipalib import errors, errors2
|
||||
|
@ -21,8 +21,8 @@ try:
|
||||
import getpass
|
||||
|
||||
import ipa
|
||||
import ipa.config
|
||||
import ipa.ipautil
|
||||
import ipapython.config
|
||||
import ipapython.ipautil
|
||||
|
||||
import krbV
|
||||
import ldap
|
||||
@ -57,14 +57,14 @@ def parse_options():
|
||||
parser.add_option("--fix-replica", dest="fix_replica", action="store_true",
|
||||
help="Fix a replica after the tool has been tun with --fix on another master")
|
||||
|
||||
ipa.config.add_standard_options(parser)
|
||||
ipapython.config.add_standard_options(parser)
|
||||
options, args = parser.parse_args()
|
||||
|
||||
ipa.config.verify_args(parser, args)
|
||||
ipapython.config.verify_args(parser, args)
|
||||
if not options.fix and not options.fix_replica and not options.check:
|
||||
parser.error("please specify at least one option")
|
||||
|
||||
ipa.config.init_config(options)
|
||||
ipapython.config.init_config(options)
|
||||
|
||||
return options, args
|
||||
|
||||
@ -148,8 +148,8 @@ def change_mkey_cleanup(password):
|
||||
tarfile = libdir+"/ipa-change-mkey-"+curtime+".tar"
|
||||
gpgfile = tarfile+".gpg"
|
||||
args = ['/bin/tar', '-C', libdir, '-cf', tarfile, 'mkey']
|
||||
ipa.ipautil.run(args)
|
||||
ipa.ipautil.encrypt_file(tarfile, gpgfile, password, cachedir)
|
||||
ipapython.ipautil.run(args)
|
||||
ipapython.ipautil.encrypt_file(tarfile, gpgfile, password, cachedir)
|
||||
os.remove(tarfile)
|
||||
shutil.rmtree(basedir, ignore_errors=True)
|
||||
|
||||
@ -160,7 +160,7 @@ def change_mkey(password = None, quiet = False):
|
||||
krbctx = krbV.default_context()
|
||||
|
||||
realm = krbctx.default_realm
|
||||
suffix = ipa.ipautil.realm_to_suffix(realm)
|
||||
suffix = ipapython.ipautil.realm_to_suffix(realm)
|
||||
|
||||
backupfile = basedir+"/backup.dump"
|
||||
convertfile = basedir+"/convert.dump"
|
||||
@ -176,7 +176,7 @@ def change_mkey(password = None, quiet = False):
|
||||
print "This command will restart your Directory and KDC Servers."
|
||||
|
||||
#TODO: ask for confirmation
|
||||
if not ipa.ipautil.user_input("Do you want to proceed and change the Kerberos Master key?", False):
|
||||
if not ipapython.ipautil.user_input("Do you want to proceed and change the Kerberos Master key?", False):
|
||||
print ""
|
||||
print "Aborting..."
|
||||
return 1
|
||||
@ -186,10 +186,10 @@ def change_mkey(password = None, quiet = False):
|
||||
|
||||
# get a connection to the DS
|
||||
try:
|
||||
conn = ipaldap.IPAdmin(ipa.config.config.default_server[0])
|
||||
conn = ipaldap.IPAdmin(ipapython.config.config.default_server[0])
|
||||
conn.do_simple_bind(bindpw=password)
|
||||
except Exception, e:
|
||||
print "ERROR: Could not connect to the Directory Server on "+ipa.config.config.default_server[0]+" ("+str(e)+")"
|
||||
print "ERROR: Could not connect to the Directory Server on "+ipapython.config.config.default_server[0]+" ("+str(e)+")"
|
||||
return 1
|
||||
|
||||
# Wipe basedir and recreate it
|
||||
@ -239,8 +239,8 @@ def change_mkey(password = None, quiet = False):
|
||||
args = ["/usr/kerberos/sbin/kdb5_util", "dump", "-verbose", backupfile]
|
||||
print "Performing safety backup of the key material"
|
||||
try:
|
||||
output = ipa.ipautil.run(args)
|
||||
except ipa.ipautil.CalledProcessError, e:
|
||||
output = ipapython.ipautil.run(args)
|
||||
except ipapython.ipautil.CalledProcessError, e:
|
||||
print "Failed to backup key material ("+str(e)+"), aborting ..."
|
||||
return 1
|
||||
|
||||
@ -255,8 +255,8 @@ def change_mkey(password = None, quiet = False):
|
||||
args = ["/usr/kerberos/sbin/kdb5_util", "dump", "-verbose", "-new_mkey_file", newstashfile, convertfile]
|
||||
print "Converting key material to new master key"
|
||||
try:
|
||||
output = ipa.ipautil.run(args)
|
||||
except ipa.ipautil.CalledProcessError, e:
|
||||
output = ipapython.ipautil.run(args)
|
||||
except ipapython.ipautil.CalledProcessError, e:
|
||||
print "Failed to convert key material, aborting ..."
|
||||
return 1
|
||||
|
||||
@ -272,12 +272,12 @@ def change_mkey(password = None, quiet = False):
|
||||
#Stop the KDC
|
||||
args = ["/etc/init.d/krb5kdc", "stop"]
|
||||
try:
|
||||
output = ipa.ipautil.run(args)
|
||||
output = ipapython.ipautil.run(args)
|
||||
if output[0]:
|
||||
print output[0]
|
||||
if output[1]:
|
||||
print output[1]
|
||||
except ipa.ipautil.CalledProcessError, e:
|
||||
except ipapython.ipautil.CalledProcessError, e:
|
||||
print "WARNING: Failed to restart the KDC ("+str(e)+")"
|
||||
print "You will have to manually restart the KDC when the operation is completed"
|
||||
|
||||
@ -318,8 +318,8 @@ def change_mkey(password = None, quiet = False):
|
||||
args = ["/usr/kerberos/sbin/kdb5_util", "load", "-verbose", "-update", convertfile]
|
||||
print "Uploading converted key material"
|
||||
try:
|
||||
output = ipa.ipautil.run(args)
|
||||
except ipa.ipautil.CalledProcessError, e:
|
||||
output = ipapython.ipautil.run(args)
|
||||
except ipapython.ipautil.CalledProcessError, e:
|
||||
print "Failed to upload key material ("+e+"), aborting ..."
|
||||
return 1
|
||||
|
||||
@ -349,24 +349,24 @@ def change_mkey(password = None, quiet = False):
|
||||
#Restart Directory Server (the pwd plugin need to read the new mkey)
|
||||
args = ["/etc/init.d/dirsrv", "restart"]
|
||||
try:
|
||||
output = ipa.ipautil.run(args)
|
||||
output = ipapython.ipautil.run(args)
|
||||
if output[0]:
|
||||
print output[0]
|
||||
if output[1]:
|
||||
print output[1]
|
||||
except ipa.ipautil.CalledProcessError, e:
|
||||
except ipapython.ipautil.CalledProcessError, e:
|
||||
print "WARNING: Failed to restart the Directory Server ("+str(e)+")"
|
||||
print "Please manually restart the DS with 'service dirsrv restart'"
|
||||
|
||||
#Restart the KDC
|
||||
args = ["/etc/init.d/krb5kdc", "start"]
|
||||
try:
|
||||
output = ipa.ipautil.run(args)
|
||||
output = ipapython.ipautil.run(args)
|
||||
if output[0]:
|
||||
print output[0]
|
||||
if output[1]:
|
||||
print output[1]
|
||||
except ipa.ipautil.CalledProcessError, e:
|
||||
except ipapython.ipautil.CalledProcessError, e:
|
||||
print "WARNING: Failed to restart the KDC ("+str(e)+")"
|
||||
print "Please manually restart the kdc with 'service krb5kdc start'"
|
||||
|
||||
@ -462,7 +462,7 @@ def fix_main(password, realm, suffix):
|
||||
dn = "cn=%s,cn=kerberos,%s" % (realm, suffix)
|
||||
sub_dict = dict(REALM=realm, SUFFIX=suffix)
|
||||
#protect the master key by adding an appropriate deny rule along with the key
|
||||
mod = [(ldap.MOD_ADD, 'aci', ipa.ipautil.template_str(KRBMKEY_DENY_ACI, sub_dict)),
|
||||
mod = [(ldap.MOD_ADD, 'aci', ipapython.ipautil.template_str(KRBMKEY_DENY_ACI, sub_dict)),
|
||||
(ldap.MOD_REPLACE, 'krbMKey', str(asn1key))]
|
||||
|
||||
conn = ldapobject.SimpleLDAPObject("ldap://127.0.0.1/")
|
||||
@ -484,7 +484,7 @@ def main():
|
||||
|
||||
krbctx = krbV.default_context()
|
||||
realm = krbctx.default_realm
|
||||
suffix = ipa.ipautil.realm_to_suffix(realm)
|
||||
suffix = ipapython.ipautil.realm_to_suffix(realm)
|
||||
|
||||
try:
|
||||
ret = check_vuln(realm, suffix)
|
||||
|
@ -27,7 +27,7 @@ import sys
|
||||
try:
|
||||
from optparse import OptionParser
|
||||
from ipaserver import ipaldap
|
||||
from ipa import entity, ipautil, config
|
||||
from ipapython import entity, ipautil, config
|
||||
from ipaserver.install import installutils
|
||||
from ipaserver.install.ldapupdate import LDAPUpdate, BadSyntax, UPDATES_DIR
|
||||
import ldap
|
||||
|
@ -24,12 +24,12 @@ import tempfile, os, pwd, traceback, logging, shutil
|
||||
from ConfigParser import SafeConfigParser
|
||||
import ldap
|
||||
|
||||
from ipa import ipautil
|
||||
from ipapython import ipautil
|
||||
|
||||
from ipaserver.install import dsinstance, replication, installutils, krbinstance, service
|
||||
from ipaserver.install import httpinstance, ntpinstance, certs
|
||||
from ipaserver import ipaldap
|
||||
from ipa import version
|
||||
from ipapython import version
|
||||
|
||||
CACERT="/usr/share/ipa/html/ca.crt"
|
||||
|
||||
|
@ -22,9 +22,9 @@ import sys
|
||||
import getpass, ldap, re, krbV
|
||||
import traceback, logging
|
||||
|
||||
from ipa import ipautil
|
||||
from ipapython import ipautil
|
||||
from ipaserver import replication, ipaldap, dsinstance, installutils
|
||||
from ipa import version
|
||||
from ipapython import version
|
||||
|
||||
def parse_options():
|
||||
from optparse import OptionParser
|
||||
|
@ -26,11 +26,11 @@ from ConfigParser import SafeConfigParser
|
||||
import krbV
|
||||
from optparse import OptionParser
|
||||
|
||||
import ipa.config
|
||||
from ipa import ipautil
|
||||
import ipapython.config
|
||||
from ipapython import ipautil
|
||||
from ipaserver.install import dsinstance, installutils, certs
|
||||
from ipaserver import ipaldap
|
||||
from ipa import version
|
||||
from ipapython import version
|
||||
import ldap
|
||||
|
||||
def parse_options():
|
||||
@ -48,7 +48,7 @@ def parse_options():
|
||||
parser.add_option("-p", "--password", dest="password",
|
||||
help="Directory Manager (existing master) password")
|
||||
|
||||
ipa.config.add_standard_options(parser)
|
||||
ipapython.config.add_standard_options(parser)
|
||||
options, args = parser.parse_args()
|
||||
|
||||
# If any of the PKCS#12 options are selected, all are required. Create a
|
||||
@ -62,7 +62,7 @@ def parse_options():
|
||||
if len(args) != 1:
|
||||
parser.error("must provide the fully-qualified name of the replica")
|
||||
|
||||
ipa.config.init_config(options)
|
||||
ipapython.config.init_config(options)
|
||||
|
||||
return options, args
|
||||
|
||||
@ -85,8 +85,8 @@ def get_realm_name():
|
||||
|
||||
def get_domain_name():
|
||||
try:
|
||||
ipa.config.init_config()
|
||||
domain_name = ipa.config.config.get_domain()
|
||||
ipapython.config.init_config()
|
||||
domain_name = ipapython.config.config.get_domain()
|
||||
except Exception, e:
|
||||
return None
|
||||
|
||||
|
@ -27,7 +27,7 @@ import traceback
|
||||
|
||||
import krbV, ldap, getpass
|
||||
|
||||
from ipa.ipautil import user_input
|
||||
from ipapython.ipautil import user_input
|
||||
from ipaserver import certs, dsinstance, httpinstance, ipaldap, installutils
|
||||
|
||||
def get_realm_name():
|
||||
|
@ -44,11 +44,11 @@ from ipaserver.install import httpinstance
|
||||
from ipaserver.install import ntpinstance
|
||||
|
||||
from ipaserver.install import service
|
||||
from ipa import version
|
||||
from ipapython import version
|
||||
from ipaserver.install.installutils import *
|
||||
|
||||
from ipa import sysrestore
|
||||
from ipa.ipautil import *
|
||||
from ipapython import sysrestore
|
||||
from ipapython.ipautil import *
|
||||
from ipalib import util
|
||||
|
||||
pw_name = None
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
import sys
|
||||
try:
|
||||
from ipa import ipautil
|
||||
from ipapython import ipautil
|
||||
import krbV
|
||||
import re
|
||||
import os
|
||||
|
@ -30,9 +30,9 @@ try:
|
||||
import ipaclient.ipadiscovery
|
||||
import ipaclient.ipachangeconf
|
||||
import ipaclient.ntpconf
|
||||
from ipa.ipautil import run, user_input
|
||||
from ipa import sysrestore
|
||||
from ipa import version
|
||||
from ipapython.ipautil import run, user_input
|
||||
from ipapython import sysrestore
|
||||
from ipapython import version
|
||||
except ImportError:
|
||||
print >> sys.stderr, """\
|
||||
There was a problem importing one of the required Python modules. The
|
||||
|
@ -19,10 +19,10 @@
|
||||
|
||||
import socket
|
||||
import logging
|
||||
import ipa.dnsclient
|
||||
import ipapython.dnsclient
|
||||
import ldap
|
||||
from ldap import LDAPError
|
||||
|
||||
|
||||
class IPADiscovery:
|
||||
|
||||
def __init__(self):
|
||||
@ -50,22 +50,22 @@ class IPADiscovery:
|
||||
result = []
|
||||
krbret = []
|
||||
ldapret = []
|
||||
|
||||
|
||||
if not server:
|
||||
|
||||
if not domain: #domain not provided do full DNS discovery
|
||||
|
||||
|
||||
# get the local host name
|
||||
hostname = socket.getfqdn()
|
||||
if not hostname:
|
||||
return -10 #bad host configuration
|
||||
|
||||
|
||||
# first, check for an LDAP server for the local domain
|
||||
p = hostname.find(".")
|
||||
if p == -1: #no domain name
|
||||
return -1
|
||||
domain = hostname[p+1:]
|
||||
|
||||
|
||||
while not self.server:
|
||||
logging.debug("[ipadnssearchldap("+domain+")]")
|
||||
self.server = self.ipadnssearchldap(domain)
|
||||
@ -83,69 +83,69 @@ class IPADiscovery:
|
||||
self.domain = domain
|
||||
else:
|
||||
return -2 #no ldap server found
|
||||
|
||||
|
||||
|
||||
|
||||
#search for kerberos TODO: move this after ipacheckldap()
|
||||
logging.debug("[ipadnssearchkrb]")
|
||||
krbret = self.ipadnssearchkrb(self.domain)
|
||||
if not krbret:
|
||||
return -3 #no krb server found
|
||||
|
||||
|
||||
self.realm = krbret[0]
|
||||
|
||||
|
||||
else: #server forced on us, this means DNS doesn't work :/
|
||||
|
||||
|
||||
self.domain = domain
|
||||
self.server = server
|
||||
|
||||
|
||||
logging.debug("[ipacheckldap]")
|
||||
# check ldap now
|
||||
ldapret = self.ipacheckldap(self.server, self.realm)
|
||||
|
||||
if not ldapret:
|
||||
return -4 # not an IPA server (or broken config)
|
||||
|
||||
|
||||
self.server = ldapret[0]
|
||||
self.realm = ldapret[1]
|
||||
|
||||
|
||||
return 0
|
||||
|
||||
def ipacheckldap(self, thost, trealm):
|
||||
|
||||
|
||||
lret = []
|
||||
lres = []
|
||||
lattr = ""
|
||||
linfo = ""
|
||||
lrealms = []
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
|
||||
#now verify the server is really an IPA server
|
||||
try:
|
||||
logging.debug("Init ldap with: ldap://"+thost+":389")
|
||||
lh = ldap.initialize("ldap://"+thost+":389")
|
||||
lh.simple_bind_s("","")
|
||||
|
||||
|
||||
logging.debug("Search rootdse")
|
||||
lret = lh.search_s("", ldap.SCOPE_BASE, "(objectClass=*)")
|
||||
for lattr in lret[0][1]:
|
||||
if lattr.lower() == "namingcontexts":
|
||||
self.basedn = lret[0][1][lattr][0]
|
||||
|
||||
|
||||
logging.debug("Search for (info=*) in "+self.basedn+"(base)")
|
||||
lret = lh.search_s(self.basedn, ldap.SCOPE_BASE, "(info=IPA*)")
|
||||
if not lret:
|
||||
return []
|
||||
logging.debug("Found: "+str(lret))
|
||||
|
||||
|
||||
for lattr in lret[0][1]:
|
||||
if lattr.lower() == "info":
|
||||
linfo = lret[0][1][lattr][0].lower()
|
||||
break
|
||||
|
||||
|
||||
if not linfo:
|
||||
return []
|
||||
|
||||
|
||||
#search and return known realms
|
||||
logging.debug("Search for (objectClass=krbRealmContainer) in "+self.basedn+"(sub)")
|
||||
lret = lh.search_s("cn=kerberos,"+self.basedn, ldap.SCOPE_SUBTREE, "(objectClass=krbRealmContainer)")
|
||||
@ -153,13 +153,13 @@ class IPADiscovery:
|
||||
#something very wrong
|
||||
return []
|
||||
logging.debug("Found: "+str(lret))
|
||||
|
||||
|
||||
for lres in lret:
|
||||
for lattr in lres[1]:
|
||||
if lattr.lower() == "cn":
|
||||
lrealms.append(lres[1][lattr][0])
|
||||
|
||||
|
||||
|
||||
|
||||
if trealm:
|
||||
for r in lrealms:
|
||||
if trealm == r:
|
||||
@ -172,10 +172,10 @@ class IPADiscovery:
|
||||
return []
|
||||
else:
|
||||
return [thost, lrealms[0]]
|
||||
|
||||
|
||||
#we shouldn't get here
|
||||
return []
|
||||
|
||||
|
||||
except LDAPError, err:
|
||||
#no good
|
||||
try:
|
||||
@ -188,19 +188,19 @@ class IPADiscovery:
|
||||
logging.error("LDAP Error: "+str(err))
|
||||
return []
|
||||
|
||||
|
||||
|
||||
def ipadnssearchldap(self, tdomain):
|
||||
servers = ""
|
||||
rserver = ""
|
||||
|
||||
|
||||
qname = "_ldap._tcp."+tdomain
|
||||
# terminate the name
|
||||
if not qname.endswith("."):
|
||||
qname += "."
|
||||
results = ipa.dnsclient.query(qname, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||
|
||||
results = ipapython.dnsclient.query(qname, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
|
||||
|
||||
for result in results:
|
||||
if result.dns_type == ipa.dnsclient.DNS_T_SRV:
|
||||
if result.dns_type == ipapython.dnsclient.DNS_T_SRV:
|
||||
rserver = result.rdata.server.rstrip(".")
|
||||
if result.rdata.port and result.rdata.port != 389:
|
||||
rserver += ":" + str(result.rdata.port)
|
||||
@ -209,9 +209,9 @@ class IPADiscovery:
|
||||
else:
|
||||
servers = rserver
|
||||
break
|
||||
|
||||
|
||||
return servers
|
||||
|
||||
|
||||
def ipadnssearchkrb(self, tdomain):
|
||||
realm = ""
|
||||
kdc = ""
|
||||
@ -220,23 +220,23 @@ class IPADiscovery:
|
||||
# terminate the name
|
||||
if not qname.endswith("."):
|
||||
qname += "."
|
||||
results = ipa.dnsclient.query(qname, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_TXT)
|
||||
|
||||
results = ipapython.dnsclient.query(qname, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_TXT)
|
||||
|
||||
for result in results:
|
||||
if result.dns_type == ipa.dnsclient.DNS_T_TXT:
|
||||
if result.dns_type == ipapython.dnsclient.DNS_T_TXT:
|
||||
realm = result.rdata.data
|
||||
if realm:
|
||||
break
|
||||
|
||||
|
||||
if realm:
|
||||
# now fetch server information for the realm
|
||||
qname = "_kerberos._udp." + tdomain
|
||||
# terminate the name
|
||||
if not qname.endswith("."):
|
||||
qname += "."
|
||||
results = ipa.dnsclient.query(qname, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||
results = ipapython.dnsclient.query(qname, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
|
||||
for result in results:
|
||||
if result.dns_type == ipa.dnsclient.DNS_T_SRV:
|
||||
if result.dns_type == ipapython.dnsclient.DNS_T_SRV:
|
||||
qname = result.rdata.server.rstrip(".")
|
||||
if result.rdata.port and result.rdata.port != 88:
|
||||
qname += ":" + str(result.rdata.port)
|
||||
|
@ -17,7 +17,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
from ipa.ipautil import *
|
||||
from ipapython.ipautil import *
|
||||
import shutil
|
||||
|
||||
ntp_conf = """# Permit time synchronization with our time source, but do not
|
||||
@ -28,7 +28,7 @@ restrict -6 default kod nomodify notrap nopeer noquery
|
||||
# Permit all access over the loopback interface. This could
|
||||
# be tightened as well, but to do so would effect some of
|
||||
# the administrative functions.
|
||||
restrict 127.0.0.1
|
||||
restrict 127.0.0.1
|
||||
restrict -6 ::1
|
||||
|
||||
# Hosts on local network are less restricted.
|
||||
@ -46,9 +46,9 @@ server $SERVER
|
||||
#manycastclient 239.255.254.254 key 42 # manycast client
|
||||
|
||||
# Undisciplined Local Clock. This is a fake driver intended for backup
|
||||
# and when no outside source of synchronized time is available.
|
||||
# and when no outside source of synchronized time is available.
|
||||
server 127.127.1.0 # local clock
|
||||
#fudge 127.127.1.0 stratum 10
|
||||
#fudge 127.127.1.0 stratum 10
|
||||
|
||||
# Drift file. Put this in a directory which the daemon can write to.
|
||||
# No symbolic links allowed, either, since the daemon updates the file
|
||||
@ -57,7 +57,7 @@ server 127.127.1.0 # local clock
|
||||
driftfile /var/lib/ntp/drift
|
||||
|
||||
# Key file containing the keys and key identifiers used when operating
|
||||
# with symmetric key cryptography.
|
||||
# with symmetric key cryptography.
|
||||
keys /etc/ntp/keys
|
||||
|
||||
# Specify the key identifiers which are trusted.
|
||||
|
@ -1,3 +0,0 @@
|
||||
include *.conf
|
||||
include ipa-python.spec*
|
||||
|
@ -1,82 +0,0 @@
|
||||
Name: ipa-python
|
||||
Version: __VERSION__
|
||||
Release: __RELEASE__%{?dist}
|
||||
Summary: IPA authentication server
|
||||
|
||||
Group: System Environment/Base
|
||||
License: GPLv2
|
||||
URL: http://www.freeipa.org
|
||||
Source0: http://www.freeipa.org/downloads/%{name}-%{version}.tgz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildArch: noarch
|
||||
BuildRequires: python-devel
|
||||
Requires: python-kerberos gnupg
|
||||
|
||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
|
||||
%description
|
||||
IPA is a server for identity, policy, and audit.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
%{__python} setup.py install --no-compile --root=%{buildroot}
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{python_sitelib}/*
|
||||
%config(noreplace) %{_sysconfdir}/ipa/ipa.conf
|
||||
|
||||
%changelog
|
||||
* Thu Apr 3 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.0-1
|
||||
- Version bump for release
|
||||
|
||||
* Thu Feb 21 2008 Rob Crittenden <rcritten@redhat.com> - 0.99.0-1
|
||||
- Version bump for release
|
||||
|
||||
* Thu Jan 31 2008 Rob Crittenden <rcritten@redhat.com> - 0.6.0-4
|
||||
- Marked with wrong license. IPA is GPLv2.
|
||||
|
||||
* Thu Jan 24 2008 Rob Crittenden <rcritten@redhat.com> - 0.6.0-3
|
||||
- Use new name of PyKerberos, python-kerberos, in Requires
|
||||
|
||||
* Thu Jan 17 2008 Rob Crittenden <rcritten@redhat.com> - 0.6.0-2
|
||||
- Fixed License in specfile
|
||||
|
||||
* Fri Dec 21 2007 Karl MacMillan <kmacmill@redhat.com> - 0.6.0-1
|
||||
- Version bump for release
|
||||
|
||||
* Wed Nov 21 2007 Karl MacMillan <kmacmill@redhat.com> - 0.5.0-1
|
||||
- Version bump for release and rename of rpm
|
||||
|
||||
* Thu Nov 1 2007 Karl MacMillan <kmacmill@redhat.com> - 0.4.1-1
|
||||
- Version bump for release
|
||||
|
||||
* Wed Oct 17 2007 Rob Crittenden <rcritten@redhat.com> - 0.4.0-2
|
||||
- Use new python setup.py build script
|
||||
|
||||
* Tue Oct 2 2007 Karl MacMillan <kmacmill@redhat.com> - 0.4.0-1
|
||||
- Milestone 4
|
||||
|
||||
* Mon Sep 10 2007 Karl MacMillan <kmacmill@redhat.com> - 0.3.0-1
|
||||
- Milestone 3
|
||||
|
||||
* Fri Aug 17 2007 Karl MacMillan <kmacmill@redhat.com> = 0.2.0-4
|
||||
- Added PyKerberos dep.
|
||||
|
||||
* Mon Aug 5 2007 Rob Crittenden <rcritten@redhat.com> - 0.1.0-3
|
||||
- Abstracted client class to work directly or over RPC
|
||||
|
||||
* Wed Aug 1 2007 Rob Crittenden <rcritten@redhat.com> - 0.1.0-2
|
||||
- Add User class
|
||||
- Add kerberos authentication to the XML-RPC request made from tools.
|
||||
|
||||
* Fri Jul 27 2007 Karl MacMillan <kmacmill@localhost.localdomain> - 0.1.0-1
|
||||
- Initial rpm version
|
@ -392,10 +392,10 @@ fi
|
||||
%files python
|
||||
%doc LICENSE README
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{python_sitelib}/ipa
|
||||
%{python_sitelib}/ipa/*.py*
|
||||
%dir %{python_sitelib}/ipapython
|
||||
%{python_sitelib}/ipapython/*.py*
|
||||
%if 0%{?fedora} >= 9
|
||||
%{python_sitelib}/ipa-*.egg-info
|
||||
%{python_sitelib}/ipapython-*.egg-info
|
||||
%endif
|
||||
%config(noreplace) %{_sysconfdir}/ipa/ipa.conf
|
||||
|
||||
|
2
ipapython/MANIFEST.in
Normal file
2
ipapython/MANIFEST.in
Normal file
@ -0,0 +1,2 @@
|
||||
include *.conf
|
||||
|
@ -22,7 +22,7 @@ from optparse import OptionParser, IndentedHelpFormatter
|
||||
|
||||
import krbV
|
||||
import socket
|
||||
import ipa.dnsclient
|
||||
import ipapython.dnsclient
|
||||
import re
|
||||
|
||||
class IPAConfigError(Exception):
|
||||
@ -120,7 +120,7 @@ def __discover_config(discover_server = True):
|
||||
#try once with REALM -> domain
|
||||
dom_name = config.default_realm.lower()
|
||||
name = "_ldap._tcp."+dom_name+"."
|
||||
rs = ipa.dnsclient.query(name, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||
rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
|
||||
rl = len(rs)
|
||||
if rl == 0:
|
||||
#try cycling on domain components of FQDN
|
||||
@ -131,7 +131,7 @@ def __discover_config(discover_server = True):
|
||||
return False
|
||||
dom_name = dom_name[tok+1:]
|
||||
name = "_ldap._tcp." + dom_name + "."
|
||||
rs = ipa.dnsclient.query(name, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||
rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
|
||||
rl = len(rs)
|
||||
|
||||
config.default_domain = dom_name
|
||||
@ -139,10 +139,10 @@ def __discover_config(discover_server = True):
|
||||
if discover_server:
|
||||
if rl == 0:
|
||||
name = "_ldap._tcp."+config.default_domain+"."
|
||||
rs = ipa.dnsclient.query(name, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||
rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
|
||||
|
||||
for r in rs:
|
||||
if r.dns_type == ipa.dnsclient.DNS_T_SRV:
|
||||
if r.dns_type == ipapython.dnsclient.DNS_T_SRV:
|
||||
rsrv = r.rdata.server.rstrip(".")
|
||||
config.default_server.append(rsrv)
|
||||
|
@ -21,7 +21,7 @@ import re
|
||||
import cStringIO
|
||||
import copy
|
||||
|
||||
import ipa.ipautil
|
||||
import ipapython.ipautil
|
||||
|
||||
def utf8_encode_value(value):
|
||||
if isinstance(value,unicode):
|
||||
@ -59,19 +59,19 @@ class Entity:
|
||||
if entrydata:
|
||||
if isinstance(entrydata,tuple):
|
||||
self.dn = entrydata[0]
|
||||
self.data = ipa.ipautil.CIDict(entrydata[1])
|
||||
self.data = ipapython.ipautil.CIDict(entrydata[1])
|
||||
elif isinstance(entrydata,str) or isinstance(entrydata,unicode):
|
||||
self.dn = entrydata
|
||||
self.data = ipa.ipautil.CIDict()
|
||||
self.data = ipapython.ipautil.CIDict()
|
||||
elif isinstance(entrydata,dict):
|
||||
self.dn = entrydata['dn']
|
||||
del entrydata['dn']
|
||||
self.data = ipa.ipautil.CIDict(entrydata)
|
||||
self.data = ipapython.ipautil.CIDict(entrydata)
|
||||
else:
|
||||
self.dn = ''
|
||||
self.data = ipa.ipautil.CIDict()
|
||||
self.data = ipapython.ipautil.CIDict()
|
||||
|
||||
self.orig_data = ipa.ipautil.CIDict(copy_CIDict(self.data))
|
||||
self.orig_data = ipapython.ipautil.CIDict(copy_CIDict(self.data))
|
||||
|
||||
def __nonzero__(self):
|
||||
"""This allows us to do tests like if entry: returns false if there is no data,
|
||||
@ -148,7 +148,7 @@ class Entity:
|
||||
v = self.getValues(name)
|
||||
if v:
|
||||
self.delValue(name)
|
||||
|
||||
|
||||
return
|
||||
|
||||
def delValue(self,name):
|
||||
@ -165,7 +165,7 @@ class Entity:
|
||||
def toDict(self):
|
||||
"""Convert the attrs and values to a dict. The dict is keyed on the
|
||||
attribute name. The value is either single value or a list of values."""
|
||||
result = ipa.ipautil.CIDict(self.data)
|
||||
result = ipapython.ipautil.CIDict(self.data)
|
||||
result['dn'] = self.dn
|
||||
return result
|
||||
|
||||
@ -175,7 +175,7 @@ class Entity:
|
||||
|
||||
def origDataDict(self):
|
||||
"""Returns a dict of the original values of the user. Used for updates."""
|
||||
result = ipa.ipautil.CIDict(self.orig_data)
|
||||
result = ipapython.ipautil.CIDict(self.orig_data)
|
||||
result['dn'] = self.dn
|
||||
return result
|
||||
|
@ -29,13 +29,13 @@ import os, sys, traceback, readline
|
||||
import stat
|
||||
import shutil
|
||||
|
||||
from ipa import ipavalidate
|
||||
from ipapython import ipavalidate
|
||||
from types import *
|
||||
|
||||
import re
|
||||
import xmlrpclib
|
||||
import datetime
|
||||
from ipa import config
|
||||
from ipapython import config
|
||||
try:
|
||||
from subprocess import CalledProcessError
|
||||
class CalledProcessError(subprocess.CalledProcessError):
|
@ -24,9 +24,9 @@ import ldap
|
||||
import getpass
|
||||
import ldap.filter
|
||||
|
||||
from ipa import ipautil
|
||||
from ipa.entity import Entity
|
||||
import ipa.ipavalidate as ipavalidate
|
||||
from ipapython import ipautil
|
||||
from ipapython.entity import Entity
|
||||
import ipapython.ipavalidate as ipavalidate
|
||||
|
||||
|
||||
__all__ = [
|
||||
@ -110,7 +110,7 @@ class RadiusProfile(Entity):
|
||||
|
||||
def __init2__(self):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -51,7 +51,7 @@ def setup_package():
|
||||
|
||||
try:
|
||||
setup(
|
||||
name = "ipa",
|
||||
name = "ipapython",
|
||||
version = "__VERSION__",
|
||||
license = "GPL",
|
||||
author = "Karl MacMillan, et.al.",
|
||||
@ -64,8 +64,8 @@ def setup_package():
|
||||
download_url = "http://www.freeipa.org/page/Downloads",
|
||||
classifiers=filter(None, CLASSIFIERS.split('\n')),
|
||||
platforms = ["Linux", "Solaris", "Unix"],
|
||||
package_dir = {'ipa': ''},
|
||||
packages = [ "ipa" ],
|
||||
package_dir = {'ipapython': ''},
|
||||
packages = [ "ipapython" ],
|
||||
data_files = [('/etc/ipa', ['ipa.conf'])]
|
||||
)
|
||||
finally:
|
@ -32,7 +32,7 @@ import ConfigParser
|
||||
import random
|
||||
import string
|
||||
|
||||
from ipa import ipautil
|
||||
from ipapython import ipautil
|
||||
|
||||
SYSRESTORE_PATH = "/tmp"
|
||||
SYSRESTORE_INDEXFILE = "sysrestore.index"
|
@ -25,8 +25,8 @@ import socket
|
||||
import logging
|
||||
|
||||
import service
|
||||
from ipa import sysrestore
|
||||
from ipa import ipautil
|
||||
from ipapython import sysrestore
|
||||
from ipapython import ipautil
|
||||
|
||||
def check_inst():
|
||||
# So far this file is always present in both RHEL5 and Fedora if all the necessary
|
||||
|
@ -23,8 +23,8 @@ import errno
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
from ipa import sysrestore
|
||||
from ipa import ipautil
|
||||
from ipapython import sysrestore
|
||||
from ipapython import ipautil
|
||||
|
||||
CA_SERIALNO="/var/lib/ipa/ca_serialno"
|
||||
|
||||
|
@ -29,7 +29,7 @@ import time
|
||||
import tempfile
|
||||
import stat
|
||||
|
||||
from ipa import ipautil
|
||||
from ipapython import ipautil
|
||||
|
||||
import service
|
||||
import installutils
|
||||
|
@ -32,8 +32,8 @@ import service
|
||||
import certs
|
||||
import dsinstance
|
||||
import installutils
|
||||
from ipa import sysrestore
|
||||
from ipa import ipautil
|
||||
from ipapython import sysrestore
|
||||
from ipapython import ipautil
|
||||
|
||||
HTTPD_DIR = "/etc/httpd"
|
||||
SSL_CONF = HTTPD_DIR + "/conf.d/ssl.conf"
|
||||
|
@ -29,8 +29,8 @@ import time
|
||||
import struct
|
||||
import fcntl
|
||||
|
||||
from ipa import ipautil
|
||||
from ipa import dnsclient
|
||||
from ipapython import ipautil
|
||||
from ipapython import dnsclient
|
||||
|
||||
def get_fqdn():
|
||||
fqdn = ""
|
||||
|
@ -32,8 +32,8 @@ import shutil
|
||||
|
||||
import service
|
||||
import installutils
|
||||
from ipa import sysrestore
|
||||
from ipa import ipautil
|
||||
from ipapython import sysrestore
|
||||
from ipapython import ipautil
|
||||
from ipalib import util
|
||||
from ipalib import errors2
|
||||
|
||||
|
@ -27,7 +27,7 @@ UPDATES_DIR="/usr/share/ipa/updates/"
|
||||
import sys
|
||||
from ipaserver.install import installutils
|
||||
from ipaserver import ipaldap
|
||||
from ipa import entity, ipautil
|
||||
from ipapython import entity, ipautil
|
||||
from ipalib import util
|
||||
from ipalib import errors, errors2
|
||||
import ldap
|
||||
|
@ -21,8 +21,8 @@ import shutil
|
||||
import logging
|
||||
|
||||
import service
|
||||
from ipa import sysrestore
|
||||
from ipa import ipautil
|
||||
from ipapython import sysrestore
|
||||
from ipapython import ipautil
|
||||
|
||||
class NTPInstance(service.Service):
|
||||
def __init__(self, fstore=None):
|
||||
|
@ -18,8 +18,8 @@
|
||||
#
|
||||
|
||||
import logging, sys
|
||||
from ipa import sysrestore
|
||||
from ipa import ipautil
|
||||
from ipapython import sysrestore
|
||||
from ipapython import ipautil
|
||||
|
||||
|
||||
def stop(service_name):
|
||||
|
Loading…
Reference in New Issue
Block a user