Skip to contentSkip to conversation

Common database code

SEMANAGE 3 Ivan Gyurdiev 1 participant 2 messages Oct 31, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

This patch merges the handling of the default database with transaction management (enter_ro/exit_ro/exit_rw), and cache management, and puts that in common (polymorphed) code - database.c. It changes relay functions and internal invocation to use this code. In order to do that, the cache() function was exposed in the database interface, and now it must be called before other functionality dealing with records is used (called internally, of course).

Also, cleans up includes for relay functions (and removes unnecessary and obsolete defines of database backend - those relays should be backend independent).

Benefits:
- transaction enter/exit code is now shared for all databases, and can be easily changed
- this also removes duplicate code, and makes the per-backend database code simpler
- no need to write things like get_rtable/flush/drop_cache in the default database, which make no sense
- Note that the per-backend dbase functions are now reentrant-safe, which means that I can layer one on top of another if I want to
- this still doesn't let me call other database functions from an iterate() handler, but I think it might get us closer to this goal.

#1 lore raw
Quoted 5 lines

- this still doesn't let me call other database functions from an iterate() handler, but I think it might get us closer to this goal.

I mean outside a transaction...inside a transaction this will work just fine as is..

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.