Getent workaround

From Tupelo Wiki

Not all OS's have the getent command, which Tupelo 1.1 requires. For Mac OS X, this script can be used as a stand-in for getent:

#!/bin/bash
if [ $1 != "passwd" ]
then
    echo getent standin: expects \"passwd\", got \"$1\" >/dev/stderr
else
    username=$2
    fields=(name _shadow_passwd uid gid realname home shell)
    for field in ${fields[*]}
    do
      values=("${values[@]}" "`niutil -readprop / /users/${username} ${field}`")
    done
    IFS=":"
    echo "${values[*]}"
fi

For Tupelo to use this script, it must be saved in a file called "getent" and must be located on the path of the environment from which Tomcat is launched.

Note that this is not a full-featured replacement for getent--it only supports the getent passwd usage, which is all that Tupelo requires.