Resolves: bug 288291
Bug Description: add an view object inside a view object that has an
improper nsviewfilter crashes the server
Reviewed by: ???
Files: see diff
Fix Description: I could not reproduce the problem by simply adding the
bogus nsviewfilter. The server seemed to run fine, but I didn't stress
it. However, if I restarted the server, the server would core during
startup. The last message in the error log would say something about
recovering the database, which is probably why the bug reporter said
that it will not recover the database. The problem doesn't appear to be
with views specifically, but with any internal search which uses the
search_internal_callback_pb() (as opposed to the non callback internal
search) and there are search base rewriters (such as the views code).
The aci code uses this type of search at startup to find the acis, and
that's where I saw the crash. I could crash the server at startup
regardless of whether the view filter was bogus or not. The problem is
that we are not passing in the address of new_base to slapi_ch_free.
The fix is to use slapi_ch_free_string and pass in the address of the
string. That fixes the crash.
I also cleaned up a few places in the views code which was not checking
to see if slapi_str2filter returned NULL, which would happen in the case
of the bogus search filter. I also added an error message which will
tell the user that filter X in entry Y is bogus.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no