Add common_name to the conv method. This allows the common_name to be accessible in PAM.
PATCH 1/1 Add common_name to the conv method. This allows the common_name to be accessible in PAM.
--- src/plugins/auth-pam/auth-pam.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
src/plugins/auth-pam/auth-pam.c +8 -1
@@ -637,9 +637,16 @@ my_conv(int n, const struct pam_message **msg_array, ret =PAM_CONV_ERR ; }break ; + +case PAM_TEXT_INFO : + aresp[i].resp =strdup (up->common_name); +if (aresp[i].resp ==NULL ) + { + ret =PAM_CONV_ERR ; + } +break ;case PAM_ERROR_MSG : -case PAM_TEXT_INFO :break ;default :
Signature · 1 line
2.1.4
Hi,
Quoted 10 lines · Michael Karvan
--- src/plugins/auth-pam/auth-pam.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)src/plugins/auth-pam/auth-pam.c +0
-0@@ -637,9 +637,16 @@ my_conv(int n, const struct pam_message **msg_array, ret =PAM_CONV_ERR ;
src/plugins/auth-pam/auth-pam.c my_conv(int n, const struct pam_message **msg_array, · line 647
Quoted 10 lines
src/plugins/auth-pam/auth-pam.c +8
-0}break ; + +case PAM_TEXT_INFO : + aresp[i].resp =strdup (up->common_name); +if (aresp[i].resp ==NULL ) + { + ret =PAM_CONV_ERR ; + } +break ;
The purpose of PAM_TEXT_INFO is for the module to send an info message to the user. Using it to send the common name back to the module is hackish. Yes, it can work in a custom module but its not right to interpret everyPAM_TEXT_INFO msg as a request for common name.
Why not prompt for it just like username and have the plugin return it?
Selva
Hi,
Quoted 31 lines · Selva Nair
Hi,
Quoted 10 lines · Michael Karvan
--- src/plugins/auth-pam/auth-pam.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)src/plugins/auth-pam/auth-pam.c +0
-0@@ -637,9 +637,16 @@ my_conv(int n, const struct pam_message **msg_array, ret =PAM_CONV_ERR ;src/plugins/auth-pam/auth-pam.c my_conv(int n, const struct pam_message **msg_array, · line 647
Quoted 10 lines
src/plugins/auth-pam/auth-pam.c +8
-0}break ; + +case PAM_TEXT_INFO : + aresp[i].resp =strdup (up->common_name); +if (aresp[i].resp ==NULL ) + { + ret =PAM_CONV_ERR ; + } +break ;The purpose of
PAM_TEXT_INFOis for the module to send an info message to the user. Using it to send the common name back to the module is hackish. Yes, it can work in a custom module but its not right to interpret everyPAM_TEXT_INFOmsg as a request for common name.
Quoted 1 line
Why not prompt for it just like username and have the plugin return it?
In case I was not clear enough. NAK on the current patch. A modified one could be considered.
Selva