Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 225860 - python binding behaves poorly when specifying dictpath
Summary: python binding behaves poorly when specifying dictpath
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: cracklib
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Nalin Dahyabhai
QA Contact: Brian Brock
Depends On: 224347
TreeView+ depends on / blocked
Reported: 2007-01-31 18:58 UTC by Nalin Dahyabhai
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHEA-2007-0259
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-05-01 17:35:00 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2007:0259 normal SHIPPED_LIVE cracklib enhancement update 2007-05-01 17:34:16 UTC

Description Nalin Dahyabhai 2007-01-31 18:58:41 UTC
+++ This bug was initially created as a clone of Bug #224347 +++

FascistCheck() exhibits two problems when specifying a dictpath:

1.) It checks for the existence of the path, not the path plus ".pwd" as with
the default. This means you can't specify an alternative path at all because
it'll throw an exception in any case. You can't work around it either because
2.) if you specify the path plus ".pwd" yourself, the python module now finds
the file, passes path+".pwd" to cracklib which barfs on the non-existence of
path+".pwd.pwd" and apparently calls exit() or something else which ends the
python interpreter (without traceback or other such superfluopus things ;-).

Version-Release number of selected component (if applicable):
Judging from the code, this problem exists in Rawhide (cracklib-2.8.9-6) as well.

How reproducible:

Steps to Reproduce:
1. Run this test program:

--- 8< ---

from cracklib import *

for path in ('/usr/share/cracklib/pw_dict', '/usr/share/cracklib/pw_dict.pwd'):
        print FascistCheck ('foo', path)
    except Exception, e:
        print e

print "foo"
Actual results:
nils@wombat:~> ./ 
[Errno 2] No such file or directory: '/usr/share/cracklib/pw_dict'
/usr/share/cracklib/pw_dict.pwd.pwd: No such file or directory
PWOpen: Illegal seek

Expected results:
No traceback with the first path in the list, a (caught) traceback with the
second path, and the line "foo".

-- Additional comment from on 2007-01-25 12:33 EST --
Quite right.  Fixing in Raw Hide shortly.  Let me know if you need this updated
in FC6 as well.

-- Additional comment from on 2007-01-29 11:48 EST --
As I have dicovered now, I don't need to specify the dictpath to use the
standard dictionary. Would it be much work to change the module so that "pydoc
cracklib" on the cmdline or "help(FascistCheck)" from within python would
mention that, i.e. not only have "FascistCheck(...)" without the arguments?

Comment 6 Red Hat Bugzilla 2007-05-01 17:35:00 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.