summaryrefslogtreecommitdiffstats
path: root/src/util/safe-format-string.h
Commit message (Collapse)AuthorAgeFilesLines
* util: A safe printf for user provided format stringsStef Walter2014-01-121-0/+81
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.