? Linux-PAM/modules/pam_unix/dynamic ? Linux-PAM/modules/pam_unix/unix_chkpwd Index: Linux-PAM/modules/pam_unix/support.c =================================================================== RCS file: /afs/sipb.mit.edu/project/debian/cvs/pam/Linux-PAM/modules/pam_unix/support.c,v retrieving revision 1.8 diff -u -r1.8 support.c --- Linux-PAM/modules/pam_unix/support.c 31 May 2003 23:46:17 -0000 1.8 +++ Linux-PAM/modules/pam_unix/support.c 24 Mar 2004 00:51:35 -0000 @@ -33,24 +33,25 @@ void _log_err(int err, pam_handle_t *pamh, const char *format,...) { - char *service = NULL; - char logname[256]; va_list args; + const char tag[] = "(pam_unix) "; + char *mod_format; + int free_mod_format = 1; - pam_get_item(pamh, PAM_SERVICE, (const void **) &service); - if (service) { - strncpy(logname, service, sizeof(logname)); - logname[sizeof(logname) - 1 - strlen("(pam_unix)")] = '\0'; - strncat(logname, "(pam_unix)", strlen("(pam_unix)")); + mod_format = malloc( 1 + sizeof(tag) + strlen(format)); + if(mod_format == NULL) { + free_mod_format = 0; + mod_format = (char *) format; } else { - strncpy(logname, "pam_unix", sizeof(logname) - 1); + strcpy(mod_format, tag); + strcat( mod_format, format); } va_start(args, format); - openlog(logname, LOG_CONS | LOG_PID, LOG_AUTH); - vsyslog(err, format, args); + vsyslog(err | LOG_AUTH, mod_format, args); va_end(args); - closelog(); + + if (free_mod_format) free(mod_format); } /* this is a front-end for module-application conversations */