Index: test/data/auth/external-root.auth-script =================================================================== RCS file: /cvs/dbus/dbus/test/data/auth/external-root.auth-script,v retrieving revision 1.4 diff -u -r1.4 external-root.auth-script --- test/data/auth/external-root.auth-script 10 Jun 2007 04:54:45 -0000 1.4 +++ test/data/auth/external-root.auth-script 22 Jun 2007 07:38:08 -0000 @@ -1,5 +1,5 @@ ## this tests we can auth EXTERNAL as ourselves, with root credentials - +UNIX_ONLY SERVER ROOT_CREDENTIALS ## 30 is ASCII '0' in hex Index: dbus/dbus-auth-script.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-auth-script.c,v retrieving revision 1.24 diff -u -r1.24 dbus-auth-script.c --- dbus/dbus-auth-script.c 14 Jun 2007 20:59:16 -0000 1.24 +++ dbus/dbus-auth-script.c 22 Jun 2007 07:34:52 -0000 @@ -230,6 +230,27 @@ _dbus_credentials_unref (credentials); } +static void +auth_set_windows_credentials(DBusAuth *auth, + char *sid, + dbus_pid_t pid) +{ + DBusCredentials *credentials; + + credentials = _dbus_credentials_new (); + if (credentials == NULL) + _dbus_assert_not_reached ("no memory"); + + if (sid != NULL) + _dbus_credentials_add_windows_sid(credentials, sid); + if (pid != DBUS_PID_UNSET) + _dbus_credentials_add_unix_pid (credentials, pid); + + _dbus_auth_set_credentials (auth, credentials); + + _dbus_credentials_unref (credentials); +} + /** * Runs an "auth script" which is a script for testing the * authentication protocol. Scripts send and receive data, and then @@ -324,6 +345,38 @@ /* Ignore this comment */ goto next_iteration; } +#ifdef DBUS_WIN + else if (_dbus_string_starts_with_c_str (&line, + "WIN_ONLY")) + { + /* Ignore this line */ + goto next_iteration; + } + else if (_dbus_string_starts_with_c_str (&line, + "UNIX_ONLY")) + { + /* skip this file */ + _dbus_warn ("skipping unix only auth script\n"); + retval = TRUE; + goto out; + } +#endif +#ifdef DBUS_UNIX + else if (_dbus_string_starts_with_c_str (&line, + "UNIX_ONLY")) + { + /* Ignore this line */ + goto next_iteration; + } + else if (_dbus_string_starts_with_c_str (&line, + "WIN_ONLY")) + { + /* skip this file */ + _dbus_warn ("skipping windows only auth script\n"); + retval = TRUE; + goto out; + } +#endif else if (_dbus_string_starts_with_c_str (&line, "CLIENT")) { @@ -432,6 +485,11 @@ auth_set_unix_credentials (auth, 4312, DBUS_PID_UNSET); } else if (_dbus_string_starts_with_c_str (&line, + "ADMIN_CREDENTIALS")) + { + auth_set_windows_credentials (auth, "0", DBUS_PID_UNSET); + } + else if (_dbus_string_starts_with_c_str (&line, "ALLOWED_MECHS")) { char **mechs;