Bug 854925

Summary: SNMP failed to auth if the password have space
Product: Red Hat Enterprise Linux 6 Reporter: Meng Liang <mliang>
Component: ovirt-nodeAssignee: Fabian Deutsch <fdeutsch>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, bsarathy, chchen, cshao, fdeutsch, gouyang, hadong, jbiddle, jboggs, leiwang, mburns, ovirt-maint, ycui
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-node-2.5.0-5.el6 Doc Type: Bug Fix
Doc Text:
Previously, it was possible to accidentally include spaces when attempting to set the snmpd password. This would cause the authentication to fail later with an error saying 'password length is too short'. Now, spaces in passwords have been blocked with an appropriate error message.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-28 16:38:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Meng Liang 2012-09-06 10:19:58 UTC
Description of problem:
when snmpd is set start with spcae like ' 1234567' or end with blank like '1234567 ', password can be saved successfully, but remote access fail due to 'password length is too short'.

Version-Release number of selected component (if applicable):
rhev-hypervisor6-6.3-20120815.0.el6_3

How reproducible:
Always

Steps to Reproduce:
1.Enable SNMP and set password as '12345678', press <Apply>
2.Change password to ' 2345678', press <Apply> (or '1234567 ')

  
Actual results:
The password could be changed and saved in /etc/snmp/snmpd.conf
[root@localhost admin]#cat /etc/snmp/snmpd.conf
master agentx
dontLogTCPWrappersConnects yes
rwuser root auth .1
createUser root SHA  2345678 AES

But on the remote terminal:
 [admin@(none) ~]$ snmpwalk -v3 -u root -l authPriv -a SHA -A  2345678 -x AES -X  2345678 10.66.11.115 sysDescr
 Error: passphrase chosen is below the length requirements of the USM (min=8).
 snmpwalk:  (The supplied password length is too short.)
 Error generating a key (Ku) from the supplied authentication pass phrase.

 [admin@(none) ~]$ snmpwalk -v3 -u root -l authPriv -a SHA -A ' 2345678' -x AES -X ' 2345678' 10.66.11.115 sysDescr
 snmpwalk: Authentication failure (incorrect password, community or key) (Sub-id not found: (top) -> sysDescr)

 [admin@(none) ~]$ snmpwalk -v3 -u root -l authPriv -a SHA -A “ 2345678” -x AES -X “ 2345678” 10.66.11.115 sysDescr
 snmpwalk: Authentication failure (incorrect password, community or key) (Sub-id not found: (top) -> sysDescr)


Expected results:
SNMP work correctly, showing SNMP Info on remote terminal
 or Cannot change the password successfully with Alert Message 'the password should not start or end with a blank'

Additional info:

Comment 2 Fabian Deutsch 2012-09-13 14:37:32 UTC
http://gerrit.ovirt.org/7991

This patch prevents the usage of spaces in the password.

I also tried circumventing this problem by using a hex representation and a quoted string in the configuration file. Both did not work.

Tested as follows:
1. Apply patch
2. Enter SNMP page
3. Pw+Confirmation "12345678"
works
4. Pw "1234567 " when leaving field the message appears: No spaces allowed. Field cleared
5. Pw "123456 7" when leaving field the message appears: No spaces allowed. Field cleared
6. Pw "1234567" when leaving field the message appears: Min 8 chars. Field cleared
7. No password, warning when hitting Apply

Comment 6 Fabian Deutsch 2012-09-27 13:17:52 UTC
Tested as in comment #2.

Comment 8 Meng Liang 2012-10-23 08:29:53 UTC
Test version:
rhev-hypervisor6-6.4-20121015.1.el6
Test steps and results:
1. Install rhevh 6.4
2. Enter SNMP page
3. Pw+Confirmation "12345678" works
4. Pw "1234567 "  =>'Password may not contain spaces'
5. Pw "123456 7"  =>'Password may not contain spaces'
6. Pw "      "    =>'Password may not contain spaces'
Thus the bug is fixed, change bug status to VERIFIED.

Comment 9 haiyang,dong 2012-12-27 03:11:41 UTC
so follow steps of comment 8 to re-test on version
rhev-hypervisor6-6.4-20121212.1.el6, bug was fixed on it.

Comment 13 errata-xmlrpc 2013-02-28 16:38:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0556.html