The only current interactivity detection code in pam is part of a pam.conf -> pam.d conversion tool that won't be useful here.
The pam_motd code emits content via things like try_to_display_fd.
A message is created and then printed via pam_info.
Which is actually pam_prompt which wraps pam_vprompt
This gets the conversation function via
retval = pam_get_item (pamh, PAM_CONV, &convp);
and on that it then emits the message
retval = conv->conv (1, &pmsg, &pam_resp, conv->appdata_ptr);
Either via this PAM_CONV and then attributes of that channel (as it is what we'd print on) OR via something like pam_get_item(pamh, PAM_TTY, &tty); we might get access from pam_motd to something that we can work out if it is interactive.
I'm busy with other things now (for the rest of today), but I want ton continue tomorrow.
I want this at least to get into a clear state that is sure if:
a) this is as important as I think
b) the steps needed from here are clear
The only current interactivity detection code in pam is part of a pam.conf -> pam.d conversion tool that won't be useful here.
The pam_motd code emits content via things like try_to_display_fd.
A message is created and then printed via pam_info.
Which is actually pam_prompt which wraps pam_vprompt
This gets the conversation function via
retval = pam_get_item (pamh, PAM_CONV, &convp);
and on that it then emits the message
retval = conv->conv (1, &pmsg, &pam_resp, conv->appdata_ptr);
Either via this PAM_CONV and then attributes of that channel (as it is what we'd print on) OR via something like pam_get_item(pamh, PAM_TTY, &tty); we might get access from pam_motd to something that we can work out if it is interactive.
I'm busy with other things now (for the rest of today), but I want ton continue tomorrow.
I want this at least to get into a clear state that is sure if:
a) this is as important as I think
b) the steps needed from here are clear