Project

General

Profile

Bug #1544 ยป 0015-Log-the-ip-of-failed-auth-tries-in-error.log.patch

stbuehler, 2008-02-18 20:49

View differences:

src/http_auth.c
29 29
#include "log.h"
30 30
#include "http_auth.h"
31 31
#include "http_auth_digest.h"
32
#include "inet_ntop_cache.h"
32 33
#include "stream.h"
33 34

  
34 35
#ifdef USE_OPENSSL
......
862 863

  
863 864
	/* password doesn't match */
864 865
	if (http_auth_basic_password_compare(srv, p, req, username, realm->value, password, pw)) {
865
		log_error_write(srv, __FILE__, __LINE__, "sbb", "password doesn't match for", con->uri.path, username);
866
		log_error_write(srv, __FILE__, __LINE__, "sbbss", "password doesn't match for ", con->uri.path, username, ", IP:", inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
866 867

  
867 868
		buffer_free(username);
868 869
		buffer_free(password);
......
1130 1131
		}
1131 1132

  
1132 1133
		log_error_write(srv, __FILE__, __LINE__, "sss",
1133
				"digest: auth failed for", username, "wrong password");
1134
				"digest: auth failed for ", username, ": wrong password, IP:", inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
1134 1135

  
1135 1136
		buffer_free(b);
1136 1137
		return 0;
    (1-1/1)