<commit_before>diff -rc slim-1.2.6-orig/app.cpp slim-1.2.6/app.cpp
*** slim-1.2.6-orig/app.cpp	2006-09-15 23:00:37.000000000 +0200
--- slim-1.2.6/app.cpp	2007-06-05 12:45:58.000000000 +0200
***************
*** 25,30 ****
--- 25,68 ----
  #include "app.h"
  #include "numlock.h"
  
+ #ifdef USE_PAM
+ #include <security/pam_appl.h>
+ #include <security/pam_misc.h>
+ #include <string>
+ 
+ pam_handle_t* pamh;
+ char const* PAM_service = "login"; // <----- Change this, if the patch gets accepted upstream
+ string password;
+ 
+ int conv(int num_msg, const struct pam_message **msg,
+          struct pam_response **resp, void *appdata_ptr){
+     *resp = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response));
+     for (int i=0; i<num_msg; i++){
+         resp[i]->resp_retcode=0;
+         switch(msg[i]->msg_style){
+             case PAM_PROMPT_ECHO_ON:
+                 // We assume PAM is asking for the username
+ 				// As we should have given that already, this should never happen
+ 				cerr << APPNAME << ": PAM send an unexpected PAM_PROMPT_ECHO_ON" << endl;
+ 				cerr << APPNAME << ": " << msg[i]->msg << endl;
+                 break;
+ 
+             case PAM_PROMPT_ECHO_OFF:
+                 // We assume PAM is asking for the password
+                 resp[i]->resp=x_strdup(password.c_str());
+                 break;
+ <commit_msg>* Use the PAM service "slim", not "login".<commit_after>diff -rc slim-1.2.6-orig/app.cpp slim-1.2.6/app.cpp
*** slim-1.2.6-orig/app.cpp	2006-09-15 23:00:37.000000000 +0200
--- slim-1.2.6/app.cpp	2007-06-05 12:45:58.000000000 +0200
***************
*** 25,30 ****
--- 25,68 ----
  #include "app.h"
  #include "numlock.h"
  
+ #ifdef USE_PAM
+ #include <security/pam_appl.h>
+ #include <security/pam_misc.h>
+ #include <string>
+ 
+ pam_handle_t* pamh;
+ char const* PAM_service = "slim"; // <----- Change this, if the patch gets accepted upstream
+ string password;
+ 
+ int conv(int num_msg, const struct pam_message **msg,
+          struct pam_response **resp, void *appdata_ptr){
+     *resp = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response));
+     for (int i=0; i<num_msg; i++){
+         resp[i]->resp_retcode=0;
+         switch(msg[i]->msg_style){
+             case PAM_PROMPT_ECHO_ON:
+                 // We assume PAM is asking for the username
+ 				// As we should have given that already, this should never happen
+ 				cerr << APPNAME << ": PAM send an unexpected PAM_PROMPT_ECHO_ON" << endl;
+ 				cerr << APPNAME << ": " << msg[i]->msg << endl;
+                 break;
+ 
+             case PAM_PROMPT_ECHO_OFF:
+                 // We assume PAM is asking for the password
+                 resp[i]->resp=x_strdup(password.c_str());
+                 break;
+ 
{'fraction_non_alphanumeric': 0.17075812274368232, 'fraction_numerical': 0.054873646209386284, 'mean_word_length': 2.5389527458492975, 'pattern_counts': {'":': 4, '<': 41, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6433013', 'n_tokens_mistral': 1120, 'n_tokens_neox': 997, 'n_words': 233}