Bug 248150 - ConsoleKit dbus API returns malformed XML for Introspection data
Summary: ConsoleKit dbus API returns malformed XML for Introspection data
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ConsoleKit
Version: 7
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: David Zeuthen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-07-13 14:04 UTC by Daniel Berrangé
Modified: 2013-03-06 03:51 UTC (History)
1 user (show)

Fixed In Version: 0.73-2.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-10 22:25:12 UTC
Type: ---
Embargoed:


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

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.


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