Problems with authentication - Latest state and summary - Problem solved

Bogdan Lotko boguslaw.lotko at chello.at
Fri May 27 15:03:58 PDT 2011


Hello Pavel,

Thanks for you help, the problem is already solved. The new dbus-daemon 
uses different (shorter) time stamp in the keyring file, then the old 
one (the old one used the epoch-time in seconds, the new one only 4  0r 
5 digits).

The solution is to change the

#define HAVE_MONOTONIC_CLOCK 1

statement in the config.h file (after configure) to the

#undef HAVE_MONOTONIC_CLOCK.

Then the old and new dbus libraries work together.

Thank you for your readiness to help,

with best regards,

Bogdan


On 5/27/2011 23:23, Pavel Strashkin wrote:
> Could you provide verbose files for both server and client? I see that
> server supports ANONYMOUS and sends information to the client about
> it, but client doesn't try to use it, only first two (EXTERNAL,
> DBUS_COOKIE_SHA1).
>
> 2011/5/25 Bogdan Lotko<boguslaw.lotko at chello.at>:
>> Hello,
>>
>> The problem is not solved yet, so please help !!!
>> In this mail I'll try to order all informations from (somehow) messy
>> previous mails.
>>
>> My goal is to start a legacy application as a D-Bus service on SuSE 10.3.
>> The application is compiled on SuSE 10.3, it uses libdbus-glib-1.so2 and
>> libdbus-1.so.3.
>>
>> The client application that uses the service is the QT application started
>> on the remote host running SuSE 11.2.
>>
>> The dbus-daemon V. 1.4.1 has been compiled and runs in verbose mode on SuSE
>> 10.3.
>>
>> The dbus-daemon listens on tcp connection
>> "tcp:host=192.168.0.10,port=12345". This is the address of the SuSE 10.3
>> host.
>> The .config file (please see attachment) has<allow_anonymous/>  statement.
>>
>> The remote application authenticates via ANONYMOUS mechanism without any
>> problems.
>>
>> The service application attempts to authenticate via EXTERNAL  and
>> DBUS_COOKIE_SHA1 mechanisms but it fails.
>> In case of EXTERNALS D-bus claims lack of credentials, for DBUS_COOKIE_SHA1
>> the application responses with "ERROR Don't have the requested cookie Id"???
>> ) - please see the attached verbose.txt file.
>>
>> The source code of the service application:
>>   g_type_init ();
>>
>> dbus_g_object_type_install_info( MstkBody_TYPE_OBJECT,
>>                                   &dbus_glib_mstkBody_object_info);
>>
>> // this works with session D-Bus
>> //bus = dbus_g_bus_get( DBUS_BUS_STARTER,&error );
>>
>> bus = dbus_g_connection_open( "tcp:host=192.168.0.10,port=12345",&error );
>> if (!bus)
>> {
>>    cout<<  "Couldn't connect to d-bus. "<<  error->message<<  ". EXITING"<<
>> endl;
>>    // This is an essential problem so...
>>    exit(1);
>> }
>>
>> bus_proxy = dbus_g_proxy_new_for_name( bus,
>>                                         "org.freedesktop.DBus",
>>                                         "/org/freedesktop/DBus",
>>                                         "org.freedesktop.DBus" );
>>
>> // fails here
>> if( !dbus_g_proxy_call( bus_proxy,
>>                         "RequestName",
>>                          &error,
>>                          G_TYPE_STRING,
>>                          mstkBodyServiceName.c_str(),
>>                          G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE,
>>                          G_TYPE_INVALID,
>>                          G_TYPE_UINT,
>>                          &request_name_result,
>>                          G_TYPE_INVALID) )
>> {
>>    // exit if this does not work
>>    cout<<  "Error calling RequestName: "<<  error->message<<  endl;
>>    exit(1);
>> }
>>
>> The application output looks like:
>>
>> Error calling RequestName: Did not receive a reply. Possible causes include:
>> the remote application did not send a reply, the message bus security policy
>> blocked the reply, the reply timeout expired, or the network connection was
>> broken.
>>
>> Please let me know what can I do for the successful authentication?
>>   - where the credentials come from?
>>   - why the application does not response correctly to DBUS_COOKIE_SHA1
>> mechanism?
>>   - why the SuSE 10.3 application does not use the ANONYMOUS mechanism? Is
>> there anything to do?
>> With session daemon the authentication of the service application works
>> without problems - why?
>>
>> Thanks,
>>
>> with best regards
>>
>> Bogdan Lotko
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> dbus mailing list
>> dbus at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dbus
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20110528/798eb590/attachment.htm>


More information about the dbus mailing list