It works by being setuid, so that it can execute the jail_attac…
(more)
It works by being setuid, so that it can execute the jail_attach() call as root. It then tests the user name and user ID of the calling user to ensure that they are identical inside the jail to the host system. This acts as a sanity check.
(less)