diff options
Diffstat (limited to 'dbus/dbus-auth-script.c')
-rw-r--r-- | dbus/dbus-auth-script.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c index 445452c7..107c92b2 100644 --- a/dbus/dbus-auth-script.c +++ b/dbus/dbus-auth-script.c @@ -398,8 +398,8 @@ _dbus_auth_script_run (const DBusString *filename) _dbus_credentials_unref (creds); } - else if (_dbus_string_starts_with_c_str (&line, - "SERVER")) + else if (_dbus_string_starts_with_c_str (&line, "SERVER") || + _dbus_string_starts_with_c_str (&line, "SERVER_ANONYMOUS")) { DBusCredentials *creds; DBusAuthorization *authorization; @@ -417,6 +417,11 @@ _dbus_auth_script_run (const DBusString *filename) _dbus_warn ("no memory to create DBusAuthorization\n"); goto out; } + /* if we are testing an anonymous server, we need to enable + * anonymous authorization, or the mech will REJECT */ + if (_dbus_string_starts_with_c_str (&line, "SERVER_ANONYMOUS")) + _dbus_authorization_set_allow_anonymous (authorization, TRUE); + auth = _dbus_auth_server_new (&guid, authorization); /* DBusAuth owns it, or finalized on OOM */ _dbus_authorization_unref (authorization); |