mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Require that the default users group exists
Fix some copy-paste errors from the password policy update
This commit is contained in:
parent
bac556557d
commit
8ff9f63d80
@ -158,7 +158,7 @@ class IPAPolicyController(IPAController):
|
|||||||
turbogears.flash("IPA Policy updated")
|
turbogears.flash("IPA Policy updated")
|
||||||
raise turbogears.redirect('/ipapolicy/show')
|
raise turbogears.redirect('/ipapolicy/show')
|
||||||
except ipaerror.IPAError, e:
|
except ipaerror.IPAError, e:
|
||||||
turbogears.flash("Policy update failed: " + str(e) + e.detail[0]['desc'])
|
turbogears.flash("Policy update failed: " + str(e) + "<br/>" + e.detail[0]['desc'])
|
||||||
return dict(form=ipapolicy_edit_form, ipapolicy=kw,
|
return dict(form=ipapolicy_edit_form, ipapolicy=kw,
|
||||||
tg_template='ipagui.templates.ipapolicyedit')
|
tg_template='ipagui.templates.ipapolicyedit')
|
||||||
|
|
||||||
|
@ -53,9 +53,9 @@ DefaultGroupContainer = "cn=groups,cn=accounts"
|
|||||||
DefaultServiceContainer = "cn=services,cn=accounts"
|
DefaultServiceContainer = "cn=services,cn=accounts"
|
||||||
|
|
||||||
# FIXME: need to check the ipadebug option in ipa.conf
|
# FIXME: need to check the ipadebug option in ipa.conf
|
||||||
#logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
# format='%(asctime)s %(levelname)s %(message)s',
|
format='%(asctime)s %(levelname)s %(message)s',
|
||||||
# stream=sys.stderr)
|
stream=sys.stderr)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Apache runs in multi-process mode so each process will have its own
|
# Apache runs in multi-process mode so each process will have its own
|
||||||
@ -1380,14 +1380,22 @@ class IPAServer:
|
|||||||
# The LDAP routines want strings, not ints, so convert a few
|
# The LDAP routines want strings, not ints, so convert a few
|
||||||
# things. Otherwise it sees a string -> int conversion as a change.
|
# things. Otherwise it sees a string -> int conversion as a change.
|
||||||
try:
|
try:
|
||||||
newconfig['krbmaxpwdlife'] = str(newconfig.get('krbmaxpwdlife'))
|
newconfig['ipapwdexpadvnotify'] = str(newconfig.get('ipapwdexpadvnotify'))
|
||||||
newconfig['krbminpwdlife'] = str(newconfig.get('krbminpwdlife'))
|
newconfig['ipasearchtimelimit'] = str(newconfig.get('ipasearchtimelimit'))
|
||||||
newconfig['krbpwdmindiffchars'] = str(newconfig.get('krbpwdmindiffchars'))
|
newconfig['ipasearchrecordslimit'] = str(newconfig.get('ipasearchrecordslimit'))
|
||||||
newconfig['krbpwdminlength'] = str(newconfig.get('krbpwdminlength'))
|
newconfig['ipamaxusernamelength'] = str(newconfig.get('ipamaxusernamelength'))
|
||||||
newconfig['krbpwdhistorylength'] = str(newconfig.get('krbpwdhistorylength'))
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# These should all be there but if not, let things proceed
|
# These should all be there but if not, let things proceed
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Ensure that the default group for users exists
|
||||||
|
try:
|
||||||
|
group = self.get_entry_by_cn(newconfig.get('ipadefaultprimarygroup'), None, opts)
|
||||||
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
|
raise
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
return self.update_entry(oldconfig, newconfig, opts)
|
return self.update_entry(oldconfig, newconfig, opts)
|
||||||
|
|
||||||
def get_password_policy(self, opts=None):
|
def get_password_policy(self, opts=None):
|
||||||
@ -1413,6 +1421,9 @@ class IPAServer:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
# These should all be there but if not, let things proceed
|
# These should all be there but if not, let things proceed
|
||||||
pass
|
pass
|
||||||
|
except:
|
||||||
|
# Anything else raise an error
|
||||||
|
raise
|
||||||
|
|
||||||
return self.update_entry(oldpolicy, newpolicy, opts)
|
return self.update_entry(oldpolicy, newpolicy, opts)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user