The following code writes this to /var/log/auth.log:
------ ... PAM_SERVICE: lightdm. ... Have no PAM_TTY. ... Have now XDisplay: "(null)" and XAuth: "(null)". ------
This is the pam_sm_authenticate function of the PAM module:
<code>
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) { const char *service = NULL; char* xdisp = getenv("DISPLAY"); char* xauth = getenv("XAUTHORITY");
// Requested service pam_get_item(pamh, PAM_SERVICE, (const void **)(const void*)&service); if (service != NULL && strlen(service) > 0) { syslog(LOG_DEBUG, "PAM_SERVICE: %s.", (const char*)service); }
if (xdisp == NULL) { // Trying to get the xdisplay pam_get_item(pamh, PAM_XDISPLAY, (const void **)(const void*)&xdisp); if (xdisp == NULL) { pam_get_item(pamh, PAM_TTY, (const void **)(const void*)&xdisp); if (xdisp == NULL || strlen(xdisp) == 0) { syslog(LOG_DEBUG, "Have no PAM_TTY."); xdisp = NULL; } else { syslog(LOG_DEBUG, "Have PAM_TTY: %s.", xdisp); if(xdisp[0] != ':'){// looks not like a X-Display syslog(LOG_DEBUG, "Have no DISPLAY from PAM_TTY."); xdisp = NULL; } else{ syslog(LOG_DEBUG, "Have DISPLAY %s from PAM_TTY.", xdisp); setenv("DISPLAY", xdisp, -1); } } } else { syslog(LOG_DEBUG, "Have DISPLAY %s from pam_get_item.", xdisp); setenv("DISPLAY", xdisp, -1); } } else syslog(LOG_DEBUG, "Have DISPLAY %s from getenv.", xdisp);
syslog(LOG_DEBUG, "Have now XDisplay: \"%s\" and XAuth: \"%s\".", xdisp, xauth); }
</code>
This means none of the variables are set. The module cannot display it's widget.
The following code writes this to /var/log/auth.log:
------
... PAM_SERVICE: lightdm.
... Have no PAM_TTY.
... Have now XDisplay: "(null)" and XAuth: "(null)".
------
This is the pam_sm_authenticate function of the PAM module:
<code>
PAM_EXTERN int pam_sm_ authenticate( pam_handle_ t *pamh, int flags, int argc, const char **argv) { "XAUTHORITY" );
const char *service = NULL;
char* xdisp = getenv("DISPLAY");
char* xauth = getenv(
// Requested service get_item( pamh, PAM_SERVICE, (const void **)(const void*)&service);
syslog( LOG_DEBUG, "PAM_SERVICE: %s.", (const char*)service);
pam_
if (service != NULL && strlen(service) > 0) {
}
if (xdisp == NULL) { // Trying to get the xdisplay
pam_get_ item(pamh, PAM_XDISPLAY, (const void **)(const void*)&xdisp);
pam_ get_item( pamh, PAM_TTY, (const void **)(const void*)&xdisp);
syslog( LOG_DEBUG, "Have no PAM_TTY.");
xdisp = NULL;
syslog( LOG_DEBUG, "Have PAM_TTY: %s.", xdisp);
if(xdisp[ 0] != ':'){// looks not like a X-Display
syslog( LOG_DEBUG, "Have no DISPLAY from PAM_TTY.");
xdisp = NULL;
else{
syslog( LOG_DEBUG, "Have DISPLAY %s from PAM_TTY.", xdisp);
setenv( "DISPLAY" , xdisp, -1);
syslog( LOG_DEBUG, "Have DISPLAY %s from pam_get_item.", xdisp);
setenv( "DISPLAY" , xdisp, -1);
syslog( LOG_DEBUG, "Have DISPLAY %s from getenv.", xdisp);
if (xdisp == NULL) {
if (xdisp == NULL || strlen(xdisp) == 0) {
}
else {
}
}
}
}
else {
}
}
else
syslog( LOG_DEBUG, "Have now XDisplay: \"%s\" and XAuth: \"%s\".", xdisp, xauth);
}
</code>
This means none of the variables are set. The module cannot display it's widget.