We use string_to_sid() from internal Samba libraries, so we have to link to it properly. In addition, size_t is (long unsigned int), just cast to (int) in asprintf. Fixes: https://pagure.io/freeipa/issue/8585 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>