pam_envfeed is a PAM module that runs an
external program, grabs its output, and then
defines the environment variables this
program has emitted. It is especially useful for
dynamically setting up a PATH that depends
on many circumstances (such as whether the
user is root, or whether a directory exists or
not).