Bug 7458

Summary: whichdb.py patched incorrectly in python-1.5.2-8
Product: [Retired] Red Hat Raw Hide Reporter: jtb
Component: pythonAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-12-02 22:15:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jtb 1999-11-30 23:33:30 UTC
The last 16 lines of /usr/lib/python1.5/whichdb.py are currently (note that
lines 5-7 should be between lines 13 and 15):

    # Check for BSD hash
    if magic in (0x00061561, 0x61150600):
        return "dbhash"

    # Check for BSD hash
    if magic in (0x00061561, 0x61150600):
        return "dbhash"

    # BSD hash v2 has a 12-byte NULL pad in front of the file type
    try:
        (magic,) = struct.unpack("=l", s16[-4:])
    except struct.error:
        return ""

    # Unknown
    return ""


This should read:

    # Check for BSD hash
    if magic in (0x00061561, 0x61150600):
        return "dbhash"

    # BSD hash v2 has a 12-byte NULL pad in front of the file type
    try:
        (magic,) = struct.unpack("=l", s16[-4:])
    except struct.error:
        return ""

    # Check for BSD hash
    if magic in (0x00061561, 0x61150600):
        return "dbhash"

    # Unknown
    return ""

otherwise, grabbing the magic number the second time has no effect and
yeilds an unknown db every time.

Comment 1 Michael K. Johnson 1999-12-02 22:15:59 UTC
<sigh>, thought I took that straight from Guido's note on the python
bug tracking system.

Fixing now, thanks for the note, will be in python-1.5.2-9 in the
next rawhide.