History log of /sssd/src/util/safe-format-string.h
Revision Date Author Comments Expand
b9d8c6172e48a2633ebe196b2e88bebdf9523c20 12-Jan-2014 Stef Walter <stefw@redhat.com>

util: A safe printf for user provided format strings 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.