apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57900] New: GDBM backend: error returned on fetch and delete for non-existing key
Date Thu, 07 May 2015 16:09:17 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=57900

            Bug ID: 57900
           Summary: GDBM backend: error returned on fetch and delete for
                    non-existing key
           Product: APR
           Version: 1.5.2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR-util
          Assignee: bugs@apr.apache.org
          Reporter: Diego.SantaCruz@spinetix.com

Created attachment 32722
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=32722&action=edit
Patch to fix the key not found issue with GDBM

The GDBM backend returns an error on apr_dbm_fetch() and apr_dbm_delete() when
the key does not exist.

This is different from the DB, SDBM and NDBM backends which return no error
when the key does not exist.

A consequence of this is that code which checks the error code on these calls
starts to fail when apr-util is built with GDBM (but not Berkeley), like
httpd's dav_fs locking (see bug #42977).

The GDBM documentation states that gdbm_errno is set to GDBM_ITEM_NOT_FOUND for
fetch and delete when the key is not found, but set_error() in apr_dbm_gdbm.c
does not special case this.

I experienced this with apr-util 1.5.2 but the code has not changed in the
1.5.x branch (just checked) nor in apr's trunk.

I attach a patch which fixes the problem (tested with mod_dav_fs in Apache
httpd 2.4.6).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message