+2003-05-27 Tom Yu <tlyu@mit.edu>
+
+ * schpw.c (process_chpw_request): Log chpw requests.
+
2003-05-16 Ken Raeburn <raeburn@mit.edu>
* schpw.c (process_chpw_request): Return KRB5_KPASSWD_BAD_VERSION
#define NEED_SOCKETS
#include "k5-int.h"
#include <kadm5/admin.h>
-
+#include <syslog.h>
+#include <krb5/adm_proto.h> /* krb5_klog_syslog */
#include <stdio.h>
#include <errno.h>
krb5_error krberror;
int numresult;
char strresult[1024];
+ char *clientstr;
ret = 0;
rep->length = 0;
goto chpwfail;
}
+ ret = krb5_unparse_name(context, ticket->enc_part2->client, &clientstr);
+ if (ret) {
+ numresult = KRB5_KPASSWD_HARDERROR;
+ strcpy(strresult, "Failed unparsing client name for log");
+ goto chpwfail;
+ }
/* change the password */
ptr = (char *) malloc(clear.length+1);
free(ptr);
clear.length = 0;
+ krb5_klog_syslog(LOG_NOTICE, "chpw request from %s for %s: %s",
+ inet_ntoa(((struct sockaddr_in *)&remote_addr)->sin_addr),
+ clientstr, ret ? error_message(ret) : "success");
+ krb5_free_unparsed_name(context, clientstr);
+
if (ret) {
if ((ret != KADM5_PASS_Q_TOOSHORT) &&
(ret != KADM5_PASS_REUSE) && (ret != KADM5_PASS_Q_CLASS) &&