From: Antonio Quartulli Date: Sat, 17 Sep 2022 16:08:18 +0200 Message-Id: <20220917140818.6155-1-a@...2181...> MIME-Version: 1.0 Subject: [Openvpn-devel] [PATCH] Add common_name to the conv method. This allows the common_name to be accessible in PAM. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net Cc: Michael Karvan From: Michael Karvan Signed-off-by: Michael Karvan --- src/plugins/auth-pam/auth-pam.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c index 70339445..9f37c8c0 100644 --- a/src/plugins/auth-pam/auth-pam.c +++ b/src/plugins/auth-pam/auth-pam.c @@ -746,8 +746,15 @@ my_conv(int n, const struct pam_message **msg_array, } break; - case PAM_ERROR_MSG: 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: break; default: -- 2.35.1