[osiris-devel] context in filters

Adrian Bridgett adrian at smop.co.uk
Sun Feb 4 18:17:05 EST 2007


Hi, and a huge thank you for osiris, I'm a huge fan :D

I've had a problem where if the daemon is asked to scan a directory
including a named pipe then it hangs.  Initially I thought this would
be a simple "find the check code and skip if it's a named pipe"

However scanner.c does the right thing (tm) - it skips the checksum of
the file if it's zero length.  

A little digging later shows that it's the filters that are biting me
- I watch for executable and scripts in /tmp - and they do not skip
trying to open and read a file if it's zero length.

I'd submit a patch but I have a question - there seems to be a bit of
confusion over what state context is in when filters are called and
whether "context" and/or "context->file_stats" can be null in a filter.

For example, filter_sticky.c checks if context or context->file_stats
is NULL, however, filter_group doesn't bother.

filter_uid checks to see if context->file_stats or context is NULL
(well, it would have crashed by then if context was NULL...)

Does anyone know the answer?

Many thanks,

Adrian 
-- 
Adrian Bridgett - adrian at smop.co.uk
GPG key available on public key servers



More information about the osiris-devel mailing list