Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: return with error code when mqtt connect fails #671

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

Kraemii
Copy link
Member

@Kraemii Kraemii commented Mar 23, 2022

What:
Handle error of mqtt_connect
SC-566

Why:
When mqtt_connect failed, no error was returned and openvas thought the MQTT connection was successful even when it was not.

How:
Start a scan without a broker. Compare before patch and after. Before yout get these messages:

libgvm util:CRITICAL:2022-03-23 09h26.41 utc:4416: mqtt_connect: mqtt connection error to tcp://127.0.0.1:1883: Failure
sd   main:MESSAGE:2022-03-23 09h26.41 utc:4416: attack_network_init: INIT MQTT: SUCCESS 

after the patch you get

sd   main:MESSAGE:2022-03-23 10h34.47 utc:21180: Running LSC via Notus for 127.0.0.1
libgvm util:CRITICAL:2022-03-23 10h34.47 utc:21180: mqtt_connect: mqtt connection error to tcp://127.0.0.1:1883: Failure
libgvm util:WARNING:2022-03-23 10h34.47 utc:21180: mqtt_init: Unable to connect to MQTT broker.

Checklist:

  • Tests
  • PR merge commit message adjusted

@Kraemii Kraemii requested a review from a team March 23, 2022 10:36
@ArnoStiefvater ArnoStiefvater merged commit 95fa8ee into greenbone:main Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants