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: Strip " and / from snmpwalk_cache_oid() #7063
Conversation
@laf you could also just modify the previous trim. snmpwalk_group() trims quotes, spaces, and newlines, but not / why is that needed? |
@murrant I left the old trim in place as that trims the defaults off, if you specify what to trim that doesn't happen anymore does it? I thought it didn't hence adding the new trim. The / is in the snmpwalk output so seems to be sent back by the device. I've seen this in other walks as well. |
You can include the defaults. This is what I have snmpwalk_group(), which is not the full defaults those are
|
I couldn't find an example of |
The poller output in the bug report shows what is returned now:
Seeing as we also have to trim |
@laf the " is because the " is in the string input by the user and the snmp daemon escapes it... Look at this one: We can probably update them all to |
Which of those are you concerned about as it looks like we should strip them all. |
laf mostly, the It is likely that particular edge case will never cause us any issues. |
It's a bit of a rabbit whole this. This is what I've come up with so far but I feel less comfortable about this solution then I do my original: |
Your paste isn't loading. What do you think about just trimming: |
Updated |
The inspection completed: No new issues |
This thread has been automatically locked since there has not been any recent activity after it was closed. |
DO NOT DELETE THIS TEXT
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926
Fixes: #6993
I've not done any other snmp functions yet but they probably should be done to save trim() being used everywhere.