The exec service module for PAM executes the program designated by its first argument, with its remaining arguments as command-line arguments. The child's environment is set to the current PAM environment list, as returned by
pam_getenvlist(3). In addition, the following PAM items are exported as environment variables:
PAM_RHOST,
PAM_RUSER,
PAM_SERVICE,
PAM_TTY, and
PAM_USER.