Bug 248150 - ConsoleKit dbus API returns malformed XML for Introspection data
ConsoleKit dbus API returns malformed XML for Introspection data
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ConsoleKit (Show other bugs)
7
All Linux
high Severity high
: ---
: ---
Assigned To: David Zeuthen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-13 10:04 EDT by Daniel Berrange
Modified: 2013-03-05 22:51 EST (History)
1 user (show)

See Also:
Fixed In Version: 0.73-2.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-10 18:25:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Remove stray </property> tag (438 bytes, patch)
2007-08-01 12:53 EDT, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Daniel Berrange 2007-07-13 10:04:01 EDT
Description of problem:
When calling Introspect on any object implementing the
org.freedesktop.ConsoleKit.Session interface the XML returned contains malformed
tags. This causes the XML parser in any DBus client app to crash & burn.

Version-Release number of selected component (if applicable):
ConsoleKit-0.2.1-2.fc7

How reproducible:
Always

Steps to Reproduce:
1. Login to the GDM session
2. Write a client app to talk to ConsoleKit service
3. Try to use Introspection data for any object with the
org.freedesktop.ConsoleKit.Session interface
  
Actual results:
Malformed XML

Expected results:
Welformed XML

Additional info:
The flaw is in the properties description

    <property name="idle-hint" type="b" access="readwrite"/>
    </property>
    <property name="is-local" type="b" access="readwrite"/>
    </property>
    <property name="active" type="b" access="readwrite"/>
    </property>
    <property name="x11-display-device" type="s" access="readwrite"/>
    </property>
    <property name="x11-display" type="s" access="readwrite"/>
    </property>
    <property name="display-device" type="s" access="readwrite"/>
    </property>
    <property name="remote-host-name" type="s" access="readwrite"/>
    </property>
    <property name="session-type" type="s" access="readwrite"/>
    </property>
    <property name="user" type="u" access="readwrite"/>
    </property>
    <property name="unix-user" type="u" access="readwrite"/>
    </property>


Notice, it is using  empty tags, but also including a closing tag - completely
bogus & unparsable.


Demo program using perl-Net-DBus:

cat > ck.pl <<EOF
#!/usr/bin/perl                                                                
                                                                               
       

use strict;
use warnings;
use Net::DBus;

my $bus = Net::DBus->system;
my $ck = $bus->get_service("org.freedesktop.ConsoleKit");
my $ses = $ck->get_object("/org/freedesktop/ConsoleKit/Session1",
"org.freedesktop.ConsoleKit.Session");
print "Is active? ", $ses->IsActive, "\n";
EOF

# perl ck.pl
mismatched tag at line 84, column 6, byte 2770 at
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/Parser.pm line 187
Comment 1 David Zeuthen 2007-07-16 11:21:33 EDT
I wonder if this is a dbus-glib problem?
Comment 2 Daniel Berrange 2007-08-01 12:53:33 EDT
Created attachment 160433 [details]
Remove stray </property> tag

Yep, just looked at dbus-glib and it seems to have a stay bit of code adding
the closing tag. Attaching an (untested) patch which ought to fix it.
Comment 3 Fedora Update System 2007-08-02 22:40:44 EDT
dbus-glib-0.73-2.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 4 Daniel Berrange 2007-08-07 16:15:03 EDT
I just confirmed that dbus-glib-0.73-2.fc7 in updates-testing resolves the problem.
Comment 5 Fedora Update System 2007-08-10 18:25:09 EDT
dbus-glib-0.73-2.fc7 has been pushed to the Fedora 7 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.