Bug 7458 - whichdb.py patched incorrectly in python-1.5.2-8
whichdb.py patched incorrectly in python-1.5.2-8
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: python (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-11-30 18:33 EST by jtb
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-12-02 17:15:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jtb 1999-11-30 18:33:30 EST
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 17:15:59 EST
<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.

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