Revert "Add new files really."
[platform/upstream/dbus.git] / dbus / dbus-auth-script.c
index cbdd748..445452c 100644 (file)
@@ -22,7 +22,7 @@
  */
 #include <config.h>
 
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
 
 #include "dbus-auth-script.h"
 #include "dbus-auth.h"
@@ -30,6 +30,7 @@
 #include "dbus-hash.h"
 #include "dbus-credentials.h"
 #include "dbus-internals.h"
+#include "dbus-authorization.h"
 
 /**
  * @defgroup DBusAuthScript code for running unit test scripts for DBusAuth
@@ -401,6 +402,7 @@ _dbus_auth_script_run (const DBusString *filename)
                                                "SERVER"))
         {
           DBusCredentials *creds;
+          DBusAuthorization *authorization;
           
           if (auth != NULL)
             {
@@ -408,7 +410,16 @@ _dbus_auth_script_run (const DBusString *filename)
               goto out;
             }
 
-          auth = _dbus_auth_server_new (&guid);
+          /* empty authorization, it will use default rules */
+          authorization = _dbus_authorization_new ();
+          if (authorization == NULL)
+            {
+              _dbus_warn ("no memory to create DBusAuthorization\n");
+              goto out;
+            }
+          auth = _dbus_auth_server_new (&guid, authorization);
+          /* DBusAuth owns it, or finalized on OOM */
+          _dbus_authorization_unref (authorization);
           if (auth == NULL)
             {
               _dbus_warn ("no memory to create DBusAuth\n");
@@ -800,4 +811,4 @@ _dbus_auth_script_run (const DBusString *filename)
 }
 
 /** @} */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */