|
If you haven't read my disclaimer
for my Learning SMF blog catetory, please do so.
My first SMF assignment is to add a security audit event for the
creation of a child object. The new event name will be
AUE_smf_create.
repcache_protocol.h documents the protocol between sys.configd and
its clients. In my case the message of interest is
ENTITY_CREATE_CHILD which is designated by the
REP_PROTOCOL_ENTITY_CREATE_CHILD request code defined in
the rep_protocol_requestid enum in repcache_protocol.h.
The question I now have is where does this request code get processed
in configd? The communication between sys.configd and its clients takes
place over Solaris doors. The main() function in
configd.c calls setup_main_door(). This in turn calls
door_create(3c) specifying main_switcher() as
its service procudure. main_switcher only processes
REPOSITORY_DOOR_REQUEST_CONNECT requests, however.
When main_switcher gets a connect request, it calls
create_connection() which in turn calls
create_client(). create_client in
client.c creates a new door for communication between sys.configd
and the new client. It does this by calling door_create specifying
client_switcher() as the service procedure. To summarize,
when sys.configd gets a connect request from a client, it creates a new
door for communication with that client. Subsequent requests that come
in on that door will be serviced by client_switcher in
client.c
client_switcher extracts the request code from the incomming messages,
and uses it to index into the array of protocol_entry
structures at protocol_table in client.c. After performing
some checks, client_switcher calls the function whose address is in the
pt_fd_handler member of the protocol_entry structure. From
this, I can see that entity_create_child() is the function
that is used to process REP_PROTOCOL_ENTITY_CREATE_CHILD
requests. I'll leave the discussion of this function for my next
blog.
Technorati Tags: OpenSolaris, Solaris, smf
( May 09 2006, 01:42:07 PM MDT / May 09 2006, 01:42:07 PM MDT )
Permalink
Trackback: http://blogs.sun.com/4ctom/entry/create_child_event
|