Univention Bugzilla – Attachment 8841 Details for
Bug 44584
improove check_cracklib.py error handling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
44583.patch (text/plain), 1.72 KB, created by
Florian Best
on 2017-05-11 17:29:39 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2017-05-11 17:29:39 CEST
Size:
1.72 KB
patch
obsolete
>diff --git a/base/univention-heimdal/conffiles/usr/share/univention-heimdal/check_cracklib.py b/base/univention-heimdal/conffiles/usr/share/univention-heimdal/check_cracklib.py >index 293566f..2cfb712 100644 >--- a/base/univention-heimdal/conffiles/usr/share/univention-heimdal/check_cracklib.py >+++ b/base/univention-heimdal/conffiles/usr/share/univention-heimdal/check_cracklib.py >@@ -30,30 +30,40 @@ > import sys > import univention.password > >-params = {} >-end = False >-while not end: >- line = sys.stdin.readline() >- line = line[:-1] >- if line == 'end': >- end = True >- continue > >- try: >- key, val = line.split(': ', 1) >- except: >- print 'key value pair is not correct: %s' % line >+def main(): >+ params = {} >+ end = False >+ while not end: >+ line = sys.stdin.readline() >+ line = line[:-1] >+ if line == 'end': >+ end = True >+ continue >+ >+ try: >+ key, val = line.split(': ', 1) >+ except: >+ print 'key value pair is not correct: %s' % line >+ sys.exit(1) >+ params[key] = val >+ >+ if 'new-password' not in params: >+ print 'missing password' > sys.exit(1) >- params[key] = val > >-if 'new-password' not in params: >- print 'missing password' >- sys.exit(1) >+ if 'principal' in params: >+ pwdCheck = univention.password.Check(None, params['principal']) >+ try: >+ pwdCheck.check(params['new-password']) >+ print 'APPROVED' >+ except ValueError as e: >+ print str(e) > >-if 'principal' in params: >- pwdCheck = univention.password.Check(None, params['principal']) >- try: >- pwdCheck.check(params['new-password']) >- print 'APPROVED' >- except ValueError as e: >- print str(e) >+ >+try: >+ main() >+except: >+ import traceback >+ print traceback.format_exc().replace('\n', ' ') # heimdal-kdc / kpasswd only displays the first line as error message. >+ sys.exit(1)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44584
: 8841