Bug 248150

Summary: ConsoleKit dbus API returns malformed XML for Introspection data
Product: [Fedora] Fedora Reporter: Daniel Berrangé <berrange>
Component: ConsoleKitAssignee: David Zeuthen <davidz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 7CC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.73-2.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-10 22:25:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Remove stray </property> tag none

Description Daniel Berrangé 2007-07-13 14:04:01 UTC
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 15:21:33 UTC
I wonder if this is a dbus-glib problem?

Comment 2 Daniel Berrangé 2007-08-01 16:53:33 UTC
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-03 02:40:44 UTC
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 Berrangé 2007-08-07 20:15:03 UTC
I just confirmed that dbus-glib-0.73-2.fc7 in updates-testing resolves the problem.

Comment 5 Fedora Update System 2007-08-10 22:25:09 UTC
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.