Actions
Bug #3685
closedIncorrect logging level for messages
Affected Versions:
Effort:
low
Difficulty:
low
Label:
Beginner
Description
File: unix-manager.c
Function: UnixCommandRun
Below line is under the "else" part of "if" which checks for return code of "recv".
https://github.com/OISF/suricata/blob/master/src/unix-manager.c#L577
ret = recv(client->fd, buffer + offset, sizeof(buffer) - offset - 1, 0);
do {
if (ret <= 0) {
if (ret == 0) {
SCLogInfo("Unix socket: lost connection with client");
} else {
SCLogInfo("Unix socket: error on recv() from client: %s",
strerror(errno));
}
UnixCommandClose(this, client->fd);
return;
}
As you can see, we are using SCLogInfo
instead of SCLogError
.
Similarly, the "if part should use SCLogDebug
instead of SCLogInfo
.
Below part if very similar code which is executed when handling when client->version <= UNIX_PROTO_V1
if (client->version <= UNIX_PROTO_V1) {
ret = recv(client->fd, buffer, sizeof(buffer) - 1, 0);
if (ret <= 0) {
if (ret == 0) {
SCLogDebug("Unix socket: lost connection with client");
} else {
SCLogError(SC_ERR_SOCKET, "Unix socket: error on recv() from client: %s",
strerror(errno));
}
UnixCommandClose(this, client->fd);
return;
}
Actions