summaryrefslogtreecommitdiff
path: root/src/sp_utils.h (follow)
AgeCommit message (Collapse)Author
2024-06-06Add format attribute to log function and adjust format specifiersChristian Göttsche
Annotate the common logging function sp_log_msgf() with the format attribute so compilers can check the used format string and passed arguments for discrepancies. Adjust the lineno printing by using %zu and the type size_t consistently.
2024-06-06Avoid dropping const qualifier in castsChristian Göttsche
Adjusts casts to void dropping const qualifiers. This helps to avoid mistakes, e.g. modifying string literals. Also use size_t for length, similar to the upstream php interfaces.
2022-07-13Even more const!jvoisin
2022-02-05introduced sp_regexp / store original regexBen Fuhrmannek
2021-12-14fix: include class name in eval whitelist matchingBen Fuhrmannek
2021-11-30added @log logging feature to config parserBen Fuhrmannek
2021-09-23config is stack allocated now + some code improvements (see details)Ben Fuhrmannek
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible * SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read * execution_depth is re-initialized to 0 for each request * function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1 * execution is actually hooked if recursion protection is enabled * some line breaks were removed to make the code more readable
2021-08-16fincy new scanner/parser for config rules + fixed a few bugs along the way + ↵Ben Fuhrmannek
fixed related unittests
2021-08-07prevent STDERR debug output based on SP_NODEBUG environment variableBen Fuhrmannek
2021-08-06restructured function hooks, implemented unhookBen Fuhrmannek
2021-08-06debug log to dup'd stderr / php is closing stderr during shutdownBen Fuhrmannek
2021-02-16fix debug logBen Fuhrmannek
2021-02-16Merge remote-tracking branch 'upstream/master'Ben Fuhrmannek
2021-01-30Improve a bit type diversityjvoisin
2021-01-01Constify a functionjvoisin
2020-11-06Clang-format againjvoisin
2020-11-06Use proper prototype declarationjvoisin
2020-07-22refactoring sp_log_* (#340)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2020-07-21Fix #338 - added log type if type is simulation, drop or log. (#339)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2020-07-08Add a couple of `restrict`jvoisin
2020-07-04Factorize how snuffleupagus gets client's ip addrjvoisin
2020-06-15clobal config.h + better debug logBen Fuhrmannek
2018-10-06Bump a bit the coveragejvoisin
* `setcookie` doesn't always return `true` anymore * clang-format * Cookies with invalid decryption are dropped, but the request isn't anymore * faulty unserialize are now dumpable
2018-09-03Fix #241 segfault on 32-bit related to bad protype (#242)Remi Collet
This should close #241
2018-08-30Match on ret improvementsxXx-caillou-xXx
This commit does two things: - Implement matching on calltraces for ret - Implement matching on ret of user functions if the return value is not used.
2018-08-28Fix some compilation warningsxXx-caillou-xXx
2018-08-28Use php's logging functionsxXx-caillou-xXx
This commit replace our usage of `php_log_err` with `zend_error`. This should allow administrators to display errors in the webpage, should they want to; and to properly manipulate the verbosity's level. This should close #217
2018-07-13Yet an other pass of clang-formatjvoisin
2018-07-13Massively optimize how rules are handledxXx-caillou-xXx
This commit does a lot of things: - Use hashtables instead of lists to store the rules - Rules that can be applied at launch time won't be tried at runtime - Improve feedback when writing nonsensical rules - Make intensive use of `zend_string` instead of `char*`
2018-03-19The filename filter is now matching on callsite instead of implemsite (#167)kkadosh
* Add match on the file where the function is called * Add the test * Constify some params * Fix potentiel null deref * Return more before if execute_data is NULL
2018-03-02Fix a warning due to an unexported symboljvoisin
2018-02-05Massive simplification of functions hookingjvoisin
2018-02-05Compatibility layer for pcre2jvoisin
This should close #129
2018-01-11Remove some legacy codejvoisin
2018-01-10Rework the priority of bl/wl in evaljvoisin
2017-12-28Clang-format passThibault "bui" Koechlin
- `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h` - Update the documentation accordingly
2017-12-20Better parsing of the rulesxXx-caillou-xXx
Thanks to this huge commit from @xXx-caillou-xXx, we can now write amazingly flexible rules.
2017-10-26Remove an arbitrary limitationjvoisin
2017-10-13Improve the doc wrt. the Debian packagejvoisin
- Fix two minor warnings - Improve the documentation
2017-10-13Partially revert d8ac163 because php.jvoisin
2017-10-13Fix some pedantic warningsjvoisin
2017-10-10Make the `simulation` mode logs more obviousjvoisin
2017-09-21Add travisjvoisin
2017-09-20Initial importSebastien Blot