Bug 968397 - CIM clients are sometimes getting HTTP/1.1 501 Not Implemented
CIM clients are sometimes getting HTTP/1.1 501 Not Implemented
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: sblim-sfcb (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Vitezslav Crhonek
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 1102477
  Show dependency treegraph
 
Reported: 2013-05-29 12:10 EDT by Tomáš Bžatek
Modified: 2015-03-03 18:06 EST (History)
4 users (show)

See Also:
Fixed In Version: sblim-sfcb-1.3.16-7.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-05 20:12:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sblim-sfcb-1.3.16-http-header-cmd-check.patch (664 bytes, patch)
2013-05-29 12:18 EDT, Tomáš Bžatek
no flags Details | Diff

  None (edit)
Description Tomáš Bžatek 2013-05-29 12:10:14 EDT
Description of problem:
So I was wondering why simple wbemcli instance enumeration doesn't work on sfcbd but works on Pegasus with the same query. The wbemcli client was getting HTTP/1.1 501 Not Implemented from the server.

So I started debugging sfcbd and grabbed a query from YAWN (basically the same operation on the same class). First I thought the query was malformed but putting the working query in curl I got 501 again. Funny that moving from https to http made it work.

So I started looking in sfcbd sources, added some prints to see what's in the buffer. Eventually it came up that buffer handling in httpAdapter.c:getHdrs() is wrong since for some reason the incoming message was fragmented at the beginning, within the "POST" string that was also being checked to match the expected http command/method.

Version-Release number of selected component (if applicable):
sblim-sfcb-1.3.16-3.fc19.x86_64

How reproducible:
always

Steps to Reproduce:
$ wbemcli ei -noverify -dx 'https://user:pass@localhost:59890/root/cimv2:LMI_LANEndpoint'

- or -

$ curl -vvv --insecure 'https://user:pass@localhost:59890/root/cimv2:LMI_LANEndpoint' -H 'Content-type: application/xml; charset="utf-8"' -H 'CIMOperation: MethodCall' -H 'CIMMethod: EnumerateInstances' -H 'CIMObject: root/cimv2' -H 'Accept-Encoding: identity' -d '<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0"><MESSAGE ID="1001" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="EnumerateInstances"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"/><NAMESPACE NAME="cimv2"/></LOCALNAMESPACEPATH><IPARAMVALUE NAME="ClassName"><CLASSNAME NAME="LMI_LANEndpoint"/></IPARAMVALUE><IPARAMVALUE NAME="LocalOnly"><VALUE>FALSE</VALUE></IPARAMVALUE></IMETHODCALL></SIMPLEREQ></MESSAGE></CIM>'

Actual results:
* About to connect() to localhost port 59890 (#0)
*   Trying ::1...
* Connected to localhost (::1) port 59890 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* 	subject: E=root@localhost.localdomain,CN=localhost.localdomain
* 	start date: May 16 14:38:45 2013 GMT
* 	expire date: May 16 14:38:45 2014 GMT
* 	common name: localhost.localdomain
* 	issuer: E=root@localhost.localdomain,CN=localhost.localdomain
* Server auth using Basic with user 'root'
> POST /root/cimv2:LMI_LANEndpoint HTTP/1.1
> Authorization: Basic cm9vdDpoZXNsbw==
> User-Agent: curl/7.29.0
> Host: localhost:59890
> Accept: */*
> Content-type: application/xml; charset="utf-8"
> CIMOperation: MethodCall
> CIMMethod: EnumerateInstances
> CIMObject: root/cimv2
> Accept-Encoding: identity
> Content-Length: 445
> 
* upload completely sent off: 445 out of 445 bytes
< HTTP/1.1 501 Not Implemented
< Server: sfcHttpd
< Content-Length: 0
< 
* Connection #0 to host localhost left intact
Comment 1 Tomáš Bžatek 2013-05-29 12:18:06 EDT
Created attachment 754458 [details]
sblim-sfcb-1.3.16-http-header-cmd-check.patch

httpAdapter: Check for cmd in whole buffer

The commRead() call may return data not always aligned to newlines,
in fact data are typically fragmented for https connection. The test
for "cmd" presence in headers may actually end up checking shorter
buffer than the string itself, resulting in immediate error return
instead of waiting for next chunk.
Comment 2 Fedora Update System 2013-07-23 10:25:03 EDT
sblim-sfcb-1.3.16-7.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/sblim-sfcb-1.3.16-7.fc19
Comment 3 Fedora Update System 2013-07-23 23:46:46 EDT
Package sblim-sfcb-1.3.16-7.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing sblim-sfcb-1.3.16-7.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-13537/sblim-sfcb-1.3.16-7.fc19
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2013-08-05 20:12:10 EDT
sblim-sfcb-1.3.16-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.