summaryrefslogtreecommitdiffstats
path: root/ipa-server
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2007-11-06 16:26:10 -0500
committerJohn Dennis <jdennis@redhat.com>2007-11-06 16:26:10 -0500
commit22493d9b9fbc0b6a2e35397ab7b6a62740fcfe7a (patch)
tree0c940d0ccb6db58b87b656bc2b149ee14da30e48 /ipa-server
parent50c383aeedeca63fbcd54963d8378214a6c13559 (diff)
downloadfreeipa-22493d9b9fbc0b6a2e35397ab7b6a62740fcfe7a.tar.gz
freeipa-22493d9b9fbc0b6a2e35397ab7b6a62740fcfe7a.tar.xz
freeipa-22493d9b9fbc0b6a2e35397ab7b6a62740fcfe7a.zip
remove offensive use of rpm
add the radiusprofile to the list of objectclasses used when creating a user
Diffstat (limited to 'ipa-server')
-rwxr-xr-xipa-server/freeipa-server.spec2
-rw-r--r--ipa-server/ipaserver/radiusinstance.py30
-rw-r--r--ipa-server/xmlrpc-server/funcs.py2
3 files changed, 25 insertions, 9 deletions
diff --git a/ipa-server/freeipa-server.spec b/ipa-server/freeipa-server.spec
index 7606acf03..918e17c3b 100755
--- a/ipa-server/freeipa-server.spec
+++ b/ipa-server/freeipa-server.spec
@@ -11,7 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: fedora-ds-base-devel openldap-devel krb5-devel nss-devel mozldap-devel openssl-devel
-Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients httpd mod_python mod_auth_kerb python-ldap freeipa-python ntp cyrus-sasl-gssapi nss TurboGears python-krbV acl freeipa-admintools rpm
+Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients httpd mod_python mod_auth_kerb python-ldap freeipa-python ntp cyrus-sasl-gssapi nss TurboGears python-krbV acl freeipa-admintools
Requires: mod_nss >= 1.0.7-2
Requires: freeradius >= 1.1.7
diff --git a/ipa-server/ipaserver/radiusinstance.py b/ipa-server/ipaserver/radiusinstance.py
index 27e7527e0..2aee09b33 100644
--- a/ipa-server/ipaserver/radiusinstance.py
+++ b/ipa-server/ipaserver/radiusinstance.py
@@ -44,11 +44,32 @@ LDAP_ATTR_MAP_FILEPATH = os.path.join(PKG_CONFIG_DIR, 'ldap.attrmap')
RADIUSD_CONF_FILEPATH = os.path.join(PKG_CONFIG_DIR, 'radiusd.conf')
RADIUSD_CONF_TEMPLATE_FILEPATH = os.path.join(SHARE_DIR, 'radius.radiusd.conf.template')
+RADIUSD = '/usr/sbin/radiusd'
+
# FIXME there should a utility to get the user base dn
from ipaserver.funcs import DefaultUserContainer, DefaultGroupContainer
#-------------------------------------------------------------------------------
+def get_radius_version():
+ version = None
+ try:
+ p = subprocess.Popen([RADIUSD, '-v'], stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ status = p.returncode
+
+ if status == 0:
+ match = re.search("radiusd: FreeRADIUS Version (.+), for host", stdout)
+ if match:
+ version = match.group(1)
+ except Exception, e:
+ pass
+ return version
+
+
+#-------------------------------------------------------------------------------
+
class RadiusInstance(service.Service):
def __init__(self):
service.Service.__init__(self, "radiusd")
@@ -63,12 +84,7 @@ class RadiusInstance(service.Service):
self.principal = "%s/%s@%s" % (RADIUS_SERVICE_NAME, self.fqdn, self.realm)
self.basedn = realm_to_suffix(self.realm)
self.user_basedn = "%s,%s" % (DefaultUserContainer, self.basedn) # FIXME, should be utility to get this
- self.rpm_nvr = get_rpm_nvr_by_name(PKG_NAME)
- if self.rpm_nvr is not None:
- self.rpm_name, self.rpm_version, self.rpm_release = split_rpm_nvr(self.rpm_nvr)
- else:
- self.rpm_name = self.rpm_version = self.rpm_release = None
-
+ self.radius_version = get_radius_version()
self.start_creation(4, "Configuring radiusd")
try:
@@ -93,7 +109,7 @@ class RadiusInstance(service.Service):
def __radiusd_conf(self):
self.step('configuring radiusd.conf for radius instance')
- version = 'IPA_RADIUS_VERSION=%s RADIUS_PACKAGE_VERSION=%s' % (IPA_RADIUS_VERSION, self.rpm_nvr)
+ version = 'IPA_RADIUS_VERSION=%s FREE_RADIUS_VERSION=%s' % (IPA_RADIUS_VERSION, self.radius_version)
sub_dict = {'CONFIG_FILE_VERSION_INFO' : version,
'LDAP_SERVER' : self.ldap_server,
'RADIUS_KEYTAB' : IPA_KEYTAB_FILEPATH,
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 17a578c26..6fdaaca51 100644
--- a/ipa-server/xmlrpc-server/funcs.py
+++ b/ipa-server/xmlrpc-server/funcs.py
@@ -443,7 +443,7 @@ class IPAServer:
# some required objectclasses
entry.setValues('objectClass', 'top', 'person', 'organizationalPerson',
- 'inetOrgPerson', 'inetUser', 'posixAccount', 'krbPrincipalAux')
+ 'inetOrgPerson', 'inetUser', 'posixAccount', 'krbPrincipalAux', 'radiusprofile')
# fill in our new entry with everything sent by the user
for u in user: