]> arthur.barton.de Git - netatalk.git/commit
Fix a possible crash when searching on large volumes
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 11 Dec 2012 12:42:12 +0000 (13:42 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 11 Dec 2012 15:00:40 +0000 (16:00 +0100)
commit7d260cdde7b048b1bb7bb61ea396ac9c3ce677de
tree48cc4c346d67faf20ae85c094e57bac0572cc9c0
parent3343c2d8c60d0f8ceea24db14d42eada625e7631
Fix a possible crash when searching on large volumes

catsearch() used dirlookup() to lookup directories, but then it didn't
use movecwd() to cd into them, only lchdir(). This resulted in curdir
not being updated.
Then, while processing entries of directory and adding them to the
dircache, in case the dircache hit its maximum size limit, dircache
eviction would take place.
The dircache eviction will remove a fixed size number of directories
from the cache, but for every entry to be freed it will ensure that
it's nor curdir.
Unfortunately as catsearch didn't update that, the directory that
catsearch was working on was freed, which of course resulted in access
of invalid ressouces and possible crashes.
The fix is to just use movecwd() instead of lchdir()ing directly.
etc/afpd/catsearch.c