Bug 16340 - Fails to handle sender information not being present in a dbus message gracefully
Summary: Fails to handle sender information not being present in a dbus message gracef...
Status: RESOLVED INVALID
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-13 04:39 UTC by James Westby
Modified: 2009-10-21 10:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description James Westby 2008-06-13 04:39:17 UTC
Hi,

I am working on debugging

  https://bugs.edge.launchpad.net/ubuntu/+source/policykit/+bug/219473

and I have come across a possible cause, at least for the warnings that
are shown in one of the messages.

I audited all of the kit_hash_insert usages, and only found one that could
try and add a new key, the one in polkit_tracker_get_caller_from_dbus_name.

It doesn't check that dbus_name is not NULL, presumably relying on 
dbus_error_is_set to be set if that is the case.

In polkitd/polkit-daemon.c in get_caller_from_context there is

  sender = dbus_g_method_get_sender (context);
  dbus_error_init (&dbus_error);
  pk_caller = polkit_tracker_get_caller_from_dbus_name (daemon->priv->pk_tracker,
                                                        sender,
                                                        &dbus_error);

which doesn't check for sender being NULL. Looking at the dbus code
shows that this can be NULL, as dbus messages don't always contain
sender information. dbus/dbus-message.c has the actual code, and in
dbus_message_new_method_return which is another caller has the
comment:

  /* sender is allowed to be null here in peer-to-peer case */

I believe that this can lead to the warning, and so could be handled
more gracefully. However, I'm not sure what PolicyKit's behaviour
should be in this case, but you probably have a better idea about
this than I.

I'm not sure if this is the cause of the bug that I linked to above,
but it is my best idea so far.

Thanks,

James
Comment 1 David Zeuthen (not reading bugmail) 2009-10-21 10:36:16 UTC
This bug report is for the old version of PolicyKit. Closing as all of the code has been rewritten. Please reopen if the bug report applies to the latest version of PolicyKit. Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.