win32 authentifaction problems after implementing new dbus authentification update

Ralf Habacker ralf.habacker at freenet.de
Thu Jun 21 08:02:14 PDT 2007


Ralf Habacker schrieb:
> Hi,
>
> with newest authentification changes dbus-test returns an error on win32.
>
> <snip>
> Testing auth:
>     anonymous-client-successful.auth-script
>     anonymous-server-successful.auth-script
>     cancel.auth-script
>     client-out-of-mechanisms.auth-script
>     external-failed.auth-script
>     external-root.auth-script
> line 7 expected command 'OK' and got 'REJECTED EXTERNAL DBUS_COOKIE_SHA1
> ANONYMOUS'
> Unit test failed: auth
>
> running the test with DBUS_VERBOSE=1 returns the following log.
>
> 2972: Sending 'AUTH EXTERNAL 30'
> 2972: server: got command "AUTH EXTERNAL 30"
> 2972: server: Trying mechanism EXTERNAL
> 2972: server: data: '0'
> 2972: server: desired identity not found in socket credentials
> 2972: server: Shutting down mechanism EXTERNAL
> 2972: server: going from state WaitingForAuth to state WaitingForAuth
> 2972: server: Sent 46 bytes of: REJECTED EXTERNAL DBUS_COOKIE_SHA1
> ANONYMOUS^M
>
> line 7 expected command 'OK' and got 'REJECTED EXTERNAL DBUS_COOKIE_SHA1
> ANONYMOUS'
>
>
> It looks like that the problem is caused by the ROOT_CREDENTIALS
> statement which is evaluated in _dbus_auth_script_run()
> ...
>
>      else if (_dbus_string_starts_with_c_str (&line,
>                                                "ROOT_CREDENTIALS"))
>         {
>           auth_set_unix_credentials (auth, 0, DBUS_PID_UNSET);
>         }
>       else if (_dbus_string_starts_with_c_str (&line,
>                                                "SILLY_CREDENTIALS"))
>         {
>           auth_set_unix_credentials (auth, 4312, DBUS_PID_UNSET);
>         }
>
>
> When i debug the code If found
> $3 = (DBusCredentials *) 0xa904b8
> (gdb) p *auth->credentials
> $4 = {refcount = 1, unix_uid = 0, unix_pid = 4294967295, windows_sid = 0x0}
> (gdb) p *auth->desired_identity
> $5 = {refcount = 1, unix_uid = 4294967295, unix_pid = 4294967295,
>   windows_sid = 0x3d4710 "0"}
> (gdb)
>
> Any idea how to fix this issue ?
>
>   
I got the reason by myself. external-root.auth-script uses a
ROOT_CREDENTIALS line to setup root credentials which does not work
under windows.

The appended patch adds a  auth_set_windows_credentials() function for
windows. Additional a new file test/data/auth/external-admin.auth-script
is appended.
The only problem not solved yet is how to skip the
external-root.auth-script on win32 and the external-admin.auth-script on
unix.

May be there could be additional subdirs containing platform related
files or the script could have a platform identifier in name, which
could skipped or included in dbus-auth-util.c:process_test_subdir().
A similar issues will probably relates to the "SILLY_CREDENTIALS" used
in the external.silly.auth-script. May be this problem will occur on
several additional places, i don't know.

Ralf

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dbus-test.patch
Url: http://lists.freedesktop.org/archives/dbus/attachments/20070621/9737c007/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: external-admin.auth-script
Url: http://lists.freedesktop.org/archives/dbus/attachments/20070621/9737c007/attachment-0001.txt 


More information about the dbus mailing list