4 ms·
Just found a little gem myself. I am working on another open source search engine[0], and needed a way to make bad behaving document filters timeout. Unfortuna
by runarb 13y ago
Just found a little gem myself. I am working on another open source search engine[0], and needed a way to make bad behaving document filters timeout.
Unfortunately the document filter in questioning dose spawn child processes, so the normal way of using fork() and a monitoring process was not working. However using ulimit like this should work:
https://github.com/gigablast/open-source-search-engine/blob/master/gbfilter.cpp#L265 https://github.com/gigablast/open-source-search-engine/blob/... . Hadn’t thought about spanning a new shell and let it have control like that :)
0: https://github.com/searchdaimon/enterprise-search https://github.com/searchdaimon/enterprise-search
- conductor 13y agoThere is possible buffer overflow right there (if the HOME directory is long enough). Why don't people use snprintf?
- runarb 13y ago>Why don't people use snprintf? Old habits perhaps? When I look back at it I remember that my first books on C were full of problematic sprintf and strcpy use. It may then easy to continue using what you first learned, even when you know better. It basically the "Baby duck syndrome"[0] for C functions. 0: http://en.wikipedia.org/wiki/Imprinting_(psychology)#Baby_duck_syndrome http://en.wikipedia.org/wiki/Imprinting_(psychology)#Baby_du...