mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
avoid repeating username in logs
This commit is contained in:
@@ -243,9 +243,8 @@ int get_ipv4_lease(main_server_st* s, struct proc_st* proc)
|
|||||||
|
|
||||||
/* check if it exists in the hash table */
|
/* check if it exists in the hash table */
|
||||||
if (ip_lease_exists(s, &rnd, sizeof(struct sockaddr_in)) != 0) {
|
if (ip_lease_exists(s, &rnd, sizeof(struct sockaddr_in)) != 0) {
|
||||||
mslog(s, proc, LOG_DEBUG, "cannot assign remote IP %s to '%s'; it is in use.",
|
mslog(s, proc, LOG_DEBUG, "cannot assign remote IP %s; it is in use.",
|
||||||
human_addr((void*)&rnd, sizeof(struct sockaddr_in), buf, sizeof(buf)),
|
human_addr((void*)&rnd, sizeof(struct sockaddr_in), buf, sizeof(buf)));
|
||||||
proc->username);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,9 +257,8 @@ int get_ipv4_lease(main_server_st* s, struct proc_st* proc)
|
|||||||
|
|
||||||
/* check if it exists in the hash table */
|
/* check if it exists in the hash table */
|
||||||
if (ip_lease_exists(s, &tmp, sizeof(struct sockaddr_in)) != 0) {
|
if (ip_lease_exists(s, &tmp, sizeof(struct sockaddr_in)) != 0) {
|
||||||
mslog(s, proc, LOG_DEBUG, "cannot assign remote IP %s to '%s'; it is in use.",
|
mslog(s, proc, LOG_DEBUG, "cannot assign remote IP %s; it is in use.",
|
||||||
human_addr((void*)&tmp, sizeof(struct sockaddr_in), buf, sizeof(buf)),
|
human_addr((void*)&tmp, sizeof(struct sockaddr_in), buf, sizeof(buf)));
|
||||||
proc->username);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +274,7 @@ int get_ipv4_lease(main_server_st* s, struct proc_st* proc)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
mslog(s, proc, LOG_DEBUG, "selected IP for '%s': %s", proc->username,
|
mslog(s, proc, LOG_DEBUG, "selected IP: %s",
|
||||||
human_addr((void*)&proc->ipv4->lip, proc->ipv4->lip_len, buf, sizeof(buf)));
|
human_addr((void*)&proc->ipv4->lip, proc->ipv4->lip_len, buf, sizeof(buf)));
|
||||||
|
|
||||||
if (icmp_ping4(s, (void*)&proc->ipv4->lip, (void*)&proc->ipv4->rip) == 0)
|
if (icmp_ping4(s, (void*)&proc->ipv4->lip, (void*)&proc->ipv4->rip) == 0)
|
||||||
@@ -401,9 +399,8 @@ int get_ipv6_lease(main_server_st* s, struct proc_st* proc)
|
|||||||
|
|
||||||
/* check if it exists in the hash table */
|
/* check if it exists in the hash table */
|
||||||
if (ip_lease_exists(s, &rnd, sizeof(struct sockaddr_in6)) != 0) {
|
if (ip_lease_exists(s, &rnd, sizeof(struct sockaddr_in6)) != 0) {
|
||||||
mslog(s, proc, LOG_DEBUG, "cannot assign local IP %s to '%s'; it is in use.",
|
mslog(s, proc, LOG_DEBUG, "cannot assign local IP %s; it is in use.",
|
||||||
human_addr((void*)&rnd, sizeof(struct sockaddr_in6), buf, sizeof(buf)),
|
human_addr((void*)&rnd, sizeof(struct sockaddr_in6), buf, sizeof(buf)));
|
||||||
proc->username);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,9 +415,8 @@ int get_ipv6_lease(main_server_st* s, struct proc_st* proc)
|
|||||||
|
|
||||||
/* check if it exists in the hash table */
|
/* check if it exists in the hash table */
|
||||||
if (ip_lease_exists(s, &tmp, sizeof(struct sockaddr_in6)) != 0) {
|
if (ip_lease_exists(s, &tmp, sizeof(struct sockaddr_in6)) != 0) {
|
||||||
mslog(s, proc, LOG_DEBUG, "cannot assign remote IP %s to '%s'; it is in use.",
|
mslog(s, proc, LOG_DEBUG, "cannot assign remote IP %s; it is in use.",
|
||||||
human_addr((void*)&tmp, sizeof(struct sockaddr_in6), buf, sizeof(buf)),
|
human_addr((void*)&tmp, sizeof(struct sockaddr_in6), buf, sizeof(buf)));
|
||||||
proc->username);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,7 +431,7 @@ int get_ipv6_lease(main_server_st* s, struct proc_st* proc)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
mslog(s, proc, LOG_DEBUG, "selected IP for '%s': %s", proc->username,
|
mslog(s, proc, LOG_DEBUG, "selected IP: %s",
|
||||||
human_addr((void*)&proc->ipv6->lip, proc->ipv6->lip_len, buf, sizeof(buf)));
|
human_addr((void*)&proc->ipv6->lip, proc->ipv6->lip_len, buf, sizeof(buf)));
|
||||||
|
|
||||||
if (icmp_ping6(s, (void*)&proc->ipv6->lip, (void*)&proc->ipv6->rip) == 0)
|
if (icmp_ping6(s, (void*)&proc->ipv6->lip, (void*)&proc->ipv6->rip) == 0)
|
||||||
@@ -501,11 +497,11 @@ char buf[128];
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (proc->ipv4)
|
if (proc->ipv4)
|
||||||
mslog(s, proc, LOG_INFO, "assigned IPv4 to '%s': %s", proc->username,
|
mslog(s, proc, LOG_INFO, "assigned IPv4: %s",
|
||||||
human_addr((void*)&proc->ipv4->rip, proc->ipv4->rip_len, buf, sizeof(buf)));
|
human_addr((void*)&proc->ipv4->rip, proc->ipv4->rip_len, buf, sizeof(buf)));
|
||||||
|
|
||||||
if (proc->ipv6)
|
if (proc->ipv6)
|
||||||
mslog(s, proc, LOG_INFO, "assigned IPv6 to '%s': %s", proc->username,
|
mslog(s, proc, LOG_INFO, "assigned IPv6: %s",
|
||||||
human_addr((void*)&proc->ipv6->rip, proc->ipv6->rip_len, buf, sizeof(buf)));
|
human_addr((void*)&proc->ipv6->rip, proc->ipv6->rip_len, buf, sizeof(buf)));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -241,8 +241,8 @@ struct cookie_entry_st *old;
|
|||||||
if ((old=find_cookie_entry(&s->cookies, req->cookie.data, req->cookie.len)) != NULL) {
|
if ((old=find_cookie_entry(&s->cookies, req->cookie.data, req->cookie.len)) != NULL) {
|
||||||
mslog(s, proc, LOG_DEBUG, "reusing cookie for '%s' (%u)", proc->username, (unsigned)proc->pid);
|
mslog(s, proc, LOG_DEBUG, "reusing cookie for '%s' (%u)", proc->username, (unsigned)proc->pid);
|
||||||
if (old->proc != NULL) {
|
if (old->proc != NULL) {
|
||||||
mslog(s, old->proc, LOG_DEBUG, "disconnecting '%s' (%u) due to new cookie connection",
|
mslog(s, old->proc, LOG_DEBUG, "disconnecting (%u) due to new cookie connection",
|
||||||
old->proc->username, (unsigned)old->proc->pid);
|
(unsigned)old->proc->pid);
|
||||||
|
|
||||||
/* steal its leases */
|
/* steal its leases */
|
||||||
steal_ip_leases(old->proc, proc);
|
steal_ip_leases(old->proc, proc);
|
||||||
@@ -263,7 +263,7 @@ struct cookie_entry_st *old;
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mslog(s, proc, LOG_DEBUG, "new cookie for '%s' (%u)", proc->username, (unsigned)proc->pid);
|
mslog(s, proc, LOG_DEBUG, "new cookie for (%u)", (unsigned)proc->pid);
|
||||||
|
|
||||||
proc->cookie_ptr = new_cookie_entry(&s->cookies, proc, req->cookie.data, req->cookie.len);
|
proc->cookie_ptr = new_cookie_entry(&s->cookies, proc, req->cookie.data, req->cookie.len);
|
||||||
if (proc->cookie_ptr == NULL)
|
if (proc->cookie_ptr == NULL)
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ static int accept_user(main_server_st * s, struct proc_st *proc, unsigned cmd)
|
|||||||
int ret;
|
int ret;
|
||||||
const char *group;
|
const char *group;
|
||||||
|
|
||||||
mslog(s, proc, LOG_DEBUG, "accepting user '%s'", proc->username);
|
mslog(s, proc, LOG_DEBUG, "accepting user");
|
||||||
|
|
||||||
/* check for multiple connections */
|
/* check for multiple connections */
|
||||||
ret = check_multiple_users(s, proc);
|
ret = check_multiple_users(s, proc);
|
||||||
|
|||||||
Reference in New Issue
Block a user