From d6cbba645d08321427579359d24cf74cd7802b44 Mon Sep 17 00:00:00 2001 From: Thorsten Alteholz Date: Tue, 18 Aug 2026 18:58:40 +0200 Subject: [PATCH] Due to changes in gcc, some functions like strrchr return a const-qualified type when the input argument is a pointer to a const-qualified type. While the parameter module_path is const, the resulting user_module_name must not be const, so introducing a temporary variable. --- src/pam_python.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pam_python.c b/src/pam_python.c index 3c232f6..ae1c6b9 100644 --- a/src/pam_python.c +++ b/src/pam_python.c @@ -2280,6 +2280,7 @@ static int load_user_module( PyObject* module_dict = 0; FILE* module_fp = 0; char* user_module_name = 0; + const char* tmp_const_user_module_name = 0; PyObject* py_resultobj = 0; char* dot; int pam_result; @@ -2300,11 +2301,11 @@ static int load_user_module( /* * Create the new module. */ - user_module_name = strrchr(module_path, '/'); - if (user_module_name == 0) + tmp_const_user_module_name = strrchr(module_path, '/'); + if (tmp_const_user_module_name == 0) user_module_name = strdup(module_path); else - user_module_name = strdup(user_module_name + 1); + user_module_name = strdup(tmp_const_user_module_name + 1); if (user_module_name == 0) { syslog_path_message(MODULE_NAME, "out of memory");