summaryrefslogtreecommitdiffstats
path: root/src/tests/safe-format-tests.c
Commit message (Collapse)AuthorAgeFilesLines
* TESTS: Fix build with older version of check frameworkLukas Slebodnik2014-01-151-0/+8
|
* util: A safe printf for user provided format stringsStef Walter2014-01-121-0/+244
Since the default printf(3) implementation cannot safely be used on user (or admin) provided input, this is a safe implementation. This will be used in later patches by the full_name_format option The implementation came from realmd, but only has libc dependencies. The number of fields is pre-defined, and safe printf fails if an invalid field is accessed. Only string fields are supported, and only flags relevant to string fields are supported. Width and precision work as expected, but precision cannot read from a field. Tests are included, and ported to the check based testing that sssd uses.