Project

General

Profile

Actions

Bug #3685

closed

Incorrect logging level for messages

Added by Chandan Chowdhury almost 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
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

Also available in: Atom PDF