Skip to content

Conversation

@insatomcat
Copy link

@insatomcat insatomcat commented Feb 15, 2024

On debian stable (net-snmp 5.9.3), net-snmp makes snmp_passpersist crash on every "set" command.
It appears net-snmp sends an empty line after receiving the "DONE" message.
I solved this problem by making snmp_passpersist ignore all empty input lines.

On debian stable (net-snmp 5.9.3), net-snmp makes snmp_passpersist crash on every "set" command.
It appears net-snmp sends an empty line after receiving the "DONE" message.
I solved this problem by making snmp_passpersist ignores all empty input lines.

Signed-off-by: Florent CARLI <[email protected]>
@alepinio
Copy link

Hi!

I've also found this bug when receiving SET commands with snmp 5.8+dfsg-2ubuntu2.9 in Ubuntu 20.04.

I've tested this patch but unfortunately the pass persist script breaks when receiving subsequent commands.

The patch below does the job, at least up to my testing:

diff --git a/snmp_passpersist.py b/snmp_passpersist.py
index e40da7a..31680b7 100644
--- a/snmp_passpersist.py
+++ b/snmp_passpersist.py
@@ -248,7 +248,9 @@ class PassPersist(object):
                        raise EOFError()
                line = line.strip()
 
-               if 'PING' in line:
+               if line == '':
+                       pass
+               elif 'PING' in line:
                        print("PONG")
                elif 'getnext' in line:
                        oid = self.cut_oid(sys.stdin.readline().strip())

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.

2 participants