error loading ucdata (error -127)

When installing openldap22-server on FreeBSD from ports, I got this error when starting slapd:

error loading ucdata (error -127)

This is a permission problem with the directory /usr/local/share/openldap/ucdata; changing the group ownership cleared it up.