<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>This summer I was able to connect to my (slightly) modified
DBus daemon over a TCP connection using the following options in my session
configuration file:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>
<listen>tcp:host=localhost,bind=*,port=6667,family=ipv4</listen>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> <listen>unix:tmpdir=/tmp</listen><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> <auth>EXTERNAL</auth><o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:6.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><auth>ANONYMOUS</auth><o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:6.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The small modification to the DBus daemon was an additional
call to <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:6.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>dbus_connection_set_allow_anonymous
(new_connection,</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=black><span
style='color:black'>TRUE);<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-indent:6.0pt'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>in the bus.c </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>new_connection_callback()
function.</span></font><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'><o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:6.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Recently I cloned the development head when I saw that Bug <a
href="http://bugs.freedesktop.org/show_bug.cgi?id=15393">15393</a> had been
applied that allows for anonymous authorization with the new
<allow_anonymous/> tag added to the system/session configuration options.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:6.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I rebuilt my DBus library and daemon and attempted to
connect to it using a Python DBus client on my PC (the daemon is running on a
target platform). Fortunately, I have a debugger on the DBus daemon and I can
see it detect the new connection (via TCP), set the connection so that it
allows anonymous users, but unfortunately, it still attempts to do local
authorization via SCM_CREDS because it ends up in do_authentication(). I’ve
verified in the debugger that ANONYMOUS is added as a valid authorization
mechanism.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Can anyone suggest why I’m seeing this behavior? I
thought the ANONYMOUS option would cause the daemon to forgo authorization via
SCM_CREDS. Does the daemon always try to do SCM_CREDS authorization even for
non-local (domain) sockets? Since I have this in a debugger, I’m able to
set breakpoints pretty much anywhere so I’m open to investigating this in
more detail. I suspect, however, that I must not fully understand the expected
behavior.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>