mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Utilize user and group objectclass lists in cn=ipaconfig
Change the syntax on user and group objectclasses in cn=ipaconfig
This commit is contained in:
parent
ca118de76c
commit
6ea3d9610e
@ -30,9 +30,9 @@ attributetypes: ( 2.16.840.1.113730.3.8.1.9 NAME 'ipaMaxUsernameLength' EQUALITY
|
|||||||
## ipaPwdExpAdvNotify - time in days to send out paswword expiration notification before passwpord actually expires
|
## ipaPwdExpAdvNotify - time in days to send out paswword expiration notification before passwpord actually expires
|
||||||
attributetypes: ( 2.16.840.1.113730.3.8.1.10 NAME 'ipaPwdExpAdvNotify' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE)
|
attributetypes: ( 2.16.840.1.113730.3.8.1.10 NAME 'ipaPwdExpAdvNotify' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE)
|
||||||
# ipaUserObjectClasses - required objectclasses for users
|
# ipaUserObjectClasses - required objectclasses for users
|
||||||
attributetypes: ( 2.16.840.1.113730.3.8.1.11 NAME 'ipaUserObjectClasses' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27)
|
attributetypes: ( 2.16.840.1.113730.3.8.1.11 NAME 'ipaUserObjectClasses' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
|
||||||
# ipaGroupObjectClasses - required objectclasses for groups
|
# ipaGroupObjectClasses - required objectclasses for groups
|
||||||
attributetypes: ( 2.16.840.1.113730.3.8.1.12 NAME 'ipaGroupObjectClasses' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27)
|
attributetypes: ( 2.16.840.1.113730.3.8.1.12 NAME 'ipaGroupObjectClasses' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
|
||||||
###############################################
|
###############################################
|
||||||
##
|
##
|
||||||
## ObjectClasses
|
## ObjectClasses
|
||||||
|
@ -123,6 +123,18 @@ ipaDefaultLoginShell: /bin/sh
|
|||||||
ipaDefaultPrimaryGroup: ipausers
|
ipaDefaultPrimaryGroup: ipausers
|
||||||
ipaMaxUsernameLength: 8
|
ipaMaxUsernameLength: 8
|
||||||
ipaPwdExpAdvNotify: 4
|
ipaPwdExpAdvNotify: 4
|
||||||
|
ipaGroupObjectClasses: top
|
||||||
|
ipaGroupObjectClasses: groupofnames
|
||||||
|
ipaGroupObjectClasses: posixGroup
|
||||||
|
ipaGroupObjectClasses: inetUser
|
||||||
|
ipaUserObjectClasses: top
|
||||||
|
ipaUserObjectClasses: person
|
||||||
|
ipaUserObjectClasses: organizationalPerson
|
||||||
|
ipaUserObjectClasses: inetOrgPerson
|
||||||
|
ipaUserObjectClasses: inetUser
|
||||||
|
ipaUserObjectClasses: posixAccount
|
||||||
|
ipaUserObjectClasses: krbPrincipalAux
|
||||||
|
ipaUserObjectClasses: radiusprofile
|
||||||
|
|
||||||
dn: cn=account inactivation,cn=accounts,$SUFFIX
|
dn: cn=account inactivation,cn=accounts,$SUFFIX
|
||||||
changetype: add
|
changetype: add
|
||||||
|
@ -506,8 +506,7 @@ class IPAServer:
|
|||||||
del user['gn']
|
del user['gn']
|
||||||
|
|
||||||
# some required objectclasses
|
# some required objectclasses
|
||||||
entry.setValues('objectClass', 'top', 'person', 'organizationalPerson',
|
entry.setValues('objectClass', (config.get('ipauserobjectclasses')))
|
||||||
'inetOrgPerson', 'inetUser', 'posixAccount', 'krbPrincipalAux', 'radiusprofile')
|
|
||||||
|
|
||||||
# fill in our new entry with everything sent by the user
|
# fill in our new entry with everything sent by the user
|
||||||
for u in user:
|
for u in user:
|
||||||
@ -719,6 +718,12 @@ class IPAServer:
|
|||||||
finally:
|
finally:
|
||||||
self.releaseConnection(conn)
|
self.releaseConnection(conn)
|
||||||
|
|
||||||
|
# Get our configuration
|
||||||
|
config = self.get_ipa_config(opts)
|
||||||
|
|
||||||
|
# Make sure we have the latest object classes
|
||||||
|
newentry['objectclass'] = uniq_list(newentry.get('objectclass') + config.get('ipauserobjectclasses'))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rv = self.update_entry(oldentry, newentry, opts)
|
rv = self.update_entry(oldentry, newentry, opts)
|
||||||
return rv
|
return rv
|
||||||
@ -878,13 +883,15 @@ class IPAServer:
|
|||||||
if self.__is_group_unique(group['cn'], opts) == 0:
|
if self.__is_group_unique(group['cn'], opts) == 0:
|
||||||
raise ipaerror.gen_exception(ipaerror.LDAP_DUPLICATE)
|
raise ipaerror.gen_exception(ipaerror.LDAP_DUPLICATE)
|
||||||
|
|
||||||
|
# Get our configuration
|
||||||
|
config = self.get_ipa_config(opts)
|
||||||
|
|
||||||
dn="cn=%s,%s,%s" % (ldap.dn.escape_dn_chars(group['cn']),
|
dn="cn=%s,%s,%s" % (ldap.dn.escape_dn_chars(group['cn']),
|
||||||
group_container,self.basedn)
|
group_container,self.basedn)
|
||||||
entry = ipaserver.ipaldap.Entry(dn)
|
entry = ipaserver.ipaldap.Entry(dn)
|
||||||
|
|
||||||
# some required objectclasses
|
# some required objectclasses
|
||||||
entry.setValues('objectClass', 'top', 'groupofnames', 'posixGroup',
|
entry.setValues('objectClass', (config.get('ipagroupobjectclasses')))
|
||||||
'inetUser')
|
|
||||||
|
|
||||||
# No need to explicitly set gidNumber. The dna_plugin will do this
|
# No need to explicitly set gidNumber. The dna_plugin will do this
|
||||||
# for us if the value isn't provided by the user.
|
# for us if the value isn't provided by the user.
|
||||||
@ -1226,6 +1233,12 @@ class IPAServer:
|
|||||||
finally:
|
finally:
|
||||||
self.releaseConnection(conn)
|
self.releaseConnection(conn)
|
||||||
|
|
||||||
|
# Get our configuration
|
||||||
|
config = self.get_ipa_config(opts)
|
||||||
|
|
||||||
|
# Make sure we have the latest object classes
|
||||||
|
newentry['objectclass'] = uniq_list(newentry.get('objectclass') + config.get('ipauserobjectclasses'))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rv = self.update_entry(oldentry, newentry, opts)
|
rv = self.update_entry(oldentry, newentry, opts)
|
||||||
return rv
|
return rv
|
||||||
@ -1590,3 +1603,8 @@ def ldap_search_escape(match):
|
|||||||
return r'\00'
|
return r'\00'
|
||||||
else:
|
else:
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def uniq_list(x):
|
||||||
|
"""Return a unique list, preserving order and ignoring case"""
|
||||||
|
set = {}
|
||||||
|
return [set.setdefault(e,e) for e in x if e.lower() not in set]
|
||||||
|
Loading…
Reference in New Issue
Block a user