Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

snmpd.conf community strings with a space?

104 views
Skip to first unread message

Jared Smith (jarsmith)

unread,
Jul 22, 2009, 7:13:12 PM7/22/09
to
This is a multi-part message in MIME format.

--===============2334335406684620078==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01CA0B21.145408FC"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA0B21.145408FC
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Hi I'm testing out some code that is both sending and receiving traps
from net-snmp I have noticed that if you double quote the community
string in snmpd.conf like this:

=20

trap2sink 10.10.10.10 "public"

=20

It will actually send the trap with the quotes in the community string.
I verified this in wireshark. However when I use snmptrapd it will not
authenticate that community string when entered as either "public" or
public. Wasn't able to find a way to authenticate with the quotes as it
seems to interpret the configuration differently than snmpd.conf.

=20

I know that it works properly if I drop the quotes in snmpd.conf so
tempted to just head this route; but if we desired to be able to support
community strings that contain a space how can that be accomplished
without sending the trap with the quotes in the packet? Or are spaces
disallowed in community strings in snmp all together? I searched
through some of the RFCs and it looked like they just say it is an octet
string without a whole lot of qualification about the specific
characters allowed. I did some searches on various vendors and it
looked like some allow space and some do not so curious if net-snmp has
some way of handling them?

=20

=20

Thanks for any advice in this matter,

=20

Jared


------_=_NextPart_001_01CA0B21.145408FC
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spreadsheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/meetings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/xml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/directory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/"=
xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile" =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/parttopart" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/workflow/" =
xmlns:dsss=3D"http://schemas.microsoft.com/office/2006/digsig-setup" =
xmlns:dssi=3D"http://schemas.microsoft.com/office/2006/digsig" =
xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/2006/digital-sig=
nature" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compatibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/2006/relationshi=
ps" xmlns:spwp=3D"http://microsoft.com/sharepoint/webpartpages" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/services/2006/types"=
=
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/services/2006/messag=
es" =
xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/=
" =
xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPortalServer/Pub=
lishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" =
xmlns:st=3D"&#1;" xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hi I&#8217;m testing out some code that is both =
sending and
receiving traps from net-snmp I have noticed that if you double quote =
the
community string in snmpd.conf like this:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>trap2sink 10.10.10.10 =
&#8220;public&#8221;<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>It will actually send the trap with the quotes in =
the
community string.&nbsp; I verified this in wireshark.&nbsp; However when =
I use
snmptrapd it will not authenticate that community string when entered as =
either
&#8220;public&#8221; or public.&nbsp; Wasn&#8217;t able to find a way to
authenticate with the quotes as it seems to interpret the configuration
differently than snmpd.conf.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I know that it works properly if I drop the quotes =
in
snmpd.conf so tempted to just head this route; but if we desired to be =
able to
support community strings that contain a space how can that be =
accomplished without
sending the trap with the quotes in the packet?&nbsp; Or are spaces =
disallowed
in community strings in snmp&nbsp; all together?&nbsp; I searched =
through some
of the RFCs and it looked like they just say it is an octet string =
without a
whole lot of qualification about the specific characters allowed.&nbsp; =
I did
some searches on various vendors and it looked like some allow space and =
some
do not so curious if net-snmp has some way of handling =
them?<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Thanks for any advice in this =
matter,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Jared<o:p></o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA0B21.145408FC--


--===============2334335406684620078==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============2334335406684620078==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-users mailing list
Net-snm...@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

--===============2334335406684620078==--

Dave Shield

unread,
Jul 23, 2009, 3:52:03 AM7/23/09
to
2009/7/23 Jared Smith (jarsmith) <jars...@cisco.com>:

> I have noticed that if you double quote the community string in
> snmpd.conf like this:
>
> trap2sink 10.10.10.10 =93public=94

>
> It will actually send the trap with the quotes in the community string.

So it does.
That's definitely a bug.

> However when I use snmptrapd it will =
not
> authenticate that community string when entered as either =93public=94 or
> public.=A0 Wasn=92t able to find a way to authenticate with the quotes

Try quoting the quoted string:

authcommunity log,execute,net '"public"'

That should work.

> as it seems to interpret the configuration differently than snmpd.conf.

It's not a difference between snmpd.conf and snmptrapd.conf.
Instead, it's a difference between "trapsink" and the access control entrie=
s.
Most configuration directives will handle quotes sensibly - it's just traps=
ink
et al that don't.


> if we desired to be able to support co=
mmunity


> strings that contain a space how can that be accomplished

For handling normal SNMP requests (GET* and SET), just quote the community
string, and the agent will strip these quotes off, as you would
naturally expect.
It's just sending traps that is affected in this way.

In fact, it's only the three *sink directives that are broken. A line such=
as

trapsess -v 2c -c "one two three" 10.10.10.10

will send traps using the community string one{space}two{space}three
without the quotes.

Dave

---------------------------------------------------------------------------=
---

0 new messages