[Bro-Dev] script loading implementation

Gregor Maier gregor at icir.org
Sat Jun 18 09:46:21 PDT 2011

Instead of going for the path you can go for the inode of the file. See
man fstat(2). That will even take care of links.


On 6/17/11 14:54 , Jonathan Siwek wrote:
>>> but could it just generally canonicalize all scripts
>>> to their full *absolute* paths of the actual files being loaded
>>> (i.e., always including the .bro extensions) and then remember
>>> those?
> Err, I don't think it's trivial in C/C++ without extra libraries (e.g. Boost) to get absolute paths from relative ones (we can't rely just on BROPATH since that may also have relative paths in it) let alone compare that two lexical file representations actual resolve to the same file (duplicate '/', embedded './'s, etc.).
> I think it works to just track/remember inode numbers, though.
> - Jon
> _______________________________________________
> bro-dev mailing list
> bro-dev at bro-ids.org
> http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev

Gregor Maier
<gregor at icir.org>  <gregor at icsi.berkeley.edu>
Int. Computer Science Institute (ICSI)
1947 Center St., Ste. 600
Berkeley, CA 94704, USA

More information about the bro-dev mailing list